# Set Up Bitalostored cluster
Set up Bitalostored cluster, including three types of nodes:
- Observer, has data and does not participate in the election
- Slave, has data and participates in the election
- Witness, has no data and participats in the election
The basic operation and maintenance operations of the cluster are as follows.
- Start/stop node
- Add and remove node to Management backend-Group
- Add and remove node within the shard
- Enable/disable node accessible
# Start/Stop Node
# Start Node
Node (observer or slave) deployment instruction: Bitalostored Service Deployment
The initial raft configuration is very important. If configuration has error, the node will fail to join the cluster.
- raft_cluster.cluster_id, consistent with the shard cluster_id
- raft_nodehost.node_id, different from the existing nodes in the shard(including removed nodes)
- raft_nodehost.init_raft_addrlist, consistent with the value of initial node (even if the initial node has been removed)
- raft_nodehost.init_raft_nodelist, consistent with the value of initial node
- raft_cluster.is_witness, value is true if the node is witness, otherwise false
- raft_cluster.is_observer, value is true if the node is observer, otherwise false
The slave is initially an observer nodeAfter full data synchronization is completed, it is promoted to a slave node. So configuration of the slave is same as observer(is_observer=true).
# Stop Node
Here is how to close node.
- execute shutdown command(redis command)
- kill {pid}
This operation shuts down the process gracefully. After the node is closed, Bitalosdashboard fails to detect it, background color of this node (Management backend-Group) will become red. And if the node is restarted, red background color will disappear.
# Add/Remove Node
# Add Node to Management backend-Group
Management backend-Group, click the "AddServer" button and fill in the parameters as follows.
- Node's cloud attribute (or data center attribute)
- Node type (observer/witness)
- Node address
- Shard id
If you add a new slave, select "observer" as the node type.
# Add Node within the Shard
- Observer, click "Mount observer" button to join the cluster (data replication will be performed at this time)
- Witness, click "Mount witness" to join the cluster
- Slave, after data replication of observer node is completed, click "MountNode" to promote observer to slave node
# Remove Node within the Shard
- Observer, click the "UnmountNode" button
- Witness, click the "UnmountNode" button
- Slave, click the "UnmountNode" button
After the node is removed, node status will become "false".
# Management backend-Group Remove node
If the node has been added to the shard, firstly the previous step of "remove the node within the shard" must be performed.
Remove node from Bitalosdashboard, operation is as follows.
- Close ndoe
- Click the "RemoveNode" button, refer to Management backend-Group
After the operation is completed, Management backend-Group will no longer display the node and delete management information of this node.
The above two steps are in no particular order. It is recommended to close the node first and then click "RemoveNode".
# Enable/Disable Node Accessible
New started node is not accessible for online requests. Refer to Management backend-Group.
# Enable Node Accessible
- Check the "Replica" checkbox
- After the text"("out of sync") appears, click "Sync" button
# Disable Node Accessible
- Uncheck the "Replica" checkbox
- After the text"("out of sync") appears, click "Sync" button
# Sync Function
- Click the "Sync" button to synchronize the latest routing information of shards to Bitalosproxy. After disabling node accessible, Bitalosproxy will no longer send requests to the node, and vice versa.
# Show Status
- Info command, show basic configuration and service status information, including resource usage and raft status, etc.
- Debuginfo command, show store structure information