redis 創建集群時 出現的錯誤解決方式


1. 創建集群時報以下錯誤

(1)錯誤1


./redis-trib.rb create --replicas 1 XXXXXX:5301 XXXXXX:5302 XXXXXX:5303 XXXXXX:5304 XXXXXX:5305  XXXXXX:5306

/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- redis (LoadError)

from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'

from ./redis-trib.rb:25:in `<main>'

解決方式 :  可能是因為沒有安裝 ruby的 redis插件

                gem install redis-3.0.7.gem

 

 

(2)錯誤2

./redis-trib.rb create --replicas 1 XXXXXX:5301 XXXXXX:5302 XXXXXX:5303 XXXXXX:5304 XXXXXX:5305  XXXXXX:5306

>>> Creating cluster

[ERR] Node XXXXXX:5302 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.

解決方式 : 不同節點的數據庫中包含相同的數據,把所有的數據庫的數據清除即可  , 命令 : flushdb

 

(3)錯誤3

Can I set the above configuration? (type 'yes' to accept): yes

/usr/local/rvm/gems/ruby-2.2.1/gems/redis-3.0.7/lib/redis/client.rb:97:in `call': ERR Slot 5474 is already busy (Redis::CommandError)

from /usr/local/rvm/gems/ruby-2.2.1/gems/redis-3.0.7/lib/redis.rb:2432:in `block in method_missing'

from /usr/local/rvm/gems/ruby-2.2.1/gems/redis-3.0.7/lib/redis.rb:37:in `block in synchronize'

from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'

from /usr/local/rvm/gems/ruby-2.2.1/gems/redis-3.0.7/lib/redis.rb:37:in `synchronize'

from /usr/local/rvm/gems/ruby-2.2.1/gems/redis-3.0.7/lib/redis.rb:2431:in `method_missing'

from ./redis-trib.rb:212:in `flush_node_config'

from ./redis-trib.rb:775:in `block in flush_nodes_config'

from ./redis-trib.rb:774:in `each'

from ./redis-trib.rb:774:in `flush_nodes_config'

from ./redis-trib.rb:1295:in `create_cluster_cmd'

from ./redis-trib.rb:1695:in `<main>'

解決方式 : 是因為之前創建redis集群時錯誤因起的,只需要把 redis.conf 中指定的文件刪除即可,一般默認的文件名是: nodes.conf , 所有的節點下都有一個這樣的文件,所以需要把所有的nodes.conf都刪除即可

 


免責聲明!

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



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