[root@centoszang 桌面]# redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refused Could not connect to Redis at 127.0.0.1:6379: Connection refused not connected> exit [root@centoszang 桌面]# redis-server /etc/redis.conf [root@centoszang 桌面]# redis-cli 127.0.0.1:6379>
在使用Redis时,开始就遇到了问题,客户端打不开,缘由是须要先开启服务端,这须要先配置——redis
1.下载好redis安装包,解压安装以后,复制其配置文件redis.conf 到etc 文件夹下centos
cd /opt/redis-3.2.8spa
cp redis.conf /etccode
2. 进入etc,找到redis.conf 并修改 daemonize no(第128行) 为 daemonize yes ,这样就能够默认启动就后台运行server
3. 开启客户端要确保服务端启动 blog
redis-server /etc/redis.confit
4.启动客户端不成功要退出再进行下一步io