Environment rhel6.5 server1 server2
[[Email protected] ~] # Yum install gcc
[[Email protected] ~] # Tar zxf redis-4.0.8.tar.gz
[[Email protected] ~] # Cd redis-4.0.8
[[Email protected] redis-4.0.8] # Make & make install
[[Email protected] redis-4.0.8] # cd utils/
[[Email protected] utils] #./install_server.sh
[[Email protected] utils] # Vim/etc/redis/6379. conf
[[Email protected] utils] #/etc/init. d/redis_6379 restart
[[Email protected] utils] # netstat-antlp
Server2 is configured in the same way
[[Email protected] ~] # Vim/etc/redis/6379. conf
[[Email protected] ~] #/Etc/init. d/redis_6379 restart
[[Email protected] ~] # Netstat-antlp
[[Email protected] ~] # Redis-cli # server1 write as data
127.0.0.1: 6379> Set Name "Hello World"
OK
[[Email protected] ~] # Redis-cli # Server 2 query data
127.0.0.1: 6379> mget name
1) "Hello World"
Redis master-slave Replication