Kam*_*mil 3 linux mariadb galera
我正在尝试在debian 8 jessie下工作MariaDB Galera 10.1.
我已经安装了所有必要的组件并进行了配置但我无法正常工作.
节点构建为VPS.
节点1的配置:
[mysqld]
# Cluster node configurations
wsrep_cluster_address="gcomm://172.16.0.102,172.16.0.112"
wsrep_node_address="172.16.0.102"
wsrep_node_name='n1'
wsrep_cluster_name='cluster'
innodb_buffer_pool_size=400M
# Mandatory settings to enable Galera
wsrep_provider=/usr/lib/galera/libgalera_smm.so
binlog_format=ROW
default-storage-engine=InnoDB
innodb_autoinc_lock_mode=2
innodb_doublewrite=1
query_cache_size=0
bind-address=0.0.0.0
# Galera synchronisation configuration
wsrep_sst_method=rsync
Run Code Online (Sandbox Code Playgroud)
节点2的配置:
[mysqld]
# Cluster node configurations
wsrep_cluster_address="gcomm://172.16.0.102,172.16.0.112"
wsrep_node_address="172.16.0.112"
wsrep_node_name='n2'
wsrep_cluster_name='cluster'
innodb_buffer_pool_size=400M
# Mandatory settings to enable Galera
wsrep_provider=/usr/lib/galera/libgalera_smm.so
binlog_format=ROW
default-storage-engine=InnoDB
innodb_autoinc_lock_mode=2
innodb_doublewrite=1
query_cache_size=0
bind-address=0.0.0.0
# Galera synchronisation configuration
wsrep_sst_method=rsync
Run Code Online (Sandbox Code Playgroud)
当我试图在节点1 bootstrap命令上运行时
service mysql bootstrap
Run Code Online (Sandbox Code Playgroud)
它失败了,错误了
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 (Connection timed out)
May 13 15:59:28 test mysqld[2397]: at gcomm/src/pc.cpp:connect():162
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out)
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1379: Failed to open channel 'cluster' at 'gcomm://172.16.0.102,172.16.0.112': -110 (Connection timed out)
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: gcs connect failed: Connection timed out
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: wsrep::connect(gcomm://172.16.0.102,172.16.0.112) failed: 7
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] Aborting
Run Code Online (Sandbox Code Playgroud)
我正在使用的网络配置是私有的:
使用ProxmoxVE 4.0安装的2x DEDICATED服务器vRack网络中的服务器在VPS上配置为:
node1:172.16.0.102 //节点1在服务器1上
node2:172.16.0.112 //节点2在服务器2上
他们能够在专用网络上互相ping通.
Ari*_*sta 20
从MariaDB 10.1.8开始,systemd是新的init,它影响了Galera在RPM和基于Debian的Linux发行版上的引导方式(在我的例子中是Ubuntu 16.04).在以前的版本中,你会使用类似的东西service mysql start --wsrep-new-cluster,service mysqld bootstrap但由于失败而不能再使用:
[ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out)
Run Code Online (Sandbox Code Playgroud)
要解决此问题,请运行:
galera_new_cluster
Run Code Online (Sandbox Code Playgroud)
请注意,您只需要在"第一个"服务器上运行此脚本.
要测试它是否正在运行,请输入mysql,mysql -u [your mysql user] -p然后运行
SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
Run Code Online (Sandbox Code Playgroud)
你应该看到类似的东西:
+--------------+
| cluster size |
+--------------+
| 1 |
+--------------+
Run Code Online (Sandbox Code Playgroud)
以防它对任何人都有用,这是我的my.conf(MariaDB 10.1.16)
[galera]
# Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://[first ip],[second ip]"
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
Run Code Online (Sandbox Code Playgroud)
更多细节在这里:
MariaDB systemd和galera_new_cluster
Kam*_*mil 10
我找到了解决方案和确切问题.
问题在于启动集群节点.需要从与MariaDB安装中包含的脚本开始,galera_new_cluster这将引导新集群,之后一切正常.
希望这有助于其他人在debian下传递配置.
我有这个错误,但在我的情况下galera_new_cluster不起作用。
通过编辑/var/lib/mysql/grastate.dat文件并更改safe_to_bootstrap为1解决的问题。
完成后,galera_new_cluster工作。
| 归档时间: |
|
| 查看次数: |
31316 次 |
| 最近记录: |