Redis 服務端配置——Could not connect to Redis at 127.0.0.1:6379: Connection refused

[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

相關文章
相關標籤/搜索