How to change wsrep_cluster_size in Percona XtraDB Cluste

perconaxtradb-cluster

I am trying to setup Percona XtraDB Cluster according to their doc
When I run show status like 'wsrep%'; it's show wsrep_cluster_size is 1 in every node(2 node for me). Actually it should be 1 for node1 and 2 for node2. How can change it to work?

Best Answer

You have a couple issues here, I believe it is a misunderstanding of how to deploy PXC. Firstly, wsrep_cluster_size is telling you how many nodes you have in your cluster. If both nodes are saying 1, you have 2 clusters of 1 node, not 1 with 2 nodes.

Secondly, follow the rule of 3's. You should always have an odd number to avoid split brain.

Recommended step here is to shut down node 2. Bootstrap node 1

http://severalnines.com/blog/how-bootstrap-mysqlmariadb-galera-cluster

https://www.percona.com/doc/percona-xtradb-cluster/5.6/manual/bootstrap.html

Then bring node 2 up with the correct cluster ips set in your my.cnf.

Follow configuration options here: https://www.percona.com/doc/percona-xtradb-cluster/5.6/installation.html