Load BalancingMySQL/MariaDB

ERROR 1047: WSREP has not yet prepared node for application use

On replicated databases, you need to achieve quorum. That means you need to have an odd number of MariaDB/MySQL database hosts. If you have an even number, for example, 4 VPS Servers. It’s possible database hosts 1 & 2 could give one answer and database hosts 3 & 4 give another. There is no overriding vote to provide an answer to the cluster. This is known as split-brain. Similarly, if you have a three-node cluster and one goes down. This will also cause quorum to be lost. The end result in MariaDB Galera clusters and MySQL Replication clusters is the ERROR 1047 (08S01) at line 1: WSREP has not yet prepared node for application use error.


Fix ERROR 1047 (08S01) at line 1: WSREP has not yet prepared node for application use

Whilst this problem exists you will not be able to create new databases on the affected node. However, the fix for this is simple. On the node displaying this error login to MySQL.

mysql -u root -p

Inside the MySQL console issue the below command to automatically reset quorum on the cluster.

SET GLOBAL wsrep_provider_options='pc.bootstrap=YES';

Ensure you run this command with an odd number of hosts in the cluster or the ERROR 1047 (08S01) at line 1: WSREP has not yet prepared node for application use problem will return. If you currently have an even number of hosts in your cluster. See Add further MariaDB Galera Hosts’s To Cluster.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button