3
votes

On my slave redis server, after executing 'slaveof master_hostname 7804', it keeps logging the following messages:

Connecting to MASTER master_hostname:7804
Unable to connect to MASTER: Invalid argument

On the Linux server that hosts my slave redis server, I can connect to my master redis server without any problem:

$ redis-cli -h master_hostname -p 7804

The output of 'info' on master:

# Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

The output of 'info' on slave:

# Replication
role:slave
master_host:master_hostname
master_port:7804
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
slave_repl_offset:1
master_link_down_since_seconds:1428997735
slave_priority:100
slave_read_only:1
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

Both redis servers are 3.0.0. If I use the IP of the master redis server instead of its hostname, I meet the same problem.

Any idea?

2

2 Answers

3
votes

I am having the exactly same issue here. I'm using Redis 3.0.0 in both machines (master and slave).

I've tried sysctl vm.overcommit_memory=1, but still not working.

In my case, I'm using CentOS 6.6.

EDIT: I've found the solution! In slave config, if you have configured bind 127.0.0.1, then you need to change to bind 192.168.1.54 (where 192.168.1.54 is the slave IP). Remember that master is in the same network 192.168.1.*.

3
votes

I had same issue with Redis 3 in MASTER-SLAVE setup.

I changed bind 127.0.0.1 10.234.1.10 to bind 10.234.1.10 127.0.0.1 and it works!

So, it looks, that "127.0.0.1" cannot be first in the list.