postgresql xl 无法添加slave节点-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

postgresql xl 无法添加slave节点

2016-02-29 16:03:58 7298 1

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

有了解的吗?求点拨。

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

取消 提交回答
全部回答(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
相关问答

20

回答

【大咖问答】对话PostgreSQL 中国社区发起人之一,阿里云数据库高级专家 德哥

阿里ACE 彭飞 2019-07-10 09:36:10 1271831浏览量 回答数 20

145

回答

【新手入门】云服务器linux使用手册

fanyue88888 2012-11-26 17:14:18 159994浏览量 回答数 145

8

回答

OceanBase 使用动画(持续更新)

mq4096 2019-02-20 17:16:36 341335浏览量 回答数 8

38

回答

[@饭娱咖啡][¥20]对于慢sql有没有什么比较实用的诊断和处理方法?

江小白太白 2018-10-30 18:47:38 144389浏览量 回答数 38

3

回答

mySQL数据库报错You have an error in your SQL syntax

落地花开啦 2016-02-14 16:09:24 133553浏览量 回答数 3

39

回答

安全组详解,新手必看教程

我的中国 2017-11-30 15:23:46 263609浏览量 回答数 39

295

回答

Linux Bash严重漏洞修复紧急通知(已全部给出最终修复方案)

qilu 2014-09-25 13:26:50 438421浏览量 回答数 295

251

回答

阿里云LNAMP(Linux + Nginx + Apache + MySQL + PHP)环境一键安装脚本

云代维 2014-02-14 15:26:06 310272浏览量 回答数 251

56

回答

Flink Forward Asia 2021 有奖问答

阿里云实时计算Flink 2021-12-29 17:30:44 475672浏览量 回答数 56

2

回答

区域选择帮助

fanyue88888 2012-12-07 15:54:30 205742浏览量 回答数 2
+关注
0
文章
1
问答
问答排行榜
最热
最新
相关电子书
更多
JS零基础入门教程(上册)
立即下载
性能优化方法论
立即下载
手把手学习日志服务SLS,云启实验室实战指南
立即下载