cluster_set-config-epoch
Redis CLUSTER SET-CONFIG-EPOCH
레디스 클러스터 교육 |
레디스 정기점검/기술지원 Redis Technical Support |
레디스 엔터프라이즈 서버 Redis Enterprise Server |
---|
Redis CLUSTER SET-CONFIG-EPOCH
CLUSTER SET-CONFIG-EPOCH은 current epoch을 지정한 값으로 setting하는 명령이다.
이 문서는 버전 3.2.0을 기준으로 만들었습니다.
설명
This command sets a specific config epoch in a fresh node. It only works when:
수행 조건
- The nodes table of the node is empty.
cluster nodes 명령으로 조회했을때 myself만 나와야 한다. - The node current config epoch is zero.
cluster info 명령으로 조회했을때 cluster_current_epcoh이 0 이어야 한다.
These prerequisites are needed since usually,
manually altering the configuration epoch of a node is unsafe,
we want to be sure that the node with the higher configuration epoch value
(that is the last that failed over) wins over other nodes in claiming the hash slots ownership.
However there is an exception to this rule,
and it is when a new cluster is created from scratch.
Redis Cluster config epoch collision resolution algorithm can deal with
new nodes all configured with the same configuration at startup,
but this process is slow and should be the exception,
only to make sure that whatever happens,
two more nodes eventually always move away from the state of having the same configuration epoch.
So, using CONFIG SET-CONFIG-EPOCH, when a new cluster is created,
we can assign a different progressive configuration epoch
to each node before joining the cluster together.
소스 코드
cluster.c
명령문
CLUSTER SET-CONFIG-EPOCH integer
- 이 명령은 version 3.0.0 부터 사용할 수 있다.
- 논리적 처리 소요시간은 O(1)이다.
Clients for Java | Jedis, Lettuce | Clients for C | Hiredis |
<< CLUSTER SAVECONFIG | CLUSTER SET-CONFIG-EPOCH | CLUSTER READONLY >> |
---|