[Redis] redis 이중화 테스트 관련 config 및 명령어

double-oh·2021년 8월 18일
0
post-custom-banner

7000.conf 파일

include /redis/redis-5.0.8/redis.conf

bind 0.0.0.0
daemonize yes
protected-mode no

port 7000
pidfile /var/run/redis_7000.pid
logfile /redis_log/redis-7000.log
dir /redis
dbfilename dump_7000.rdb

cluster-config-file node-7000.conf
cluster-enabled yes
cluster-node-timeout 5000

rename-command keys ""

appendonly no

7001.conf

include /redis/redis-5.0.8/redis.conf

bind 0.0.0.0
daemonize yes
protected-mode no

port 7001
pidfile /var/run/redis_7001.pid
logfile /redis_log/redis-7001.log
dir /redis
dbfilename dump_7001.rdb

cluster-config-file node-7001.conf
cluster-enabled yes
cluster-node-timeout 5000

rename-command keys ""

appendonly no
  • 데이터 전부 삭제
redis-cli --cluster call ${ip}:7000 flushall
redis-cli --cluster call ${ip}:7000  cluster reset
redis-cli --cluster call ${ip}:7001 flushall
redis-cli --cluster call ${ip}:7001  cluster reset
redis-cli --cluster call ${ip}:7000 flushall
redis-cli --cluster call ${ip}:7000  cluster reset
redis-cli --cluster call ${ip}:7001 flushall
redis-cli --cluster call ${ip}:7001  cluster reset
redis-cli --cluster call ${ip}:7000 flushall
redis-cli --cluster call ${ip}:7000  cluster reset
redis-cli --cluster call ${ip}:7001 flushall
redis-cli --cluster call ${ip}:7001  cluster reset
  • slave를 마스터 변경
redis-cli -p 7000 cluster failover
  • 상태 확인
redis-cli -p 7000 cluster nodes
profile
Yes, Code Wins Arguments!!
post-custom-banner

0개의 댓글