Greenplum5单机部署连接报错 System was started in master-only utility mode问题修复
psql連接單機(jī)部署的Greenplum5會(huì)報(bào)錯(cuò):
psql: FATAL: ?System was started in master-only utility mode - only utility mode connections are allowed
命令可以使用
PGOPTIONS='-c gp_session_role=utility' psql -d postgres
但是程序、客戶端都不行,
看看gpstart -help 那些啟動(dòng)參數(shù),也都無(wú)關(guān),
那就從源碼上下功夫吧
查找源碼(編譯教程詳見https://wanghq.blog.csdn.net/article/details/121094869)
./src/backend/utils/init/postinit.c
?? ?/*
?? ? * MPP: ?If we were started in utility mode then we only want to allow
?? ? * incoming sessions that specify gp_session_role=utility as well. ?This
?? ? * lets the bash scripts start the QD in utility mode and connect in but
?? ? * protect ourselves from normal clients who might be trying to connect to
?? ? * the system while we startup.
?? ? */
?? ?if ((Gp_role == GP_ROLE_UTILITY) && (Gp_session_role != GP_ROLE_UTILITY))
?? ?{
?? ??? ?ereport(FATAL,
?? ??? ??? ??? ?(errcode(ERRCODE_CANNOT_CONNECT_NOW),
?? ??? ??? ??? ? errmsg("System was started in master-only utility mode - only utility mode connections are allowed")));
?? ?}
注釋掉后
重新編譯
然后在編譯好后的目錄/usr/local/gpdb
中執(zhí)行
find . | xargs grep -ri 'postinit.c'
找到使用的程序
Binary file ./bin/postgres matches
Binary file ./bin/postmaster matches
運(yùn)行環(huán)境gpstop -a
對(duì)這兩個(gè)程序進(jìn)行替換
cd /usr/local/gpdb/bin
scp postgres root@10.0.197.198:/usr/local/gpdb/bin
scp postmaster root@10.0.197.198:/usr/local/gpdb/bin
運(yùn)行環(huán)境gpstart -a
再次使用客戶端連接即正常。
總結(jié)
以上是生活随笔為你收集整理的Greenplum5单机部署连接报错 System was started in master-only utility mode问题修复的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: qxdm 激活
- 下一篇: bzoj1190:[HNOI2007]梦