期初将redis部署到服务上,按照官网部署,以为很简单(其实也很简单),就直接搭建的集群,没有单个搭建,把conf里面 的东西修改坏了,导致redis一直连接不上服务器上的redis,redis refuse connection
解决
把bind 的配置项注释
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#bind 127.0.0.1
问题得到解决
4、注意:当前我的redis服务端设置的密码访问
如果没设置密码的话,通过以上处理,还是连接不上,可尝试一下操作
# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
#protected-mode yes
注释 保护模式,之后重启
、若还是不行、可注释一下配置
# 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
该项配置 Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程,设置为no