CentOS6.4 安裝Redis,centos6.4安裝redis

來源:互聯網
上載者:User

CentOS6.4 安裝Redis,centos6.4安裝redis

按照下面步驟依次執行
1.檢查依賴,安裝依賴

[root@ecs-3c46 ~]# whereis gccgcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz[root@ecs-3c46 ~]# whereis tctc: /sbin/tc /usr/lib64/tc /usr/share/tc /usr/share/man/man8/tc.8.gz[root@ecs-3c46 ~]# whereis wgetwget: /usr/bin/wget /usr/share/man/man1/wget.1.gz[root@ecs-3c46 ~]# yum -y install tcl

2.進入/user/local/src/

[root@ecs-3c46 ~]# cd /user/local/src/

3.wget下載redis

[root@ecs-3c46 src]# wget http://download.redis.io/releases/redis-3.0.7.tar.gz

4.解壓

[root@ecs-3c46 src]tar zxvf redis-3.0.7.tar.gz

5.將檔案轉存到/usr/local/redis

[root@ecs-3c46 src]mkdir /usr/local/redis[root@ecs-3c46 src]mv redis-3.0.7 /usr/local/redis[root@ecs-3c46 src]ll /usr/local/redis

6.編譯安裝

[root@ecs-3c46 src]cd /usr/local/redis[root@ecs-3c46 redis]make && make install

 7.在etc目錄下建立redi檔案夾並建立設定檔,並修改設定檔

[root@ecs-3c46 redis]mkdir -p /etc/redis[root@ecs-3c46 redis]pwd[root@ecs-3c46 redis]cp -fr /usr/local/redis/redis.conf /etc/redis/

8.vim編輯/etc/redis/redis.conf,修改daemonize屬性為yes

[root@ecs-3c46 redis]# vim /usr/local/redis/redis.conf# By default Redis does not run as a daemon. Use 'yes' if you need it.# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.daemonize yes

 9.執行/usr/loal/bin/redis-server /etc/redis/redis.conf來啟動redis伺服器

[root@ecs-3c46 redis]# /usr/loal/bin/redis-server /etc/redis/redis.conf-bash: /usr/loal/bin/redis-server: No such file or directory[root@ecs-3c46 redis]# /usr/local/bin/redis-server /etc/redis/redis.conf73449:M 13 May 10:56:00.839 * Increased maximum number of open files to 10032 (it was originally set to 1024).                _._                                                             _.-``__ ''-._                                                   _.-``    `.  `_.  ''-._           Redis 3.0.7 (00000000/0) 64 bit  .-`` .-```.  ```\/    _.,_ ''-._                                    (    '      ,       .-`  | `,    )     Running in standalone mode |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379 |    `-._   `._    /     _.-'    |     PID: 73449  `-._    `-._  `-./  _.-'    _.-'                                    |`-._`-._    `-.__.-'    _.-'_.-'|                                   |    `-._`-._        _.-'_.-'    |           http://redis.io          `-._    `-._`-.__.-'_.-'    _.-'                                    |`-._`-._    `-.__.-'    _.-'_.-'|                                   |    `-._`-._        _.-'_.-'    |                                    `-._    `-._`-.__.-'_.-'    _.-'                                         `-._    `-.__.-'    _.-'                                                 `-._        _.-'                                                         `-.__.-'                                               

 10.再開啟一個終端,切換至redis的安裝目錄執行redis-cli

[root@ecs-3c46 bin]# redis-cli127.0.0.1:6379> keys *(empty list or set)127.0.0.1:6379> 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.