1. Start multiple Redis servers at the same time, consider starting two or three Redis servers on the same machine, listening to different ports separately
2. Create a Client connection
3, set the master-slave relationship
4. Testing
Specific procedures:
First, create a boot Redis server
./redis-server/etc/redis/redis.conf Default Port 6379
./redis-server/etc/redis/redis.conf--port 10000 Specify port 10000 (two horizontal lines-)
./redis-server/etc/redis/redis.conf--port 10001 Specify Port 10001
Second, establish client connection respectively
./redis-cli-p 6379 (one horizontal line)
./redis-cli-p 10000
./redis-cli-p 10001
Third, set up the master-slave relationship
The following commands are executed on the 10000 10001 client, respectively:
Slaveof 192.168.183.128 6379 (no colon required)
Here, the setup is complete and can be tested.
1, any one from the client, the Get test
Get Name
(nil)
Indicates that there is no key named name on the server
2, in the main client settings
Set name test
3. Testing again from the client
Get Name
"Test"
Congratulations, ok! Test Pass.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Redis master server configuration (Getting started)