创建redis集群的时候会出现警告提示,如下:


[root@itheima redis-cluster]# ./redis-trib.rb create --replicas 1 192.168.5.128:7001 192.168.5.128:7002 192.168.5.128:7003 192.168.5.128:7004 192.168.5.128:7005 192.168.5.128:7006 >>> Creating cluster Connecting to node 192.168.5.128:7001: OK /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:182: warning: wrong element type nil at 98 (expected array) /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:182: warning: ignoring wrong elements is deprecated, remove them explicitly /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:182: warning: this causes ArgumentError in the next release ...... ...... Connecting to node 192.168.5.128:7002: OK /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:182: warning: wrong element type nil at 98 (expected array) /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:182: warning: ignoring wrong elements is deprecated, remove them explicitly /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:182: warning: this causes ArgumentError in the next release ...... ...... Connecting to node 192.168.5.128:7003: OK Connecting to node 192.168.5.128:7004: OK Connecting to node 192.168.5.128:7005: OK Connecting to node 192.168.5.128:7006: OK >>> Performing hash slots allocation on 6 nodes... Using 3 masters: 192.168.5.128:7001 192.168.5.128:7002 192.168.5.128:7003 Adding replica 192.168.5.128:7004 to 192.168.5.128:7001 Adding replica 192.168.5.128:7005 to 192.168.5.128:7002 Adding replica 192.168.5.128:7006 to 192.168.5.128:7003 M: 3cbed89c47ca14b3d1eb11dd2f7525fa6cb4fcd7 192.168.5.128:7001    slots:0-5460 (5461 slots) master M: 27d069e1b4d459a92b6cc9a1c92ad46ea00cb61d 192.168.5.128:7002    slots:5461-10922 (5462 slots) master M: d7d28caadfdc4161261305f2d2baf55d2d8f4221 192.168.5.128:7003    slots:10923-16383 (5461 slots) master S: f124b72c0421c7514f44668d30761d075e42643d 192.168.5.128:7004    replicates 3cbed89c47ca14b3d1eb11dd2f7525fa6cb4fcd7 S: 8cf60c085a58b60557a887a5e8451ce38e6b54fa 192.168.5.128:7005    replicates 27d069e1b4d459a92b6cc9a1c92ad46ea00cb61d S: 05ad0eb9b5f839771b09dc18192909d5fa1f893e 192.168.5.128:7006    replicates d7d28caadfdc4161261305f2d2baf55d2d8f4221 Can I set the above configuration? (type 'yes' to accept): yes >>> Nodes configuration updated >>> Assign a different config epoch to each node >>> Sending CLUSTER MEET messages to join the cluster Waiting for the cluster to join...... >>> Performing Cluster Check (using node 192.168.5.128:7001) M: 3cbed89c47ca14b3d1eb11dd2f7525fa6cb4fcd7 192.168.5.128:7001    slots:0-5460 (5461 slots) master M: 27d069e1b4d459a92b6cc9a1c92ad46ea00cb61d 192.168.5.128:7002    slots:5461-10922 (5462 slots) master M: d7d28caadfdc4161261305f2d2baf55d2d8f4221 192.168.5.128:7003    slots:10923-16383 (5461 slots) master M: f124b72c0421c7514f44668d30761d075e42643d 192.168.5.128:7004    slots: (0 slots) master    replicates 3cbed89c47ca14b3d1eb11dd2f7525fa6cb4fcd7 M: 8cf60c085a58b60557a887a5e8451ce38e6b54fa 192.168.5.128:7005    slots: (0 slots) master    replicates 27d069e1b4d459a92b6cc9a1c92ad46ea00cb61d M: 05ad0eb9b5f839771b09dc18192909d5fa1f893e 192.168.5.128:7006    slots: (0 slots) master    replicates d7d28caadfdc4161261305f2d2baf55d2d8f4221 [OK] All nodes agree about slots configuration. >>> Check for open slots... >>> Check slots coverage... [OK] All 16384 slots covered. [root@itheima redis-cluster]#


是警告不是错误,不影响创建redis集群。但是看着还是很不舒服。

警告翻译如下:


warning: wrong element type nil at 98 (expected array) warning: ignoring wrong elements is deprecated, remove them explicitly warning: this causes ArgumentError in the next release 警告:98处的错误元素类型为nil(预期数组) 警告:不推荐忽略错误的元素,请明确删除它们 警告:这会在下一个版本中导致ArgumentError


解决方法:


1)、将需要新增的节点下appendonly.aof、dump.rdb等本地备份文件删除; 2)、同时将新node的集群配置文件删除,即:删除你redis.conf里面cluster-config-file所在的文件;如果是默认的话,那就是删除nodes.conf 文件。 3)、再次添加新节点如果还是报错,则登录新node后,./redis-cli –h 192.168.5.128 –p 7007 对数据库进行清除:   192.168.5.128:7007>  flushall  #清空所有库的key



Copyright ©2018-2019

文章务必保留出处和署名,谢谢!】