本文共 1643 字,大约阅读时间需要 5 分钟。
创建Redis集群,但是报错:
[root@bigdata mycluster]# redis-trib.rb create --replicas 1 192.168.0.9:6380 192.168.0.9:6381 192.168.0.9:6382 192.168.0.9:6383 192.168.0.9:6384 192.168.0.9:6385 >>> Creating cluster[ERR] Sorry, can't connect to node 192.168.0.9:6380修改redis配置文件redis.conf的时候,修改bind后为本机ip,但是自己修改bind的位置错了,修改为:
# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server. # It is possible to listen to just one or multiple selected interfaces using # the "bind" configuration directive, followed by one or more IP addresses. # # Examples: # # bind 192.168.1.100 10.0.0.1 # bind 127.0.0.1 ::1bind 192.168.0.9而实际应当修改位置为,如果修改错误,则创建集群时无法访问对应的端口,无法创建集群
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the # instance to everybody on the internet. So by default we uncomment the # following bind directive, that will force Redis to listen only into # the IPv4 lookback interface address (this means Redis will be able to # accept connections only from clients running into the same computer it # is running). # # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES # JUST COMMENT THE FOLLOWING LINE. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~bind 127.0.0.1解决问题很简单,修改正确bind参数位置为本机ip即可,
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bind 192.168.0.9转载地址:http://wjygi.baihongyu.com/