开发者社区> 问答> 正文

postgresql xl 无法添加slave节点

djskl_pg 2016-02-29 16:03:58 4649

按官方文档配置了1个gtm节点(机器1),2个coordinator&datanode节点(机器2,3),1个备份节点(机器4)

参考文章:Creating a Postgres-XL cluster

相关命令:

add coordinator master coord1 DB60 30001 30011 $dataDirRoot/coord_master.1 my_conf/coordExtraConfig my_conf/pgHbaConfig

add datanode master dn1 DB60 40001 40011 $dataDirRoot/dn_master.1 none my_conf/datanodeExtraConfig my_conf/pgHbaConfig

add coordinator master coord2 DB61 30001 30011 $dataDirRoot/coord_master.2 my_conf/coordExtraConfig my_conf/pgHbaConfig

add datanode master dn2 DB61 40001 40011 $dataDirRoot/dn_master.2 none my_conf/datanodeExtraConfig my_conf/pgHbaConfig

add datanode slave dn1 DB62 40101 40111 $dataDirRoot/dn_slave.1 none $dataDirRoot/datanode_archlog.1

添加slave节点后,slave节点的日志如下:

LOG: database system was interrupted; last known up at 2016-02-29 15:49:04 CST
FATAL: the database system is starting up

FATAL: the database system is starting up
LOG: entering standby mode
LOG: restored log file "000000010000000000000089" from archive
LOG: redo starts at 0/89000028
LOG: consistent recovery state reached at 0/890000F8
LOG: database system is ready to accept read only connections
cp: cannot stat ‘/home/postgres/DATA/pgxl/nodes/datanode_archlog.1/00000001000000000000008A’: No such file or directory
LOG: started streaming WAL from primary at 0/8A000000 on timeline 1
FATAL: Was unable to obtain a snapshot from GTM.
FATAL: Was unable to obtain a snapshot from GTM.
FATAL: Was unable to obtain a snapshot from GTM.

GTM节点报如下错误:

1:140050603951872:2016-02-29 15:49:02.107 CST -LOG: GTM_ERRCODE_TOO_OLD_XMIN - node_name dn1, reported_xmin 782028, previously reported_xmin 882982, GTM_GlobalXmin 882982

LOCATION: GTM_HandleGlobalXmin, register_common.c:1042

只是备份异常,其他DML都正常。

有了解的吗?求点拨。

另,以上配置是参考官方文档摸索着配的,不知道是不是有问题,希望配置成功的前辈,分享一下经验,谢谢了。

SQL 关系型数据库 Shell 流计算 PostgreSQL
分享到
取消 提交回答
全部回答(1)
  • 德哥
    2019-07-17 18:31:36

    第一次注册成功后,获得的Xmin是globalxmin,可能会有这个报错存在。你跑几个事务后再看看

            /*
             * The remote node must not report a xmin which precedes the GTM_GlobalXmin
             * we have already computed. If it ever happens, send an error back and let
             * the remote node handle it, possibly restarting itself
             */
            if (GlobalTransactionIdPrecedes(reported_xmin, GTM_GlobalXmin))
            {
                    *errcode = GTM_ERRCODE_TOO_OLD_XMIN;
    
                    mynodeinfo->joining = true;
    
                    /*
                     * When node registers from the first time, the reported_xmin is set
                     * to GTM_GlobalXmin and what we receive from the node would most
                     * likely precedes that, especially because nodes' latestCompletedXid
                     * could precede our GTM_GlobalXmin. The node is prepared to handle
                     * that case, but we should avoid logging an useless and often
                     * confusing log message.
                     */
                    if (mynodeinfo->reported_xmin_time)
                            elog(LOG, "GTM_ERRCODE_TOO_OLD_XMIN - node_name %s, reported_xmin %d, "
                                            "previously reported_xmin %d, GTM_GlobalXmin %d", node_name,
                                            reported_xmin, mynodeinfo->reported_xmin, GTM_GlobalXmin);
    
                    mynodeinfo->reported_xmin_time = GTM_TimestampGetCurrent();
                    mynodeinfo->reported_xmin = GTM_GlobalXmin;
    
                    GTM_RWLockRelease(&mynodeinfo->node_lock);
                    return InvalidGlobalTransactionId;
            }
    0 0
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

推荐文章
相似问题
推荐课程