OpenAtomFoundation / pikiwidb

a high-performance, large-capacity, multi-tenant, data-persistent, strong data consistency based on raft, Redis-compatible elastic KV data storage system based on RocksDB
BSD 3-Clause "New" or "Revised" License
201 stars 63 forks source link

主从与raft的切换 #211

Open panlei-coder opened 7 months ago

panlei-coder commented 7 months ago

1、命令: 主从 master:master init slave:slaveof ip port (learner) (如果检测到自己是followr,则先移除集群,再以learner的方式加入) slaveof no one 解除主从关系

braft leader:raft.cluster init follower:raft.cluster join ip:port (如果检测到自己是learner,则先解除主从关系,再重新加入集群) raft.cluster remove idx

Issues-translate-bot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: Master-slave and raft switching

Brokenice0415 commented 7 months ago

raft切主从的话需要先transfer leadership,保证切的主的数据是最新的。

Issues-translate-bot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically.


If raft switches from master to slave, leadership needs to be transferred first to ensure that the data of the master being switched is the latest.

Brokenice0415 commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically.

If raft switches from master to slave, leadership needs to be transferred first to ensure that the data of the master being switched is the latest.

switch from raft to master-slave

KKorpse commented 5 months ago

342 这个 pr 一定程度上解决了这个问题

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


342 This PR solves this problem to a certain extent