0

I tried a lot of manuals for configuring MariaDB Galera and in all cases replication does not work. I struggled with version 10.5

Today I tried version 10.3 and the only thing that appeared was wsrep_ready | ON At 10.5, this was not the case either.

OS: CentOS 8 Stream

MariaDB:

# mysql -uroot -e 'SELECT version();'
+---------------------+
| version()           |
+---------------------+
| 10.3.36-MariaDB-log |
+---------------------+

Node configs

Node1:

[mysqld]
max_connections=350
log-bin=/var/log/mysql/mysql-bin
log-bin-index=/var/log/mysql/mysql-bin.index
binlog-format = 'ROW'
default-storage-engine=innodb
#
innodb_autoinc_lock_mode=2
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
innodb_doublewrite=1
#
innodb_flush_log_at_trx_commit=0
bind-address=0.0.0.0
# Galera Provider Configuration
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://10.10.84.200,10.10.84.201,10.10.84.202"
wsrep_on=ON
# Galera Cluster Configuration
wsrep_cluster_name="cluster"
# Galera Synchronization Configuration
wsrep_sst_method=rsync
# Galera Node Configuration
wsrep_node_address="10.10.84.200"
wsrep_node_name="os-controller-01"

Node2:

[mysqld]
max_connections=350
log-bin=/var/log/mysql/mysql-bin
log-bin-index=/var/log/mysql/mysql-bin.index
binlog-format = 'ROW'
default-storage-engine=innodb
#
innodb_autoinc_lock_mode=2
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
innodb_doublewrite=1
#
innodb_flush_log_at_trx_commit=0
bind-address=0.0.0.0
# Galera Provider Configuration
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://10.10.84.200,10.10.84.201,10.10.84.202"
wsrep_on=ON
# Galera Cluster Configuration
wsrep_cluster_name="cluster"
# Galera Synchronization Configuration
wsrep_sst_method=rsync
# Galera Node Configuration
wsrep_node_address="10.10.84.201"
wsrep_node_name="os-controller-02"

Node3:

[mysqld]
max_connections=350
log-bin=/var/log/mysql/mysql-bin
log-bin-index=/var/log/mysql/mysql-bin.index
binlog-format = 'ROW'
default-storage-engine=innodb
#
innodb_autoinc_lock_mode=2
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
innodb_doublewrite=1
#
innodb_flush_log_at_trx_commit=0
bind-address=0.0.0.0
# Galera Provider Configuration
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://10.10.84.200,10.10.84.201,10.10.84.202"
wsrep_on=ON
# Galera Cluster Configuration
wsrep_cluster_name="cluster"
# Galera Synchronization Configuration
wsrep_sst_method=rsync
# Galera Node Configuration
wsrep_node_address="10.10.84.202"
wsrep_node_name="os-controller-03"

Cluster state:

MariaDB [(none)]> show status like 'wsrep_%';
+-------------------------------+----------------------+
| Variable_name                 | Value                |
+-------------------------------+----------------------+
| wsrep_applier_thread_count    | 0                    |
| 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_rollbacker_thread_count | 0                    |
| wsrep_thread_count            | 0                    |
+-------------------------------+----------------------+
14 rows in set (0.001 sec)

Firewall is disabled.

Could you help set up replication?

Maksim
  • 11
  • 3
  • Is ping works between these hosts? Firewall disabled doesnt means networking between hosts works. Firewall is disabled an all hosts? There is some logs for galera and mariadb with some replication info – gapsf Sep 10 '22 at 11:15
  • Макисм, читал ли и проверял ли ты Enabling the Error Log & Special Logging https://galeracluster.com/library/training/tutorials/galera-monitoring.html – gapsf Sep 10 '22 at 11:28
  • Did you bootstrap one node first, _then_ bring the others online? – Rick James Sep 11 '22 at 17:44
  • All nodes ping each other. On the node1 I performed `sudo galera_new_cluster`, then on other nodes I performed `systemctl start mariadb`. Found out that there is no file on the path `/usr/lib/galera/libgalera_smm.so`, but there is a file on the path `/usr/lib64/galera/libgalera_smm.so`. In galera.cnf I changed the path from `/usr/lib/galera/libgalera_smm.so` to `/usr/lib64/galera/libgalera_smm.so` then restarted mariadb but the problem persisted. – Maksim Sep 12 '22 at 03:59
  • On version 10.4 is worked. – Maksim Sep 12 '22 at 06:08

1 Answers1

0

On version 10.4 is worked.

+----------------------------+--------------------------------------+
| Variable_name              | Value                                |
+----------------------------+--------------------------------------+
| wsrep_cluster_weight       | 3                                    |
| wsrep_cluster_capabilities |                                      |
| wsrep_cluster_conf_id      | 3                                    |
| wsrep_cluster_size         | 3                                    |
| wsrep_cluster_state_uuid   | 292d8c8e-3260-11ed-8a78-4f7603e75f47 |
| wsrep_cluster_status       | Primary                              |
+----------------------------+--------------------------------------+

My configs

Node1:

/etc/my.cnf

[mysqld]
port = 3306
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_connections = 10000
wait_timeout = 600
symbolic-links=0
key_buffer_size = 64M
max_heap_table_size = 64M
tmp_table_size = 64M
innodb_buffer_pool_size = 4096M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 16M
thread_concurrency = 8
max_allowed_packet = 64M
wait_timeout=2880000
interactive_timeout = 2880000
default-storage-engine = innodb
innodb_autoinc_lock_mode = 2
collation-server = utf8_general_ci
character_set_server=utf8
skip-name-resolve
!includedir /etc/my.cnf.d/
[mariadb]
log-error=/var/log/mariadb/mariadb.log

/etc/my.cnf.d/galera.cnf

[galera]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=10.10.84.200
wsrep_on=ON
wsrep_provider=/usr/lib64/galera-4/libgalera_smm.so
wsrep_cluster_name=openstack
wsrep_cluster_address="gcomm://10.10.84.200:4567,10.10.84.201:4567,10.10.84.202:4567"
wsrep_node_name=os-controller-01
wsrep_node_address=10.10.84.200
wsrep_sst_method=rsync
wsrep_causal_reads=ON
wsrep_slave_threads=4
wsrep_certify_nonPK=1
wsrep_max_ws_rows=131072
wsrep_max_ws_size=1073741824
wsrep_debug=0
wsrep_convert_LOCK_to_trx=0
wsrep_retry_autocommit=1
wsrep_auto_increment_control=1
wsrep_drupal_282555_workaround=0
wsrep_causal_reads=0
wsrep_notify_cmd=

Node2:

/etc/my.cnf

[mysqld]
port = 3306
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_connections = 10000
wait_timeout = 600
symbolic-links=0
key_buffer_size = 64M
max_heap_table_size = 64M
tmp_table_size = 64M
innodb_buffer_pool_size = 4096M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 16M
thread_concurrency = 8
max_allowed_packet = 64M
wait_timeout=2880000
interactive_timeout = 2880000
default-storage-engine = innodb
innodb_autoinc_lock_mode = 2
collation-server = utf8_general_ci
character_set_server=utf8
skip-name-resolve
!includedir /etc/my.cnf.d/
[mariadb]
log-error=/var/log/mariadb/mariadb.log

/etc/my.cnf.d/galera.cnf

[galera]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=10.10.84.201
wsrep_on=ON
wsrep_provider=/usr/lib64/galera-4/libgalera_smm.so
wsrep_cluster_name=openstack
wsrep_cluster_address="gcomm://10.10.84.200:4567,10.10.84.201:4567,10.10.84.202:4567"
wsrep_node_name=os-controller-02
wsrep_node_address=10.10.84.201
wsrep_sst_method=rsync
wsrep_causal_reads=ON
wsrep_slave_threads=4
wsrep_certify_nonPK=1
wsrep_max_ws_rows=131072
wsrep_max_ws_size=1073741824
wsrep_debug=0
wsrep_convert_LOCK_to_trx=0
wsrep_retry_autocommit=1
wsrep_auto_increment_control=1
wsrep_drupal_282555_workaround=0
wsrep_causal_reads=0
wsrep_notify_cmd=

Node3:

/etc/my.cnf

[mysqld]
port = 3306
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_connections = 10000
wait_timeout = 600
symbolic-links=0
key_buffer_size = 64M
max_heap_table_size = 64M
tmp_table_size = 64M
innodb_buffer_pool_size = 4096M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 16M
thread_concurrency = 8
max_allowed_packet = 64M
wait_timeout=2880000
interactive_timeout = 2880000
default-storage-engine = innodb
innodb_autoinc_lock_mode = 2
collation-server = utf8_general_ci
character_set_server=utf8
skip-name-resolve
!includedir /etc/my.cnf.d/
[mariadb]
log-error=/var/log/mariadb/mariadb.log

/etc/my.cnf.d/galera.cnf

[galera]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=10.10.84.202
wsrep_on=ON
wsrep_provider=/usr/lib64/galera-4/libgalera_smm.so
wsrep_cluster_name=openstack
wsrep_cluster_address="gcomm://10.10.84.200:4567,10.10.84.201:4567,10.10.84.202:4567"
wsrep_node_name=os-controller-03
wsrep_node_address=10.10.84.202
wsrep_sst_method=rsync
wsrep_causal_reads=ON
wsrep_slave_threads=4
wsrep_certify_nonPK=1
wsrep_max_ws_rows=131072
wsrep_max_ws_size=1073741824
wsrep_debug=0
wsrep_convert_LOCK_to_trx=0
wsrep_retry_autocommit=1
wsrep_auto_increment_control=1
wsrep_drupal_282555_workaround=0
wsrep_causal_reads=0
wsrep_notify_cmd=
Maksim
  • 11
  • 3
  • Is this supposed to be the solution? If yes, you should clarify which settings helped. If not, you should edit your question instead to add the new information. Answers are only for solutions. – Gerald Schneider Sep 12 '22 at 08:39