redis-trib.rb

line 51: ..................... def initialize(addr) s = addr.split(":") if s.length < 2 puts "Invalid IP or Port (given as #{addr}) - use IP:Port format" exit 1 end pwd =nil if s.length==3 pwd = s.pop end port = s.pop # removes port from split array ip = s.join(":") # if s.length > 1 here, it's IPv6, so restore address @r = nil @info = {} @info[:host] = ip @info[:port] = port @info[:slots] = {} @info[:migrating] = {} @info[:importing] = {} @info[:replicate] = false @info[:password] = pwd @dirty = false # True if we need to flush slots info into node. @friends = [] end

def friends
    @friends
end

def slots
    @info[:slots]
end

def has_flag?(flag)
    @info[:flags].index(flag)
end

def to_s
    "#{@info[:host]}:#{@info[:port]}"
end

def connect(o={})
    return if @r
    print "Connecting to node #{self}: "
    STDOUT.flush
    begin
   if @info[:password] != nil
           @r = Redis.new(:host => @info[:host], :port => @info[:port], :timeout => 60,:password=>@info[:password])
           @r.ping
   else
         @r = Redis.new(:host => @info[:host], :port => @info[:port], :timeout => 60)
             @r.ping
   end
    rescue
        xputs "[ERR] Sorry, can't connect to node #{self}"
        exit 1 if o[:abort]
        @r = nil
    end
    xputs "OK"
end

....... ....... COMMANDS={ "create" => ["create_cluster_cmd", -2, "host1:port1:< password > ...... hostN:portN:< password >"], "check" => ["check_cluster_cmd", 2, "host:port"], "fix" => ["fix_cluster_cmd", 2, "host:port"], "reshard" => ["reshard_cluster_cmd", 2, "host:port"], "add-node" => ["addnode_cluster_cmd", 3, "new_host:new_port existing_host:existing_port"], "del-node" => ["delnode_cluster_cmd", 3, "host:port node_id"], "set-timeout" => ["set_timeout_cluster_cmd", 3, "host:port milliseconds"], "call" => ["call_cluster_cmd", -3, "host:port command arg arg .. arg"], "import" => ["import_cluster_cmd", 2, "host:port"], "help" => ["help_cluster_cmd", 1, "(show this help)"] }

Comment From: hayageek

@bayuemu

Did you try "reshard" or "fix" commands with redis-trib?. Not working :(

[ERR] Calling MIGRATE: ERR Target instance replied with error: NOAUTH Authentication required.

Comment From: badboy

The MIGRATE command in Redis currently does not handle authentication at all. Thus resharding an passwort-protected instance won't work at all.

Comment From: hayageek

Then in that case, How it can scale ? any ideas ?

Comment From: badboy

How can what scale?

Comment From: hayageek

I mean. How can I move some slots to different node using redis-trib.

Note: I have enabled auth in redis cluster, they are working fine.

On 9 December 2016 at 18:38, Jan-Erik Rediger notifications@github.com wrote:

How can what scale?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/antirez/redis/issues/2866#issuecomment-265983803, or mute the thread https://github.com/notifications/unsubscribe-auth/AChS7qEZV2tCDw_e8XkkcASRXtwD8hKEks5rGS-XgaJpZM4Ghke8 .

Comment From: badboy

You can't with authentication. Authenticated instances in a Redis Cluster are simply unsupported at this point.

(Technically you could implement it client side using DUMP and RESTORE, but that's not a really good option)

Comment From: hayageek

Without security how we can use Redis cluster in production. I thought of using RedisLab's , but is very costly.
Do you know any redis manager web based ?

Comment From: badboy

Don't expose instances to untrusted clients (this applies even in case of passwort-protected instances)

Comment From: hayageek

Redid labs supports TLS, can we have tls for open source redis cluster?

On Fri, 9 Dec 2016 at 19:36 Jan-Erik Rediger notifications@github.com wrote:

Don't expose instances to untrusted clients (this applies even in case of passwort-protected instances)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/antirez/redis/issues/2866#issuecomment-265994167, or mute the thread https://github.com/notifications/unsubscribe-auth/AChS7pZkHvps9DRvaO50_4WubK4Kecwqks5rGT1RgaJpZM4Ghke8 .

Comment From: badboy

Put a proxy in front. Upstream Redis has no TLS support (and whether it will get some at all is still unclear)

Comment From: hayageek

I tried with SSL proxy for each node. It did not work :(

On Fri, 9 Dec 2016 at 19:56 Jan-Erik Rediger notifications@github.com wrote:

Put a proxy in front. Upstream Redis has no TLS support (and whether it will get some at all is still unclear)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/antirez/redis/issues/2866#issuecomment-265997428, or mute the thread https://github.com/notifications/unsubscribe-auth/AChS7tv1BYvLU37R8HeevAfh-xDDNbZlks5rGUHngaJpZM4Ghke8 .

Comment From: badboy

Well, it's probably because of different ports and the actual announced ip/ports. :) Again: TLS (or any other proxying) is unsupported, so you won't get much help from upstream Redis with this use case.

Comment From: otherpirate

Hi all,

I created this #4288 to solve this problem

Comment From: kd-devops

Just wanted to cross check, weather authentication issue with Migrate has been fixed or its still have same issue.

I am using redis-4.0.6 with redis-trib-pass.rb and still facing issue while doing redis-trib-pass.rb reshard

[ERR] Calling MIGRATE: ERR Target instance replied with error: NOAUTH Authentication required.

I am passing password using auth flag:

Command Executed :

redis-trib-pass.rb reshard --auth host:ip

Weird this is , this error only comes when cluster nodes has keys ...for empty masters slots resharding works fine.

Any suggestion please ?

Comment From: oranagra

as noted in https://github.com/redis/redis/pull/4288, redis-trib is now replaced by redis-cli, which does solve this issues.