昨天还有个后续步骤忘记写上, 注册节点:
$ psql -p 7004 postgres# create node coord2 with (type = 'coordinator', host = 'localhost', port = 7005);# create node datanode1 with (type = 'datanode', host = 'localhost', port = 7006);# create node datanode2 with (type = 'datanode', host = 'localhost', port = 7007);# \q$$ psql -p 7005 postgres# create node coord1 with (type = 'coordinator', host = 'localhost', port = 7004);# create node datanode1 with (type = 'datanode', host = 'localhost', port = 7006);# create node datanode2 with (type = 'datanode', host = 'localhost', port = 7007);# \q$
关机
首先关闭内部连接:
/usr/local/xc-pgsql/bin/psql -p 7004 -c 'CLEAN CONNECTION TO ALL FOR DATABASE postgres' postgres/usr/local/xc-pgsql/bin/psql -p 7005 -c 'CLEAN CONNECTION TO ALL FOR DATABASE postgres' postgres
然后按照协调器、数据节点、GTM的顺序依次关闭:
/usr/local/xc-pgsql/bin/pg_ctl stop -Z coordinator -D /home/quanzl/xc/coord1/usr/local/xc-pgsql/bin/pg_ctl stop -Z coordinator -D /home/quanzl/xc/coord2/usr/local/xc-pgsql/bin/pg_ctl stop -Z datanode -D /home/quanzl/xc/datanode1/usr/local/xc-pgsql/bin/pg_ctl stop -Z datanode -D /home/quanzl/xc/datanode2/usr/local/xc-pgsql/bin/gtm_ctl stop -Z gtm -D /home/quanzl/xc/gtm
然后连接测试,遇到了“ERROR: Failed to get pooled connections”,网上有人说是防火墙或者HBA的设置问题,我是在本地运行,并且都是以localhost连接,可以排除HBA。重新编译源代码,打开debug开关(--enable-debug),重新安装运行,查看详细的日志输出。
(欲知后事如何,请听下回分解。)
我还没折腾到底,一边尝试一边记录,解决不了的可能性也是很大的,请耐心等待。