MariaDB Galera 集群

MariaDB Galera 集群

我正在尝试在集群中设置 MariaDB,但似乎遇到了这个错误:

#mysqld -u mysql
130407 21:36:24 InnoDB: The InnoDB memory heap is disabled
130407 21:36:24 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130407 21:36:24 InnoDB: Compressed tables use zlib 1.2.7
130407 21:36:25 InnoDB: Initializing buffer pool, size = 2.0G
130407 21:36:26 InnoDB: Completed initialization of buffer pool
130407 21:36:27 InnoDB: highest supported file format is Barracuda.
130407 21:36:29  InnoDB: Waiting for the background threads to start
130407 21:36:30 Percona XtraDB (http://www.percona.com) 5.5.30-MariaDB-30.1 started; log      sequence number 757767234118
130407 21:36:30 [ERROR] mysqld: unknown variable 'wsrep_provider=/usr/lib/libgalera_smm.so'
130407 21:36:30 [ERROR] Aborting

130407 21:36:30  InnoDB: Starting shutdown...
130407 21:36:31  InnoDB: Shutdown completed; log sequence number 757767234118
130407 21:36:31 [Note] mysqld: Shutdown complete 

不管怎样,无论我首先使用 wsrep 在 my.cfg 中输入什么设置,我都会收到此错误,知道哪里出了问题吗?

这是我的配置:

[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
[mysqld]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
default_storage_engine  = InnoDB
log-bin=mysql-bin
binlog_format=ROW
server-id       = 510
sync_binlog=1
default-time-zone='US/Eastern'
log-slave-updates = 1
wsrep_provider = /usr/lib/libgalera_smm.so
wsrep_cluster_address = gcomm://
wsrep_retry_autocommit = 0
wsrep_sst_method = rsync
wsrep_sst_auth=sst:sstpasswd
innodb_file_per_table
innodb_open_files = 2048
innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:2000M;ibdata2:2000M;ibdata3:100M:autoextend
innodb_log_group_home_dir = /var/lib/mysql/mysql_logs/
innodb_buffer_pool_size = 2048M
innodb_additional_mem_pool_size = 512M
innodb_log_file_size = 1536M
innodb_log_buffer_size = 50M
innodb_flush_log_at_trx_commit = 0
innodb_lock_wait_timeout = 50
innodb_flush_method = O_DIRECT
innodb_write_io_threads = 32
innodb_read_io_threads = 32
innodb_thread_concurrency = 16
innodb_support_xa = false
innodb_autoinc_lock_mode=2
innodb_doublewrite=0

那么我错过了这个设置的哪个步骤。操作系统 Arch Linux

#pacman -Q | grep galera
galera 23.2.2-2
#whereis libgalera_smm.so
libgalera_smm: /lib/libgalera_smm.so /usr/lib/libgalera_smm.so /lib64/libgalera_smm.so /usr/lib64/libgalera_smm.so

#mysqld -u mysql
130407 22:12:20 InnoDB: The InnoDB memory heap is disabled
130407 22:12:20 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130407 22:12:20 InnoDB: Compressed tables use zlib 1.2.7
130407 22:12:20 InnoDB: Initializing buffer pool, size = 2.0G
130407 22:12:20 InnoDB: Completed initialization of buffer pool
130407 22:12:20 InnoDB: highest supported file format is Barracuda.
130407 22:12:20  InnoDB: Waiting for the background threads to start
130407 22:12:21 Percona XtraDB (http://www.percona.com) 5.5.30-MariaDB-30.1 started; log    sequence number 761369976882
130407 22:12:21 [ERROR] mysqld: unknown variable 'wsrep_provider=/usr/lib/libgalera_smm.so'
130407 22:12:21 [ERROR] Aborting

130407 22:12:21  InnoDB: Starting shutdown...
130407 22:12:22  InnoDB: Shutdown completed; log sequence number 761369976882
130407 22:12:22 [Note] mysqld: Shutdown complete

??? 谢谢你的帮助

答案1

我看到错误输出告诉了你这一行,但如果这是在 64 位系统上,你必须找到适合它的位置。如果你使用 find 命令:

find / -name '*galera*'

您应该会在某处看到类似于 libgalera_smm.so 的东西。我的是在 下/usr/lib64/libgalera_smm.so

答案2

我解决了这个问题,gcc 版本 4.7.2 (GCC) 有一些错误,当我降级到 4.2 时一切正常,而且如果我使用 galera 的通用包一切正常

答案3

您的配置中有一个错误,某些选项(例如 wsrep_* 选项)必须位于 [mysqld_safe] 部分,而不是 [mysqld] 部分。

这就是你的错误所在:

mysqld:未知变量“wsrep_provider=/usr/lib/libgalera_smm.so”

“mysqld”不知道变量“wsrep_provider”,但“mysqld_safe”知道它。

相关内容