@giovanny.lueilwitz
To connect to the master in Redis from a slave, you will need to follow these steps:
- Open the Redis configuration file of the slave server. The default location of the configuration file is /etc/redis/redis.conf, but it may be different depending on your installation.
- Look for the replicaof or slaveof directive in the configuration file. This directive specifies the IP address and port of the master Redis server. If the directive is not already present, add it to the configuration file and set it to the IP address and port of the master server. For example:
1
|
replicaof 192.168.1.100 6379
|
Replace 192.168.1.100
with the IP address of the master server and 6379
with the port that the master server is running on.
- Save the configuration file and restart the Redis service on the slave server to apply the changes.
- Once the Redis service has been restarted, the slave server should now be connected to the master server. You can check the status of the replication by running the INFO replication command in the Redis CLI on the slave server.
By following these steps, you should be able to connect to the master server in Redis from a slave server.