Master-slave Redis configuration in Linux
1. Download redis-2.8.24.tar.gz at http://redis.io/download.
2.decompress redis-2.8.24.tar.gz and install
Tar xvf redis-2.8.24.tar.gz
Mv redis-2.8.24/usr/local/cd/usr/local/redis-2.8.24make
Make install # copies redis commands to the/usr/local/bin directory.
3. Create a redis user and data storage directory
useradd -s /sbin/nologin -d /var/lib/redis redismkdir /data0/redischown redis.root /data0/redis
4. Copy the redis. conf file to the/etc directory and modify the file.
Modify the configuration file redis. conf on the master server
Daemonize yes # Start in the background
Port 6379 # port
Bind 127.0.0.1 # bind an IP address
Loglevel notice # The Log Level
Logfile/data0/redis. log # log File
Dir/data0/redis # data storage directory
Requirepass 123456 # Set the password
Modify the configuration file redis. conf from the server
Daemonize yesport 6380 slaveof 172.16.59.180 6379 bind 127.0.0.1
Loglevel notice
Logfile/data0/redis. log
Dir/data0/redis
Requrequirepass 123456
Masterauth 123456 # master server configuration Password
5. Start the redis service on the Master/Slave Server
redis-server /etc/redis.conf
You may also like the following articles about Redis. For details, refer:
Install and test Redis in Ubuntu 14.04
Basic configuration of Redis master-slave Replication
Redis cluster details
Install Redis in Ubuntu 12.10 (graphic explanation) + Jedis to connect to Redis
Redis series-installation, deployment, and maintenance
Install Redis in CentOS 6.3
Learning notes on Redis installation and deployment
Redis. conf
Redis details: click here
Redis: click here
This article permanently updates the link address: