unable to run a mariadb 10.1 galera cluster

5,918

I have solved the issue, I am using centos7 and i had to:

1.) add this in /etc/my.cnf.d/server.cnf

[mysqld]
bind-address=0.0.0.0

[galera]

wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
binlog_format=ROW
wsrep_cluster_address='gcomm://'
wsrep_cluster_name='galera_cluster'
wsrep_node_name='node1'

2.) I had to disable selinux and firewalld to let the other nodes to connect to the cluster. (I know for production uses you should handle the selinux and firewall rules but in my case it was a test on a local machine, so if you use it for prod handle this properly)

3.) in the connecting nodes specify the /etc/my.cnf.d/server.cnf with:

[mysqld]
bind-address=0.0.0.0

[galera]

wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
binlog_format=ROW
wsrep_cluster_address='gcomm://ip_of_the_master,ip_of_other_nodes'
wsrep_cluster_name='galera_cluster'
wsrep_node_name='nodeX'

Then start mysql service.

Now my cluster looks like this:

MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'wsrep_%';
+------------------------------+-------------------------------------------------------------+
| Variable_name                | Value                                                       |
+------------------------------+-------------------------------------------------------------+
| wsrep_apply_oooe             | 0.000000                                                    |
| wsrep_apply_oool             | 0.000000                                                    |
| wsrep_apply_window           | 1.000000                                                    |
| wsrep_causal_reads           | 0                                                           |
| wsrep_cert_deps_distance     | 60.887500                                                   |
| wsrep_cert_index_size        | 24                                                          |
| wsrep_cert_interval          | 0.000000                                                    |
| wsrep_cluster_conf_id        | 73                                                          |
| wsrep_cluster_size           | 3                                                           |
| wsrep_cluster_state_uuid     | c44d1346-a5c3-11e5-9a68-ca1db8f95be1                        |
| wsrep_cluster_status         | Primary                                                     |
| wsrep_commit_oooe            | 0.000000                                                    |
| wsrep_commit_oool            | 0.000000                                                    |
| wsrep_commit_window          | 1.000000                                                    |
| wsrep_connected              | ON                                                          |
| wsrep_evs_delayed            |                                                             |
| wsrep_evs_evict_list         |                                                             |
| wsrep_evs_repl_latency       | 0/0/0/0/0                                                   |
| wsrep_evs_state              | OPERATIONAL                                                 |
| wsrep_flow_control_paused    | 0.000000                                                    |
| wsrep_flow_control_paused_ns | 0                                                           |
| wsrep_flow_control_recv      | 0                                                           |
| wsrep_flow_control_sent      | 0                                                           |
| wsrep_gcomm_uuid             | 3c438933-a727-11e5-b2f2-f659b1338a74                        |
| wsrep_incoming_addresses     | 100.120.88.245:3306,100.120.88.244:3306,100.120.88.246:3306 |
| wsrep_last_committed         | 400                                                         |
| wsrep_local_bf_aborts        | 0                                                           |
| wsrep_local_cached_downto    | 1                                                           |
| wsrep_local_cert_failures    | 0                                                           |
| wsrep_local_commits          | 391                                                         |
| wsrep_local_index            | 0                                                           |
| wsrep_local_recv_queue       | 0                                                           |
| wsrep_local_recv_queue_avg   | 0.071429                                                    |
| wsrep_local_recv_queue_max   | 2                                                           |
| wsrep_local_recv_queue_min   | 0                                                           |
| wsrep_local_replays          | 0                                                           |
| wsrep_local_send_queue       | 0                                                           |
| wsrep_local_send_queue_avg   | 0.000000                                                    |
| wsrep_local_send_queue_max   | 1                                                           |
| wsrep_local_send_queue_min   | 0                                                           |
| wsrep_local_state            | 4                                                           |
| wsrep_local_state_comment    | Synced                                                      |
| wsrep_local_state_uuid       | c44d1346-a5c3-11e5-9a68-ca1db8f95be1                        |
| wsrep_protocol_version       | 7                                                           |
| wsrep_provider_name          | Galera                                                      |
| wsrep_provider_vendor        | Codership Oy <[email protected]>                           |
| wsrep_provider_version       | 25.3.9(r3387)                                               |
| wsrep_ready                  | ON                                                          |
| wsrep_received               | 182                                                         |
| wsrep_received_bytes         | 17414                                                       |
| wsrep_repl_data_bytes        | 52304                                                       |
| wsrep_repl_keys              | 1183                                                        |
| wsrep_repl_keys_bytes        | 18664                                                       |
| wsrep_repl_other_bytes       | 0                                                           |
| wsrep_replicated             | 400                                                         |
| wsrep_replicated_bytes       | 96568                                                       |
| wsrep_thread_count           | 2                                                           |
+------------------------------+-------------------------------------------------------------+
Share:
5,918

Related videos on Youtube

simonC
Author by

simonC

Updated on September 18, 2022

Comments

  • simonC
    simonC over 1 year

    I have installed mariadb 10.1 via the instructions here:

    https://mariadb.com/kb/en/mariadb/yum/#installing-mariadb-galera-cluster-with-yum

    but when I run the server with :

    sudo service mysql start --wsrep-new-cluster
    

    the server is not run as a cluser:

     MariaDB [(none)]> show status like 'wsrep%';
    +--------------------------+----------------------+
    | Variable_name            | Value                |
    +--------------------------+----------------------+
    | wsrep_cluster_conf_id    | 18446744073709551615 |
    | wsrep_cluster_size       | 0                    |
    | wsrep_cluster_state_uuid |                      |
    | wsrep_cluster_status     | Disconnected         |
    | wsrep_connected          | OFF                  |
    | wsrep_local_index        | 18446744073709551615 |
    | wsrep_provider_name      |                      |
    | wsrep_provider_vendor    |                      |
    | wsrep_provider_version   |                      |
    | wsrep_ready              | ON                   |
    +--------------------------+----------------------+
    

    However I have not touched the my.cnf as in the instructions it is not mentioned. Do I have to do something additional?

    My MariaDB version is

    mysql  Ver 15.1 Distrib 10.1.9-MariaDB, for Linux (x86_64) using readline 5.1
    

    On centos7

  • Dylan B
    Dylan B about 5 years
    Fantastic! Thank you. I had same issue it took me half day.