日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Greenplum5单机部署连接报错 System was started in master-only utility mode问题修复

發(fā)布時(shí)間:2023/12/10 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Greenplum5单机部署连接报错 System was started in master-only utility mode问题修复 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

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ù),也都無關(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问题修复的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。