0

I can't figure out how to initialize a MariaDB Galera cluster on Ubuntu Zesty. I've followed the documentation, but something seems to be missing. I cannot get the first node to come up.

I installed using standard package:

apt install mariadb-server

I've configured the cluster in /etc/mysql/mariadb.conf.d/90-cluster.cnf

[mariadb]
bind-address = 0.0.0.0
binlog-format = ROW
innodb-autoinc-lock-mode = 2
innodb-flush-log-at-trx-commit = 0
wsrep-on = ON
wsrep-sst-method = rsync
wsrep-cluster-name = "example"
wsrep-cluster-address = "gcomm://maria01.example.com,maria02.example.com"
wsrep-node-address = "maria01"
wsrep-node-name = "maria01.example.com"

Note: I've also attempted setting the wsrep-cluster-address to "gcomm://"

I attempt to bootstrap by stopping the service and starting with the specialized script:

systemctl stop mariadb
galera_new_cluster

Then I connect to the instance and check the status:

show global variables like 'wsrep%';
+---------------------------------+-----------------------------------------+
| wsrep_osu_method                | TOI                                     |
| wsrep_auto_increment_control    | ON                                      |
| wsrep_causal_reads              | OFF                                     |
| wsrep_certify_nonpk             | ON                                      |
| wsrep_cluster_address           | gcomm://                                |
| wsrep_cluster_name              | example                                 |
| wsrep_convert_lock_to_trx       | OFF                                     |
| wsrep_data_home_dir             | /var/lib/mysql/                         |
| wsrep_dbug_option               |                                         |
| wsrep_debug                     | OFF                                     |
| wsrep_desync                    | OFF                                     |
| wsrep_dirty_reads               | OFF                                     |
| wsrep_drupal_282555_workaround  | OFF                                     |
| wsrep_forced_binlog_format      | NONE                                    |
| wsrep_gtid_domain_id            | 0                                       |
| wsrep_gtid_mode                 | OFF                                     |
| wsrep_load_data_splitting       | ON                                      |
| wsrep_log_conflicts             | OFF                                     |
| wsrep_max_ws_rows               | 0                                       |
| wsrep_max_ws_size               | 2147483647                              |
| wsrep_mysql_replication_bundle  | 0                                       |
| wsrep_node_address              | maria01                                 |
| wsrep_node_incoming_address     | AUTO                                    |
| wsrep_node_name                 | maria01.example.com                     |
| wsrep_notify_cmd                |                                         |
| wsrep_on                        | OFF                                     |
| wsrep_patch_version             | wsrep_25.16                             |
| wsrep_provider                  | none                                    |
| wsrep_provider_options          | pc.bootstrap=1                          |
| wsrep_recover                   | OFF                                     |
| wsrep_replicate_myisam          | OFF                                     |
| wsrep_restart_slave             | OFF                                     |
| wsrep_retry_autocommit          | 1                                       |
| wsrep_slave_fk_checks           | ON                                      |
| wsrep_slave_uk_checks           | OFF                                     |
| wsrep_slave_threads             | 1                                       |
| wsrep_sst_auth                  |                                         |
| wsrep_sst_donor                 |                                         |
| wsrep_sst_donor_rejects_queries | OFF                                     |
| wsrep_sst_method                | rsync                                   |
| wsrep_sst_receive_address       | AUTO                                    |
| wsrep_start_position            | 00000000-0000-0000-0000-000000000000:-1 |
| wsrep_sync_wait                 | 0                                       |
+---------------------------------+-----------------------------------------+

show status like 'wsrep%';
+--------------------------+----------------------+
| wsrep_cluster_conf_id    | 18446744073709551615 |
| wsrep_cluster_size       | 0                    |
| wsrep_cluster_state_uuid |                      |
| wsrep_cluster_status     | Disconnected         |
| wsrep_connected          | OFF                  |
| wsrep_local_bf_aborts    | 0                    |
| wsrep_local_index        | 18446744073709551615 |
| wsrep_provider_name      |                      |
| wsrep_provider_vendor    |                      |
| wsrep_provider_version   |                      |
| wsrep_ready              | ON                   |
| wsrep_thread_count       | 0                    |
+--------------------------+----------------------+

Note especially the wsrep_cluster_size, which is 0, but it should be 1 after running galera_new_cluster according to the documentation.

The Maria log doesn't have a whole lot, but it does seem like the cluster is initialized:

systemd[1]: Starting MariaDB database server...
sh[4083]: 2017-05-03 22:11:40 139734663651904 [Note] /usr/sbin/mysqld (mysqld 10.1.22-MariaDB-) starting as process 4203 ...
sh[4083]: WSREP: Recovered position 00000000-0000-0000-0000-000000000000:-1
mysqld[4238]: 2017-05-03 22:11:44 140634874606144 [Note] /usr/sbin/mysqld (mysqld 10.1.22-MariaDB-) starting as process 4238 ...
systemd[1]: Started MariaDB database server.
2
  • I'm assuming your node names are resolvable by the server, or else that may be the issue. MariaDB generally has good logging, are you getting any errors in the logs?
    – Jenos
    May 3, 2017 at 22:56
  • The node names are resolvable. I've added the log output to the question.
    – Rich Remer
    May 3, 2017 at 23:01

1 Answer 1

1

It looks like your cluster configuration is missing a few things:

  1. wsrep_provider should be set to the path to the Galera wsrep library
  2. wsrep_on should be set to "ON".

It looks like you actually need to modify most of the configuration to use underscores rather than dashes. The key issues in your status output is that there is no wsrep_provider and that wsrep_on is set to off. You can see the mandatory configuration settings on the MariaDB page.

1
  • After adding wsrep_provider, the wsrep_on setting took affect, and everything looks good. Thanks!
    – Rich Remer
    May 3, 2017 at 23:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .