GBase 8a集群通过gc_sync_client手工同步分片数据

1、转到有故障的IP服务器上

故障,可以是真的有故障, 也可以是你人为判断的,比如意外原因出现主副本行数不一致,你选定一个为正确的,那么另外一个就是【有故障】的。

2、用gbase操作系统用户运行

/opt/gbase/gnode/server/bin/gc_sync_client 192.168.103.11 test stable1_n1 192.168.103.10 5258

路径是你的程序安装目录
参数1 正确的分片IP (这里是data节点)
参数2 库名
参数3 表分片名字
参数4 任意一个管理节点IP,注意这里是管理节点,也就是coornidator的
参数5 管理节点端口号

然后执行分片的刷新操作,注意是gncli

gncli
refresh table DbName.TableName_nX
select count(*) from DbName.TableName_nX

核对主备机器,相同分片的行数是否已经一致!

Usage:

gc_sync_client <IPADDR> <database name> <table name> <gcluster ip> <gcluster port> [check method] [gcluster lock] [display flag] [gnode lock] [double check] [taskid]

        This command must be used between gnode's table if you run it in gcluster

        <IPADDR>        point to the healthy node ipaddr

        <database name> must exist before run this command

        <table name>    this table is gnode's table

        <gcluster ip>   gcluster ip address

        <gcluster port> gcluster port

        [check method]  sync on check method: 2 detail, 3 whole. [default:2]

        [gcluster lock] 1 lock table, 0 don't lock table. [default:1]

        [display flag]  1 display, 0 don't display

        [gnode lock]    1 lock table, 0 don't lock table. [default:1]

        [double check]  1 double check, 0 no double check. [default:0]

        [taskid]        length less than 65  [default:get from gblogTaskIDGen()]。