建立redis cluster時,有警告提示

2022-01-31 11:31:09 字數 4278 閱讀 4609

建立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 6nodes...

using 3masters:

192.168.5.128:7001

192.168.5.128:7002

192.168.5.128:7003adding replica 192.168.5.128:7004 to 192.168.5.128:7001adding replica 192.168.5.128:7005 to 192.168.5.128:7002adding replica 192.168.5.128:7006 to 192.168.5.128:7003m: 3cbed89c47ca14b3d1eb11dd2f7525fa6cb4fcd7 192.168.5.128:7001slots:0-5460 (5461slots) master

m: 27d069e1b4d459a92b6cc9a1c92ad46ea00cb61d 192.168.5.128:7002slots:5461-10922 (5462slots) master

m: d7d28caadfdc4161261305f2d2baf55d2d8f4221 192.168.5.128:7003slots:10923-16383 (5461slots) master

s: f124b72c0421c7514f44668d30761d075e42643d 192.168.5.128:7004replicates 3cbed89c47ca14b3d1eb11dd2f7525fa6cb4fcd7

s: 8cf60c085a58b60557a887a5e8451ce38e6b54fa 192.168.5.128:7005replicates 27d069e1b4d459a92b6cc9a1c92ad46ea00cb61d

s: 05ad0eb9b5f839771b09dc18192909d5fa1f893e 192.168.5.128:7006replicates 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

forthe cluster to join......

>>> performing cluster check (using node 192.168.5.128:7001)

m: 3cbed89c47ca14b3d1eb11dd2f7525fa6cb4fcd7 192.168.5.128:7001slots:0-5460 (5461slots) master

m: 27d069e1b4d459a92b6cc9a1c92ad46ea00cb61d 192.168.5.128:7002slots:5461-10922 (5462slots) master

m: d7d28caadfdc4161261305f2d2baf55d2d8f4221 192.168.5.128:7003slots:10923-16383 (5461slots) master

m: f124b72c0421c7514f44668d30761d075e42643d 192.168.5.128:7004slots: (0slots) master

replicates 3cbed89c47ca14b3d1eb11dd2f7525fa6cb4fcd7

m: 8cf60c085a58b60557a887a5e8451ce38e6b54fa 192.168.5.128:7005slots: (0slots) master

replicates 27d069e1b4d459a92b6cc9a1c92ad46ea00cb61d

m: 05ad0eb9b5f839771b09dc18192909d5fa1f893e 192.168.5.128:7006slots: (0slots) master

replicates d7d28caadfdc4161261305f2d2baf55d2d8f4221

[ok] all nodes agree about slots configuration.

>>> check for

open slots...

>>>check slots coverage...

[ok] all 16384slots 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(預期陣列)

解決方法:

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

CygWin安裝RedisCluster指南

安裝前確認磁碟有6g以上的磁碟容量,安裝時雙擊setup x86 64.exe,基本按照預設設定安裝就行,也可自己指定安裝路徑等,3 deps hiredis net.c中注釋掉 並在 include sds.h 之後追加 ifdef cygwin define tcp keepcnt 8 defi...

RedisCluster搭建步驟

安裝redis 配置並啟動redis節點 選兩台機器執行該步驟 把redis安裝目錄redis.conf修改如下並複製進對應的700 資料夾 bind 10.11.147.40 redis安裝機器ip 注意這裡千萬不要用127.0.0.1或者注釋掉這行,以上兩種都會導致遠端機器連線不到redis p...

redisCluster環境準備

需要 redis3.0以上的版本 我使用了redis3.2.12 之後需要ruby環境 yum install ruby yum install rubygems 安裝redis trib.rb執行依賴的ruby的包redis 3.2.2.gem 位址為 gem install redis 3.2....