Linux redis configuration tutorial, linuxredis
Redis-cli-h 127.0.0.1-p 6379? [-A passwprd] [-n database] set cli1 1? ? ---- Cli Command Execution
# RDB
Save 900 1 # When one Keys data is changed, refresh to Disk in 900 seconds. save 300 10 # When 10 Keys data is changed, refresh to Disk in 300 seconds save 60 10000 # When 10000 pieces of Keys data are changed, refresh to Disk in 60 seconds
# AOF
Appendonly yes ??????? # Enable AOF appendfilename ??????? # Saved file! There cannot be a path to appendfsync ?????????? # Always | everysec | no
No-appendfsync-on-rewrite yes ???????? # The auto-aof-rewrite-percentage 100 ?????? # When the size of the added file reaches 100% of the original AOF file, auto-aof-rewrite-min-size 64 mb ??????? # Minimum startup log rewriting Value
Redis-cli> info ????????????????
Find the last few lines:
Db0: the number of keys is: 11,
The memory usage is 891.52 kb.
# Master/Slave Configuration
MASTER: 6379, from 6380,6381
Cp/usr/local/redis cp/usr/local/redis_6380
Cp/usr/local/redis cp/usr/local/redis_6381
Modify redis. conf from 6380 and 6381: Configuration File
Vi? /Usr/local/redis_slave_6380/redis. conf
bind 127.0.0.1port 6380pidfile /var/run/redis_slave_6380.pidslave 127.0.0.7 63??? slave-read-only yesdir /usr/local/redis_slave_6380/data
Vi? /Usr/local/redis_slave_6381/redis. conf
bind 127.0.0.1port 6381pidfile /var/run/redis_salve_6381.pidslave 127.0.0.7 6379??? slave-read-only yesdir /usr/local/redis_slave_6381/data
Modify the sentinel. conf configuration from 6380 and 6381 :? (Ignore)
Vi? /Usr/local/redis_slave_6380/sentinal. con
port 26379????????????????????????????????????#The port that this sentinel instance will run osentinel monitor mymaster 127.0.0.1 6379 2????#
Info replication shows that 6380 is from
From server to master server:
Kill the server
Restart redis 66379