开发者社区> 问答> 正文

postgresql xl 无法添加slave节点

按官方文档配置了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都正常。

有了解的吗?求点拨。

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

展开
收起
djskl_pg 2016-02-29 16:03:58 8028 0
1 条回答
写回答
取消 提交回答
  • 公益是一辈子的事, I am digoal, just do it. 阿里云数据库团队, 擅长PolarDB, PostgreSQL, DuckDB, ADB等, 长期致力于推动开源数据库技术、生态在中国的发展与开源产业人才培养. 曾荣获阿里巴巴麒麟布道师称号、2018届OSCAR开源尖峰人物.

    第一次注册成功后,获得的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;
            }
    2019-07-17 18:31:36
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
云栖大会:开源 PolarDB 架构演进、关键技术与社区建设 立即下载
2023云栖大会:和客户一起玩转PolarDB新特性 立即下载
2023云栖大会:PolarDB for AI 立即下载