Install Uncloud CLI locally firts: https://uncloud.run/docs/getting-started/install-cli
# Create a 3-machine Uncloud cluster
uc machine init -n machine1 root@server1
uc machine add -n machine2 root@server2
uc machine add -n machine3 root@server3
# Deploy the first bootstrap node
uc deploy --profile bootstrap galera1-bootstrap
# Deploy galera2 and galera3 services and wait for them to form the cluster
uc deploy galera2 galera3
# Remove the bootstrap node (using --wsrep-new-cluster) and replace it with a normal one
uc rm galera1-bootstrap
# Deploy all services, including the missing galera1
uc deploy
# Test on any node, e.g. galera1
uc exec galera1 mariadb -u root -psecret-password -e "
SELECT * FROM information_schema.GLOBAL_STATUS
WHERE VARIABLE_NAME IN ('wsrep_cluster_size', 'wsrep_cluster_status', 'wsrep_ready', 'wsrep_connected')
ORDER BY VARIABLE_NAME;"
+----------------------+----------------+
| VARIABLE_NAME | VARIABLE_VALUE |
+----------------------+----------------+
| WSREP_CLUSTER_SIZE | 3 |
| WSREP_CLUSTER_STATUS | Primary |
| WSREP_CONNECTED | ON |
| WSREP_READY | ON |
+----------------------+----------------+Now, your Uncloud services are able to communicate with the Galera Cluster via any of its nodes by using galera1:3306,
galera2:3306, or galera3:3306 addresses. You can also deploy a Galera Load Balancer or HAProxy in front of the nodes
to provide a single endpoint to the cluster.