创建redis集群服务时,提示以下错误:
/usr/local/rvm/gems/ruby-2.4.5/gems/redis-4.1.0/lib/redis/client.rb:124:in `call': ERR Invalid node address specified: hadoop01:7001 (Redis::CommandError)from /usr/local/rvm/gems/ruby-2.4.5/gems/redis-4.1.0/lib/redis.rb:3282:in `block in cluster'from /usr/local/rvm/gems/ruby-2.4.5/gems/redis-4.1.0/lib/redis.rb:50:in `block in synchronize'from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'from /usr/local/rvm/gems/ruby-2.4.5/gems/redis-4.1.0/lib/redis.rb:50:in `synchronize'from /usr/local/rvm/gems/ruby-2.4.5/gems/redis-4.1.0/lib/redis.rb:3281:in `cluster'from ./redis-trib.rb:941:in `block in join_cluster'from ./redis-trib.rb:939:in `each'from ./redis-trib.rb:939:in `join_cluster'from ./redis-trib.rb:1431:in `create_cluster_cmd'from ./redis-trib.rb:1830:in `<main>'
这个错误说指定的节点地址无效、出现这个问题是因为./Redis-trib.rb对本机名设别不了,支持的不是很好。
解决方案:
换成ip:port的方式即可解决。
./redis-trib.rb create --replicas 1 ip1:port1 ip2:port2 ip3:port3 ip4:port4