![如何通过 garbd 备份 galera 集群?SST 失败](https://linux22.com/image/665889/%E5%A6%82%E4%BD%95%E9%80%9A%E8%BF%87%20garbd%20%E5%A4%87%E4%BB%BD%20galera%20%E9%9B%86%E7%BE%A4%EF%BC%9FSST%20%E5%A4%B1%E8%B4%A5.png)
我们在 3 个节点上运行 MySQL Galera 集群 (5.6)。
为了备份集群我尝试遵循以下示例:http://galeracluster.com/documentation-webpages/backingupthecluster.html
我正在使用的命令:
node1:〜$ sudo /usr/bin/garbd --address gcomm://10.0.0.120:3307?gmcast.listen_addr=tcp://0.0.0.0:4444 --group example_cluster --donor MyNode1 --sst backup
10.0.0.120是node1的本地地址,我也通过HAProxy试过10.0.0.10?3306是集群的VIP。
两者都失败并出现错误:
严重:创建接收循环时发生异常:无法打开与组的连接:110(连接超时)在 garb/garb_gcs.cpp:Gcs():35
留给我以下问题:
如何指定我可以传输到 FTP 服务器的备份文件以便进行集群的潜在恢复。
为什么连接失败?我需要配置集群进行备份访问吗?
预先感谢您的任何帮助。
我附上了发出备份命令后的详细输出:
2015-09-01 12:29:56.240 INFO: CRC-32C: using hardware acceleration.
2015-09-01 12:29:56.241 INFO: Read config:
daemon: 0
name: garb
address: gcomm://10.0.0.120:3307?gmcast.listen_addr=tcp://0.0.0.0:4444
group: example_cluster
sst: backup
donor: MyNode1
options: gcs.fc_limit=9999999; gcs.fc_factor=1.0; gcs.fc_master_slave=yes
cfg:
log:
2015-09-01 12:29:56.245 INFO: protonet asio version 0
2015-09-01 12:29:56.245 INFO: Using CRC-32C for message checksums.
2015-09-01 12:29:56.246 INFO: backend: asio
2015-09-01 12:29:56.246 WARN: access file(./gvwstate.dat) failed(No such file or directory)
2015-09-01 12:29:56.247 INFO: restore pc from disk failed
2015-09-01 12:29:56.248 INFO: GMCast version 0
2015-09-01 12:29:56.249 INFO: (63af44e0, 'tcp://0.0.0.0:4444') listening at tcp://0.0.0.0:4444
2015-09-01 12:29:56.249 INFO: (63af44e0, 'tcp://0.0.0.0:4444') multicast: , ttl: 1
2015-09-01 12:29:56.250 INFO: EVS version 0
2015-09-01 12:29:56.250 INFO: gcomm: connecting to group 'example_cluster', peer '10.0.0.120:3307'
2015-09-01 12:29:59.255 WARN: no nodes coming from prim view, prim not possible
2015-09-01 12:29:59.256 INFO: view(view_id(NON_PRIM,63af44e0,1) memb {
63af44e0,0
} joined {
} left {
} partitioned {
})
2015-09-01 12:29:59.759 WARN: last inactive check more than PT1.5S ago (PT3.50916S), skipping check
2015-09-01 12:30:29.287 INFO: view((empty))
2015-09-01 12:30:29.288 ERROR: failed to open gcomm backend connection: 110: failed to reach primary view: 110 (Connection timed out)
at gcomm/src/pc.cpp:connect():162
2015-09-01 12:30:29.289 ERROR: gcs/src/gcs_core.cpp:gcs_core_open():206: Failed to open backend connection: -110 (Connection timed out)
2015-09-01 12:30:29.290 ERROR: gcs/src/gcs.cpp:gcs_open():1379: Failed to open channel 'example_cluster' at 'gcomm://10.0.0.120:3307?gmcast.listen_addr=tcp://0.0.0.0:4444': -110 (Connection timed out)
2015-09-01 12:30:29.290 FATAL: Exception in creating receive loop: Failed to open connection to group: 110 (Connection timed out)
at garb/garb_gcs.cpp:Gcs():35
答案1
首先,要解决您的问题,您应该连接到 Galera 端口,而不是 MySQL 端口,以便加入集群。默认 Galera 端口为 4567。
您有 3 个节点,因此您最多可以指定 3 个地址。
一旦连接到集群,您的 garbd 将请求节点“MyNode1”(假设有一个这样的节点)运行脚本 wsrep_sst_backup(因为您指定了“backup”——您真的创建了这个脚本吗?)。
node1:~$ sudo /usr/bin/garbd --address gcomm://10.0.0.120:4567,10.0.0.121:4567,10.0.0.121:4567?gmcast.listen_addr=tcp://0.0.0.0:4444 --group example_cluster --donor MyNode1 --sst backup
如果这仍然不起作用,请告诉我。