Report this

What is the reason for this report?

new to redis. But am attempting to configure redis4 on 3 machines, 2 slaves, 1 master and 3 sentinels. Follow directions carefully. NOT WORK

Posted on August 12, 2017

I bring up a master. I then bring up a sentinel. All is fine. The sentinel is aware of the master. I then bring up a slave. The slave gets a connection refused error when trying to connect to the master. Master <-> sync started message being repeated over and over in the log files. NO authentication is being used in this example. Config files are extremely simple , bare minimun. I follow the example in this link to the TEE:

https://seanmcgary.com/posts/how-to-build-a-fault-tolerant-redis-cluster-with-sentinel



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

In case anyone stumbles upon this question

To configure Redis4 on 3 machines with 2 slaves, 1 master, and 3 sentinels, you can follow the steps below:

  1. Install Redis4 on all 3 machines. You can do this by following the installation instructions for your specific operating system.

  2. Choose one of the machines to be the master node. To do this, edit the redis.conf file on the master machine and uncomment the following lines:

bind 0.0.0.0
port 6379
daemonize yes

You can also set a password for your Redis instance by uncommenting the following line and setting a password:
requirepass yourpassword

Save the changes and restart Redis on the master machine.

  1. Choose two of the remaining machines to be the slave nodes. To do this, edit the redis.conf file on each slave machine and uncomment the following lines:
bind 0.0.0.0
port 6379
daemonize yes
slaveof master_ip_address 6379

Replace master_ip_address with the IP address of the master machine. Save the changes and restart Redis on each slave machine.

  1. Choose one of the machines to be the sentinel node. To do this, edit the sentinel.conf file on the sentinel machine and add the following lines:
bind 0.0.0.0
port 26379
daemonize yes
sentinel monitor mymaster master_ip_address 6379 2
sentinel auth-pass mymaster yourpassword

Replace `master_ip_address` with the IP address of the master machine. If you set a password for your Redis instance, uncomment the second line and replace `yourpassword` with your password. Save the changes and restart Redis on the sentinel machine.
  1. Copy the sentinel.conf file to the other two machines and edit it to change the bind and port values to different values. For example, you could set port to 26380 on the second sentinel machine and 26381 on the third sentinel machine.

  2. Start the sentinels on all three machines by running the following command on each machine:

redis-server /path/to/sentinel.conf --sentinel

This will start the Redis server in sentinel mode and load the sentinel configuration file.

  1. Verify that the Redis master and slave nodes are working correctly by connecting to them with the Redis CLI and running commands such as INFO, SET, and GET. You can also use the INFO replication command to check the replication status of the slave nodes.

  2. Verify that the Redis sentinels are working correctly by connecting to them with the Redis CLI and running commands such as SENTINEL masters and SENTINEL slaves mymaster. These commands will show you information about the master and slave nodes monitored by the sentinels.

By following these steps, you should have a working Redis4 setup with 2 slave nodes, 1 master node, and 3 sentinel nodes.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.