redis工具之redis-trib.rb

安装

前题需要安装ruby

brew install ruby
gem install redis

将文件redis-trib.rb拷贝到/usr/local/bin 下
如果集群设置了密码,执行redis-trib.rb相关命令会报[ERR] Sorry, can’t connect to node 127.0.0.1:7000

修改ruby的client.rb文件
/usr/local/rvm/gems/ruby-2.4.1/gems/redis-4.0.1/lib/redis/client.rb

可能大家路径不一样,find / -name client.rb找一下

DEFAULTS = {
      :url => lambda { ENV["REDIS_URL"] },
      :scheme => "redis",
      :host => "127.0.0.1",
      :port => 6379,
      :path => nil,
      :timeout => 5.0,
      :password => "xxxxxx",
      :db => 0,
      :driver => nil,
      :id => nil,
      :tcp_keepalive => 0,
      :reconnect_attempts => 1,
      :inherit_socket => false
    }

修改password就可以了

你可能感兴趣的:(redis集群,环境部署)