Ask Your Question
0

MariaDB-Galera cluster problem

asked 2016-02-16 04:03:53 -0500

Gourav Singla gravatar image

updated 2016-02-16 04:33:56 -0500

I have setup a HA Openstack with Kilo. I have deployed MariaDB-Galera cluster on 2 nodes with master-master setup using link: http://behindtheracks.com/2014/04/mysql-high-availability-with-galera-and-haproxy/ (http://behindtheracks.com/2014/04/mys...)

Everything works fine when both the nodes up, but when I switch off any of the cluster node then DB stops responding and I get the exception in logs: 'wsrep has may not yet prepared node'.

My cluster.cnf file: Node1:

[mysqld] query_cache_size=0 binlog_format=ROW default-storage-engine=innodb innodb_autoinc_lock_mode=2 query_cache_type=0 bind-address=0.0.0.0

Galera Provider Configuration

wsrep_provider=/usr/lib/galera/libgalera_smm.so

wsrep_provider_options="gcache.size=32G"

Galera Cluster Configuration

wsrep_cluster_name="test_cluster" wsrep_cluster_address="gcomm://192.168.10.53,192.168.10.54"

Galera Synchronization Congifuration

wsrep_sst_method=rsync

wsrep_sst_method=xtrabackup

wsrep_sst_auth=user:pass

Galera Node Configuration

wsrep_node_address="192.168.10.53" wsrep_node_name="hacontroller1" wsrep_debug=ON

And Node 2 [mysqld] query_cache_size=0 binlog_format=ROW default-storage-engine=innodb innodb_autoinc_lock_mode=2 query_cache_type=0 bind-address=0.0.0.0

Galera Provider Configuration

wsrep_provider=/usr/lib/galera/libgalera_smm.so

wsrep_provider_options="gcache.size=32G"

Galera Cluster Configuration

wsrep_cluster_name="test_cluster" wsrep_cluster_address="gcomm://192.168.10.53,192.168.10.54"

Galera Synchronization Congifuration

wsrep_sst_method=rsync

wsrep_sst_method=xtrabackup

wsrep_sst_auth=user:pass

Galera Node Configuration

wsrep_node_address="192.168.10.54" wsrep_node_name="hacontroller2" wsrep_debug=ON

Could anyone let me know what am I doing wrong here?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-02-27 23:31:27 -0500

Galera needs Quorum to operate properly.

That means you need a majority of nodes after a failure or the Galera cluster won't allow write operations.

To solve your issue lasting, you have 2 options:

Option 1 - add more nodes

Just add more MariaDB nodes to your cluster. In summary you should have an odd number of MariaDB nodes.

Option 2 - use garbd

If your aren't able to add new MariaDB nodes to your cluster, the best option here is to use the Galera Arbitrator daemon to form a quorum situation.

Just put garb on your HAProxy node (or as a clone resource in your pacemaker cluster if used) and you will be able to lose one MariaDB node.

Note that the number of all MariaDB nodes + garb nodes should also be odd.

See http://galeracluster.com/documentation-webpages/arbitrator.html (http://galeracluster.com/documentatio...) for more information about garb.

I personally suggest option 1.

cheers, hauke

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2016-02-16 04:03:53 -0500

Seen: 5,003 times

Last updated: Feb 16 '16