創建redis cluster時,有警告提示


創建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

參考鏈接:

  http://www.php-master.com/post/325868.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM