The previous article explained the Redis installation on CentOS.
Now let's take a look at the installation of Redis standalone Multi-instance
First turn off Redis
Based on the configuration file location of the previous Redis installation
First we copy the Redis configuration file
Cp/etc/redis/6379.conf/etc/redis/6380.conf
Then modify the information in the 6380.conf configuration file:
Port ports changed to 6380
Data storage directory dir change to/var/lib/redis/6380 and create the corresponding directory
Log storage location logfile change to/var/log/redis_6380.log
PID file name changed to/var/run/redis_6380.pid
Then we copy/etc/init.d/redis_6379, modify the redis_6380 script file, change the original 6379 to 6380
cp/etc/init.d/redis_6390/etc/init.d/redis_6380
At this point, single-machine multi-instance installation is complete
Next we can do the master-slave configuration
To modify the/etc/redis/6380.conf file:
Find slaveof, modify the configuration as follows, if it is configured on this machine, you can also write IP 127.0.0.1, when the primary server has a password do not forget to add a password in Masterauth
After the configuration is complete, restart from the database
Service redis_6380 Restart
Then view the master and slave configuration information
Primary server information:
From server information:
This is the master-slave configuration completed
Test it: