我按照指示在CentOS7.6上安装MariaDB Galera集群,但我只是无法启动集群。我可以在两个节点上启动MariaDB服务。这是我的server.cnf
[galera]
# Mandatory settings
wsrep_cluster_name="galera_cluster"
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://172.18.35.XXX,172.18.35.XXX
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2我很困惑,在Maria日志中什么都没有。我还应该看什么?
没关系,我已经通过了这一步,但是集群不会启动。我运行时没有任何错误。
root@db-mmr101:/var/lib/mysql$ /usr/bin/mysqld_safe --wsrep-new-cluster
190709 15:01:24 mysqld_safe Logging to '/var/lib/mysql/db-mmr101.err'.
190709 15:01:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql或者启动MariaDB服务。错误日志中也没有任何内容?
90709 15:01:30 mysqld_safe mysqld from pid file /var/lib/mysql/db-mmr101.pid ended
190709 15:01:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
190709 15:01:38 [Note] /usr/libexec/mysqld (mysqld 5.5.60-MariaDB) starting as process 19920 ...
190709 15:01:38 InnoDB: The InnoDB memory heap is disabled
190709 15:01:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins
190709 15:01:38 InnoDB: Compressed tables use zlib 1.2.7
190709 15:01:38 InnoDB: Using Linux native AIO
190709 15:01:38 InnoDB: Initializing buffer pool, size = 128.0M
190709 15:01:38 InnoDB: Completed initialization of buffer pool
190709 15:01:38 InnoDB: highest supported file format is Barracuda.
190709 15:01:38 InnoDB: Waiting for the background threads to start
190709 15:01:39 Percona XtraDB (http://www.percona.com) 5.5.59-MariaDB-38.11 started; log sequence number 1597945
190709 15:01:39 [Note] Plugin 'FEEDBACK' is disabled.
190709 15:01:39 [Note] Server socket created on IP: '0.0.0.0'.
190709 15:01:39 [Note] Event Scheduler: Loaded 0 events
190709 15:01:39 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.60-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server发布于 2019-07-11 17:59:48
我意识到yum安装并没有在Centos7.6上安装MariaDB 10+,因为在回购程序中没有构建。必须使用rpm下载/构建MariaDB 10.4。百胜将安装默认的MariaDB 5.5,这是随CentOS7.6而来的。5.5是一个非常旧的版本,它没有galera_new_cluster命令。这是一个很好的指南,让MariaDB安装在7+上使用rpm-qa https://medium.com/@thomashysselinckx/installing-mariadb-with-rpm-on-centos7-bce648cce758我花了很多时间,试图让它与yum一起工作,并最终放弃并走了rpm路线。
发布于 2020-08-14 03:58:00
在使用SystemD作为init系统的较新计算机上,可能需要执行其他步骤才能再次启动第一个群集节点。
首先,确保允许将成为新主节点的节点引导集群(此部分与SystemD无关):
# cat /var/lib/mysql/grastate.dat
# GALERA saved state
version: 2.1
uuid: 6a1f102a-13a3-11e7-b710-b2876418a643
seqno: -1
safe_to_bootstrap: 0将safe_to_bootstrap的值替换为1:
# sed -i "/safe_to_bootstrap/s/0/1/" /var/lib/mysql/grastate.dat然后运行命令
# galera_new_cluster发布于 2019-07-09 16:54:07
必须告诉第一个节点,它是集群中的第一个参与者,使用MariaDB,命令如下:
galera_new_cluster
https://galeracluster.com/library/training/tutorials/starting-cluster.html
您可能需要使用脚本的完整路径。
https://stackoverflow.com/questions/56941518
复制相似问题