Galera Cluster - Mysqld_multi
Hi, I need to configure Galera cluster on 3 nodes with multiple mariadb instances (Mysqld_multi) running on each nodes. Documentation i have found on the web only cover single instance of mariadb with Galera. Don't know what to put exactly in my server.cnf and how to start Galera on first node. I tried to launch 'galera_new_cluster' but i can't connect to any of the instances defined in server.cnf (mysqld1,mysqld2,....). It seems that only the default instance is started by 'Galera_New_Cluster' command. If i uncomment Galera section in server.cnf, it works fine and i can access all the instances of mariadb.
Kind Regards
vincent
Answer Answered by Geoff Montee in this comment.
Since you mentioned galera_new_cluster
, it sounds like you're using systemd. If you are using systemd, then you can use the relevant systemd method for interacting with multiple MariaDB instances instead of mysqld_multi
.
Regarding galera_new_cluster
, with the multi-instance method, you can pass the instance's suffix to the script:
$ galera_new_cluster mariadb@node1
If you can't get that to work, then it might be a bit easier to add --wsrep-new-cluster
to the configuration file whenever you want to bootstrap a node.
Other things to keep in mind:
You need to ensure that each instance is configured with a different datadir
.
You also need to ensure that each instance is configured with different network ports:
- Standard MariaDB Port (default: 3306) - For MySQL client connections and State Snapshot Transfers that use the
mysqldump
method. This can be changed by settingport
. - Galera Replication Port (default: 4567) - For Galera Cluster replication traffic, multicast replication uses both UDP transport and TCP on this port. Can be changed by setting
wsrep_node_address
. - IST Port (default: 4568) - For Incremental State Transfers. Can be changed by setting
ist.recv_addr
inwsrep_provider_options
. - SST Port (default: 4444) - For all State Snapshot Transfer methods other than
mysqldump
. Can be changed by settingwsrep_sst_receive_address
.