Redis configuration example

cat redis.conf 
port 6379
cluster-enabled yes
cluster-config-file /data/nodes.conf
cluster-node-timeout 5000
appendonly yes
appendfilename appendonly.aof
dbfilename dump.rdb
logfile /data/log.log

 

cluster-require-full-coverage

yes(default) : slave가 없는 master 노드가 다운되면 cluster 전체가 중지

no : slave가 없는 master 노드가 다운되더라도 cluster는 유지. 다만, 절반 이상의 노드가 다운되면 클러스터는 중지

데이터의 정합성이 중요하다면 yes, 일부 데이터가 유실되어도 괜찮으면 no

cluster-enabled

yes로 하면 cluster mode, no(default)로 하면 standalone mode

cluster-config-file 

클러스터의 상태가 변경될때 마다 상태를 기록

k exec -it redis-cluster-1 -- cat nodes.conf
d4c101ecd86542797df077d945f0329e55cfcd95 10.244.4.73:6379@16379 master - 0 1643072438406 3 connected 10923-16383
dc22da80db3ed3e4f956a53dbe3d527d72c56e87 10.244.4.71:6379@16379 master - 1643072438398 1643072438382 1 connected 0-5460
6a8fbdafa9f4fb0c5f3fa1c0bb943a2b2dc72f5d 10.244.4.77:6379@16379 master - 0 1643072438406 7 connected 5461-10922
c0ffb0eb52b8973a9f321cb6c5559a1b45ed304e 10.244.3.32:6379@16379 myself,slave 6a8fbdafa9f4fb0c5f3fa1c0bb943a2b2dc72f5d 0 1643072438381 7 connected
d197cc2d30c43780a8854bbd75c200c00ea5b417 10.244.4.74:6379@16379 slave d4c101ecd86542797df077d945f0329e55cfcd95 1643072438398 1643072438381 3 connected
85d745b2ff1f791fd5a81b1ba7710a1087ce844f 10.244.4.75:6379@16379 slave dc22da80db3ed3e4f956a53dbe3d527d72c56e87 1643072438398 1643072438382 1 connected
vars currentEpoch 7 lastVoteEpoch 0

cluster-node-timeout(millisecond)

레디스 노드가 다운되었는지 판단하는 시간(default: 15000)

cluster-slave-validity-factor

cluster 노드 다운시 해당 노드의 slave 노드를 마스터로 변경하는 장애 조치를 시작한다. 이때 마스터 노드와 slave 노드 간의 체크가 오랫동안 단절된 상태면 해당 slave는 승격 대상에서 제외된다. 이때 승격 대상에서 제외하는 파단 기준의 시간을 설정한다(default: 10)

계산식 : (cluster-node-timeout * cluster-slave-validity-factor) + repl-ping-slave-period

 

If set to zero, a replica will always consider itself valid, and will therefore always try to failover a master, regardless of the amount of time the link between the master and the replica remained disconnected.

port

방화벽을 사용하고 있다면 기본 포트에 10000을 더한 클러스터 버스 포트도 열려있어야 한다. 예를 들어 기본 포트로 6379를 사용한다면 16379번 포트도 같이 열어야 한다.

daemonize & logfile

no(default) : foreground

yes : background -> 리눅스 프롬프트가 바로 떨어짐(pidfile에 프로세스 id가 저장된다). log file을 지정해서 레디스 서버 로그를 기록하지 않으면 메시지가 날아간다.

 

백업 방식, AOF & RDB 

AOF는 명령이 실행될때 마다 기록되는 파일로서 데이터의 손실이 거의 없다.

RDB 파일은 특정한 간격마다 메모리에 있는 레디스 데이터 전체를 디스크에 쓴다.

  • RDB는 특정 시점의 메모리에 있는 데이터 전체를 바이너리 파일로 저장하는 것이다.
    AOF 파일보다 사이즈가 작다. 따라서 로딩 속도가 AOF 보다 빠르다.
    일반적으로 AOF 가 10초 걸린다면, RDB는 7초 정도로 생각하면 될 것이다.

*AOF를 기본으로 하고, RDB를 Option으로 하는 것을 권장.

*AOF와 RDB 파일 양쪽이 모두 존재할 경우 appendonly yes인 경우에는 레디스 서버 시작시 AOF 파일을 읽어 들이고, no인 경우 RDB 파일을 읽어들인다.

 

AOF configuration

appendonly(default: no)

장애 발생시 메모리에 기록된 데이터가 증발되는데 복구가 가능하도록 디스크에 쓰기 작업을 한다. 기본값으로 appendonly.aof 파일에 기록된다.

 

appendfsync

- always : 명령어 실행시마다 기록

- everysec(default) : 데이터를 모아 1초마다 디스크에 기록

- no : os에 쓰기 시점 처리를 위임

 

auto-aof-rewrite-percentage(0 - 100)

Default : 100

AOF 파일 사이즈가 숫자값 % 이상으로 커지면 rewrite 한다. %의 기준은 레디스 서버가 시작할 시점의 AOF 파일 사이즈를 기준으로 한다. Rewrite를 하면 rewirte 후 파일 사이즈를 기준으로 다시 계산한다.

 

auto-aof-rewrite-min-size

Default : 64mb

AOF 파일 사이즈가 64mb 이하면 rewrite를 하지 않는다. 파일 크기가 작은 경우 rewrite가 자주 발생하는 것을 방지

 

RDB configuration

dbfilename

RDB 파일명을 지정한다.

save

RDB 저장 시점을 지정할 수 있다. number of key modifications per second (Defaut : 900 1)


- http://redisgate.kr/redis/configuration/persistence.php

- https://programmer.help/blogs/redis-configuration-master-slave-cluster.html

- https://redis.io/topics/cluster-tutorial

'빅데이터 > Redis Cluster' 카테고리의 다른 글

Redis 주요 명령어  (0) 2022.02.08
Lettuce Configuration(RedisTemplate)  (0) 2022.02.08
Redis Cluster 장애 복구  (0) 2022.02.08
Redis Cluster Overview  (0) 2022.02.08

cluster nodes

 k exec -it redis-cluster-1 -- redis-cli cluster nodes
d4c101ecd86542797df077d945f0329e55cfcd95 10.244.4.73:6379@16379 master - 0 1643164181665 3 connected 10923-16383
dc22da80db3ed3e4f956a53dbe3d527d72c56e87 10.244.4.71:6379@16379 master - 0 1643164181000 1 connected 0-5460
6a8fbdafa9f4fb0c5f3fa1c0bb943a2b2dc72f5d 10.244.4.77:6379@16379 master - 0 1643164180000 7 connected 5461-10922
c0ffb0eb52b8973a9f321cb6c5559a1b45ed304e 10.244.3.32:6379@16379 myself,slave 6a8fbdafa9f4fb0c5f3fa1c0bb943a2b2dc72f5d 0 1643164181000 7 connected
d197cc2d30c43780a8854bbd75c200c00ea5b417 10.244.4.74:6379@16379 slave d4c101ecd86542797df077d945f0329e55cfcd95 0 1643164180000 3 connected
85d745b2ff1f791fd5a81b1ba7710a1087ce844f 10.244.4.75:6379@16379 slave dc22da80db3ed3e4f956a53dbe3d527d72c56e87 0 1643164180000 1 connected

항목 설명

  1. node-id : 노드를 유일하게 구분할 수 있는 ID이다. 40개 문자로 구성되면 변경되지 않는다.
  2. ip:port : 노드의 주소로 IP와 Port이다. 4.0 부터 @cluster_bus-port 가 추가되었다. 예) 127.0.0.1:7000@17000
  3. flags : master, slave, fail?, fail, handshake, noaddr, noflags가 있고, 명령을 실행한 노드에 myself 라고 표시된다.
  4. master : 슬레이브일 때 마스터 노드 ID가 표시된다.   마스터일 때는 "-"이 표시된다.
  5. ping-sent : myself가 다른 노드에 ping을 보낸 시각(Unix timestamp milliseconds)이다.   Ping-sent 시각은 Pong이 오면 지워진다.   그러므로 이 시각은 아직 Pong 오지 않았을 아주 짧은 시간만 볼 수 있다.   따라서 대부분의 경우 0으로 나온다.
  6. pong-recv : Pong을 받은 마지막 시각(Unix timestamp milliseconds)이다.
  7. config-epoch : The configuration epoch (or version) of the current node (or of the current master if the node is a slave).   Each time there is a failover, a new, unique, monotonically increasing configuration epoch is created.   If multiple nodes claim to serve the same hash slots, the one with higher configuration epoch wins.
  8. link-state : 클러스터 버스로 연결된 상태를 나타낸다.   connected 또는 disconnected 이다.
  9. slot : 마지막 항목은 할당된 슬롯 정보이다.   슬롯이 할당된 마스터 노드에 범위로 표시된다.   슬레이브나 슬롯이 할당되지 않은 마스터는 표시되지 않는다.

cluster info

 k exec -it redis-cluster-1 -- redis-cli cluster info
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:6
cluster_size:3
cluster_current_epoch:7
cluster_my_epoch:7
cluster_stats_messages_ping_sent:163087
cluster_stats_messages_pong_sent:164271
cluster_stats_messages_sent:327358
cluster_stats_messages_ping_received:164271
cluster_stats_messages_pong_received:163087
cluster_stats_messages_received:327358

항목 설명

  • cluster_state: 클러스터 상태를 나타낸다.   ok는 명령을 처리할 수 있는 상태이다.   fail은 명령을 처리할 수 없는 상태이다.   일반적으로 슬롯이 할당된 마스터 서버가 다운되었거나, 모든 슬롯이 할당되지 않으면 fail이다.   모든 슬롯이 할당되지 않아도 ok일 경우가 있는데, 이것은 cluster-require-full-coverage 파라미터에 영향을 받는다.
  • cluster_slots_assigned: 레디스 서버에 할당된 슬롯의 개수이다. 레디스 클러스터는 16384개의 슬롯이 있다.   assigned = ok + pfile + fail.
  • cluster_slots_ok: 할당된 슬롯의 개수이다. pfail이나 fail이 아닌 슬롯의 개수이다.
  • cluster_slots_pfail: 일시적으로 접속할 수 없는 노드에 할당된 슬롯 수이다.   Pfile은 Possible file의 줄임말이다.   회복되면 slots_ok가 되고, 다운되면 slots_fail이 된다.
  • cluster_slots_fail: 다운된 서버에 할당된 슬롯 수이다.
  • cluster_known_nodes: 슬레이브를 포함해서 클러스터에 연결된 모든 노드 수이다. 명령 관점에서 보면 Cluster meet 연결된 노드 수이다.
  • cluster_size: 슬롯이 할당된 마스터 서버 수이다. 마스터라도 슬롯이 할당되지 않았으면 여기에 포함되지 않는다.
  • cluster_current_epoch: The local Current Epoch variable.   This is used in order to create unique increasing version numbers during fail overs.
  • cluster_my_epoch: The Config Epoch of the node we are talking with.   This is the current configuration version assigned to this node.
  • cluster_stats_messages_sent: Number of messages sent via the cluster node-to-node binary bus.
  • cluster_stats_messages_received: Number of messages received via the cluster node-to-node binary bus.

info persistence

 k exec -it redis-cluster-1 -- redis-cli info persistence
# Persistence
loading:0
current_cow_size:0
current_cow_size_age:0
current_fork_perc:0.00
current_save_keys_processed:0
current_save_keys_total:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1643072438
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:0
aof_enabled:1
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:0
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
aof_last_cow_size:348160
module_fork_in_progress:0
module_fork_last_cow_size:0
aof_current_size:92
aof_base_size:92
aof_pending_rewrite:0
aof_buffer_length:0
aof_rewrite_buffer_length:0
aof_pending_bio_fsync:0
aof_delayed_fsync:0

항목 설명

  • aof_enabled : AOF 기능 활성화
  • aof_rewrite_in_progress : 현재 rewrite가 진행중임
  • aof_last_rewrite_time_sec : 지난 번 rewrite 하는데 걸린 시간
  • aof_current_rewrite_time_sec : 새 파일에 rewrite를 시작하고 현재까지 경과 시간
  • aof_last_bgrewrite_status : 지난 번 rewrite 상태
  • aof_current_size : 현재 AOF 파일 사이즈
  • aof_base_size : 베이스 AOF 파일 사이즈. base size와 current size를 비교해서 rewirte-percentage 값 이상이되면 자동으로 rewrite 한다.

 

 


 

Redis 저장 세션값과 의미

Key type Description
spring:session:sessions:(session id) hash 세션의 생성 시간, 마지막 세션 조회 시간, 최대 타임아웃 허용 시간과 해당 세션에 저장한 데이터를 저장
hgetall "spring:session:sessions:47caf040-8e4c-4b7e-b9c0-133a7e24c450"
 1) "lastAccessedTime"
 2) "\xac\xed\x00\x05sr\x00\x0ejava.lang.Long;\x8b\xe4\x90\xcc\x8f#\xdf\x02\x00\x01J\x00\x05valuexr\x00\x10java.lang.Number\x86\xac\x95\x1d\x0b\x94\xe0\x8b\x02\x00\x00xp\x00\x00\x01~\xbd\xf76\x0c"
 3) "creationTime"
 4) "\xac\xed\x00\x05sr\x00\x0ejava.lang.Long;\x8b\xe4\x90\xcc\x8f#\xdf\x02\x00\x01J\x00\x05valuexr\x00\x10java.lang.Number\x86\xac\x95\x1d\x0b\x94\xe0\x8b\x02\x00\x00xp\x00\x00\x01~\xbd\xf76\x0c"
 5) "sessionAttr:loginInfo"
 6) xxx
 7) "maxInactiveInterval"
 8) "\xac\xed\x00\x05sr\x00\x11java.lang.Integer\x12\xe2\xa0\xa4\xf7\x81\x878\x02\x00\x01I\x00\x05valuexr\x00\x10java.lang.Number\x86\xac\x95\x1d\x0b\x94\xe0\x8b\x02\x00\x00xp\x00\x00\xa8\xc0"

spring:session:sessions:expires:(session id) string identifies how long this group of keys can live and can be viewed with TTL
ttl "spring:session:sessions:expires:47caf040-8e4c-4b7e-b9c0-133a7e24c450"
(integer) 41864

spring:session:expirations:(expire time) set expire time에 삭제될 key 정보를 담고 있음.
smembers  "spring:session:expirations:1643907840000"
1) "\xac\xed\x00\x05t\x00,expires:47caf040-8e4c-4b7e-b9c0-133a7e24c450"


 


- http://redisgate.kr/redis/configuration/persistence.php

- http://redisgate.kr/redis/cluster/cluster_info.php

'빅데이터 > Redis Cluster' 카테고리의 다른 글

Redis Configuration  (0) 2022.02.08
Lettuce Configuration(RedisTemplate)  (0) 2022.02.08
Redis Cluster 장애 복구  (0) 2022.02.08
Redis Cluster Overview  (0) 2022.02.08

Lettuce Configuration

클러스터 내 노드의 IP, Port를 지정해서 접속한다. 어떤 노드를 지정해서 접속해도 접속에 성공하면 cluster nodes 명령을 실행해서 클러스터 내 모든 노드의 정보를 lettuce가 가지고 있다.  노드는 하나만 지정해도 되지만, 그 노드가 다운되었을 경우에 대비해서 여러 노드를 지정한다. 복제(replica) 노드를 지정해도 된다.

 

  • enablePeriodicRefresh(): 지정한 시간마다 클러스터 구성 정보를 가져와서 업데이트한다. 노드가 추가/삭제되었거나, 노드 다운으로 역할 변경(마스터 -> 복제(replica)), 슬롯이 이동했을 경우 등 클러스터 구성 정보가 변경되었을 경우 최신 정보로 업데이트해야 한다. 노드가 많을 경우 너무 짧은 시간을 지정하면 refresh 부하가 발생할 수 있다.
  • enableAllAdaptiveRefreshTriggers : 문제가 되는 Operation 발생시 커넥션을 갱신시켜주는 트리거 발생시킴
  • setReadFrom(ReadFrom.SLAVE): 이렇게 설정하면 get 같은 조회 명령은 복제(replica) 노드에서 실행된다.  마스터/복제(replica)간 부하 분산(Load-Balancing)을 할 수 있다.
MASTER - Default 값. master 에서 읽어 옴
MASTER_PREFERRED - master 에서 읽지만 사용 할 수 없는 경우에만 Slave 에서 읽음
SLAVE - Slave 에서만 읽음
SLAVE_PREFERRED - Slave 에서 읽고 불가능 할 때 master 에서 읽음
NEAREST - 가까운 노드에서 읽도록 설정
  • autoReconnect(): ConnectionWatchdog이 노드 다운을 감지하면 연결을 시도한다. Default는 true이다. enablePeriodicRefresh()와 중복되는 경향이 있다.
  • validateClusterNodeMembership : 클러스터 노드에 연결 전 유효한 노드인지 확인

참고) Spring boot에서 lettuce debug : logging.level.io.lettuce.core.protocol=DEBUG

 

관련 로그

로드밸런서 혹은 지정된 노드에 연결시 1분간격으로 노드에 연결을 시도하고 클러스터 정보를 가져옴

2022-01-27 03:45:42.986 DEBUG 1 --- [llEventLoop-4-1] i.l.core.protocol.RedisStateMachine      : Decoded LatencyMeteredCommand [type=CLUSTER, output=StatusOutput [output=f0464738f9fdff9a87258a6a533f8decab266edb 10.244.3.34:6379@16379 master - 0 1643255141000 1 connected 0-5460
1a5698df7f60fda63576fba615377db15ae86035 10.244.3.36:6379@16379 master - 0 1643255142520 3 connected 10923-16383
256b286b4b2574eddb8e232e053bebf828f1a881 10.244.3.39:6379@16379 slave 220a82de5edc5b2ded3da2c9b32ad7369d65d874 0 1643255142722 2 connected
220a82de5edc5b2ded3da2c9b32ad7369d65d874 10.244.3.35:6379@16379 myself,master - 0 1643255141000 2 connected 5461-10922
31e11fa54da223702d523636d223897072ffd064 10.244.3.38:6379@16379 slave f0464738f9fdff9a87258a6a533f8decab266edb 0 1643255142000 1 connected
b4a3eb4efffec439ba91003a10ffbdcd52742804 10.244.3.37:6379@16379 slave 1a5698df7f60fda63576fba615377db15ae86035 0 1643255142000 3 connected
, error='null'], commandType=io.lettuce.core.cluster.topology.TimedAsyncCommand], empty stack: true

- http://redisgate.kr/redis/clients/lettuce_cluster.php

'빅데이터 > Redis Cluster' 카테고리의 다른 글

Redis Configuration  (0) 2022.02.08
Redis 주요 명령어  (0) 2022.02.08
Redis Cluster 장애 복구  (0) 2022.02.08
Redis Cluster Overview  (0) 2022.02.08

Redis Cluster 구성

- Slave를 1개 가지고 있는 Master 노드 3개. 즉, Master 노드 3개, Slave 노드 3개

- redis.conf 정보

port 6379
cluster-require-full-coverage yes
cluster-enabled yes
cluster-config-file /data/nodes.conf
cluster-node-timeout 5000 # 약 5~6초 후에 failed 확인
appendonly yes
appendfilename appendonly.aof
dbfilename dump.rdb
logfile /data/log.log

 

Master 노드를 kill 했을 때

Slave 노드가 Master로 승격, 기존 Master가 재시작되면 Slave로 전환됨.

1:S 28 Jan 05:06:51.393 # Connection with master lost.
1:S 28 Jan 05:06:51.393 * Caching the disconnected master state.
1:S 28 Jan 05:06:51.672 * Connecting to MASTER 10.244.0.196:6379
1:S 28 Jan 05:06:51.673 * MASTER <-> SLAVE sync started
1:S 28 Jan 05:06:57.068 * FAIL message received from 1819c808fc29701676fde27691b5f57de297dfd8 about f1124d4c5e1bae7eae1107bc4fc2d9543132aeb3
1:S 28 Jan 05:06:57.069 # Cluster state changed: fail
1:S 28 Jan 05:06:57.092 # Start of election delayed for 916 milliseconds (rank #0, offset 720).
1:S 28 Jan 05:06:58.095 # Starting a failover election for epoch 7.
1:S 28 Jan 05:06:58.099 # Failover election won: I'm the new master.
1:S 28 Jan 05:06:58.099 # configEpoch set to 7 after successful failover
1:M 28 Jan 05:06:58.099 # Setting secondary replication ID to 951fb8aac85409a8fc5dad74b059262134613f5d, valid up to offset: 721. New replication ID is dc7af59ee82d9622a4097f458eab4df13a8e8b15
1:M 28 Jan 05:06:58.099 * Discarding previously cached master state.
1:M 28 Jan 05:06:58.100 # Cluster state changed: ok

 

다른 master 노드의 로그 확인

1:M 28 Jan 05:06:57.068 * Marking node f1124d4c5e1bae7eae1107bc4fc2d9543132aeb3 as failing (quorum reached).
1:M 28 Jan 05:06:57.068 # Cluster state changed: fail
1:M 28 Jan 05:06:58.097 # Failover auth granted to 8c67f0954711e074afd1fb34ebb7cc24c6cc73e0 for epoch 7
1:M 28 Jan 05:06:58.102 # Cluster state changed: ok

 

다른 slave 노드의 로그 확인

1:S 28 Jan 05:06:57.068 * FAIL message received from 1819c808fc29701676fde27691b5f57de297dfd8 about f1124d4c5e1bae7eae1107bc4fc2d9543132aeb3
1:S 28 Jan 05:06:57.068 # Cluster state changed: fail
1:S 28 Jan 05:06:58.102 # Cluster state changed: ok

 

마스터 노드가 kill 되었을 경우 (spring boot)lettuce client 로그

2022-01-27 05:01:02.909 DEBUG 1 --- [llEventLoop-4-1] i.l.core.protocol.ConnectionWatchdog     : Cannot reconnect to [10.244.3.34:6379]: finishConnect(..) failed: Host is unreachable: /10.244.3.34:6379

io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Host is unreachable: /10.244.3.34:6379
Caused by: java.net.ConnectException: finishConnect(..) failed: Host is unreachable
	at io.netty.channel.unix.Errors.throwConnectException(Errors.java:124) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at io.netty.channel.unix.Socket.finishConnect(Socket.java:251) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:672) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:649) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:529) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:465) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-all-4.1.52.Final.jar!/:4.1.52.Final]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_212]

 

토폴로지 구성이 업데이트 되지 않으면 레디스 클러스터가 복구 되었음에도 접속할 수 없다.

 

반드시 토폴로지 구성을 리프레시 하는 설정을 클라이언트(lettuce)에 작성해야한다.

 

 

참고로 Slave 노드를 kill 했을 경우 클라이언트 혹은 클러스터에 영향을 미치는 것이 없다.

 

이전 마스터였던 노드가 재시작한 경우

이전 슬레이드 노드가 마스터 노드로 승격되고, 승격된 마스터 노드의 슬레이브가 된다.

 

다른 master/slave 노드 로그

1:M 28 Jan 05:10:12.299 # Address updated for node f1124d4c5e1bae7eae1107bc4fc2d9543132aeb3, now 10.244.0.208:6379
1:M 28 Jan 05:10:12.370 * Clear FAIL state for node f1124d4c5e1bae7eae1107bc4fc2d9543132aeb3: master without slots is reachable again.

 


출처

- k8s configmap : https://stackoverflow.com/questions/58602949/redis-cluster-in-kubernetes-doesnt-write-nodes-conf-file

- https://blog.actorsfit.com/a?ID=01700-6f44e1d7-7ebc-4c13-bd14-d6a8cddd7e52 

- http://redisgate.kr/redis/cluster/cluster_failover.php

- http://redisgate.kr/redis/cluster/cluster-node-timeout.php

'빅데이터 > Redis Cluster' 카테고리의 다른 글

Redis Configuration  (0) 2022.02.08
Redis 주요 명령어  (0) 2022.02.08
Lettuce Configuration(RedisTemplate)  (0) 2022.02.08
Redis Cluster Overview  (0) 2022.02.08

+ Recent posts