第一步 —— 执行安装命令
# yum install redis
第二步 —— 启动Redis
# service redis start
# chkconfig redis on
第三步 —— 连接Redis
# redis-cli
如果报以下信息,证明没启动redis Could not connect to Redis at 127.0.0.1:6379: Connection refused
出现这种情况可查看/etc/redis.conf中的daemonize 是否为yes,不是则修改(vi基本命令这里不做说明)
# vi /etc/redis.conf
使用ps -ef | grep redis查看redis进程:
[root
@localhost etc]
redis
47664 1 0 05:
31 ?
00:
00:
00 /usr/bin/redis-server
127.0.
0.
1:
6379
root
47808 45376 0 05:
32 pts/
0 00:
00:
00 grep –color=auto redis