redis configuration

yuanqc發表於2018-09-27

[root@abcdcache1 bin]# ./redis-server -v
Redis server v=3.2.10 sha=00000000:0 malloc=jemalloc-4.0.3 bits=64 build=66dc59d126b21981


[root@spmncache1 bin]# grep -v ^# redis.conf|more

bind 0.0.0.0

protected-mode yes

port 6379

tcp-backlog 511


timeout 0

tcp-keepalive 300


daemonize yes

supervised no

pidfile "/var/run/redis_6379.pid"

loglevel notice

logfile ""


databases 16


save 900 1
save 300 10
save 60 10000

stop-writes-on-bgsave-error yes

rdbcompression yes

rdbchecksum yes

dbfilename "dump.rdb"

dir "/redis3/redis1/bin"

masterauth "sinopass123"

slave-serve-stale-data yes

slave-read-only yes

repl-diskless-sync no

repl-diskless-sync-delay 5

repl-disable-tcp-nodelay no

slave-priority 100


requirepass "sinopass123"

appendonly yes

appendfilename "appendonly.aof"


appendfsync everysec


no-appendfsync-on-rewrite no


auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

aof-load-truncated yes


lua-time-limit 5000


slowlog-log-slower-than 10000

slowlog-max-len 128


latency-monitor-threshold 0


notify-keyspace-events ""


hash-max-ziplist-entries 512
hash-max-ziplist-value 64

list-max-ziplist-size -2


list-compress-depth 0

set-max-intset-entries 512

zset-max-ziplist-entries 128
zset-max-ziplist-value 64

hll-sparse-max-bytes 3000

activerehashing yes

client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60

hz 10

aof-rewrite-incremental-fsync yes



[root@abcdcache1 bin]# more sentinel.conf
port 26379
daemonize yes
logfile "sentinel.log"
sentinel myid 0e550299bade45e05d765e986044262b8d5604c4
protected-mode no
bind 0.0.0.0

# Generated by CONFIG REWRITE
dir "/redis3/redis1/bin"
sentinel monitor mymaster 172.30.201.214 6379 2
sentinel auth-pass mymaster abcdpass123
sentinel config-epoch mymaster 5
sentinel leader-epoch mymaster 5
sentinel known-slave mymaster 172.30.201.215 6380
sentinel known-sentinel mymaster 172.30.201.215 26380 97a7c07647c54bdffb15afcc584b7c0c157cb014
sentinel current-epoch 5


Some configurations:


manage redis node:
./redis-cli -h 172.30.201.214 -p 6379 -a abcdpass123

shutdown redis node:
./redis-cli -h 172.30.201.214 -p 6379 -a abcdpass123 shutdown


connect sentinel:
./redis-cli -h 172.30.201.214 -p 26379
./redis-cli -h 172.30.201.215 -p 26380


check configuration:
info sentinel


Reference:

https://www.cnblogs.com/kismetv/p/9609938.html



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10973950/viewspace-2215084/,如需轉載,請註明出處,否則將追究法律責任。

相關文章