重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛

标题: 南大通用 gbase8c 允许客户端登陆 [打印本页]

作者: 郑全    时间: 2025-12-10 19:35
标题: 南大通用 gbase8c 允许客户端登陆
在 gha服务器上执行报错:

[gbase@node1 ~]$ gsql -d postgres -Ugbase -h 192.168.133.42  -p 5432 -Wgbase
gsql: FATAL:  Forbid remote connection with trust method!
FATAL:  Forbid remote connection with trust method!

在CN上执行以下语句:

[gbase@node2 cn1]$ gs_guc set -Z coordinator -N all -I all -h "host all all 0.0.0.0/0 sha256"
The gs_guc run with the following arguments: [gs_guc -Z coordinator -N all -I all -h host all all 0.0.0.0/0 sha256 set ].
Begin to perform the total nodes: 3.
Popen count is 2, Popen success count is 2, Popen failure count is 0.
Begin to perform gs_guc for coordinators.
Command count is 2, Command success count is 2, Command failure count is 0.

Total instances: 2.
ALL: Success to perform gs_guc!


[gbase@node2 cn1]$
[gbase@node2 cn1]$
[gbase@node2 cn1]$ gs_guc set -Z coordinator -N all -I all -c "password_encryption_type=1"
The gs_guc run with the following arguments: [gs_guc -Z coordinator -N all -I all -c password_encryption_type=1 set ].
Begin to perform the total nodes: 3.
Popen count is 2, Popen success count is 2, Popen failure count is 0.
Begin to perform gs_guc for coordinators.
Command count is 2, Command success count is 2, Command failure count is 0.

Total instances: 2.
ALL: Success to perform gs_guc!


[gbase@node2 cn1]$ gs_guc set -Z coordinator -N all -I all -c "listen_addresses='*'"
The gs_guc run with the following arguments: [gs_guc -Z coordinator -N all -I all -c listen_addresses='*' set ].
Begin to perform the total nodes: 3.
Popen count is 2, Popen success count is 2, Popen failure count is 0.
Begin to perform gs_guc for coordinators.
Command count is 2, Command success count is 2, Command failure count is 0.

Total instances: 2.
ALL: Success to perform gs_guc!


[gbase@node2 cn1]$

再使用这个用户登陆

[gbase@node1 ~]$ gsql -d postgres -Ugbase -h 192.168.133.42  -p 5432
gsql: FATAL:  Forbid remote connection with initial user.
FATAL:  Forbid remote connection with initial user.

这时,提示初始用户无法登陆,创建一个用户

postgres=# create user zq password 'gbase_4U';
CREATE ROLE
postgres=# alter user zq login;
ALTER ROLE

再以zq登陆

[gbase@node1 ~]$ gsql -d postgres -Uzq -h 192.168.133.42  -p 5432
Password for user zq:
gsql ((multiple_nodes GBase8cV5 3.0.0B114 build 9b50bc36) compiled at 2023-11-07 19:39:08 commit 0 last mr 1763 )
SSL connection (cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128)
Type "help" for help.

postgres=>

但初始用户还未能登陆,后面再看。



作者: 郑全    时间: 2025-12-10 19:52
正常还应该修改data store,gtm
gs_guc reload -Z datanode  -N all -I all -h "host all all 0.0.0.0/0 sha256"
gs_guc reload -Z datanode -N all -I all -c "password_encryption_type=1"
gs_guc reload -Z datanode -N all -I all -c "listen_addresses='*'"

gs_guc reload -Z gtm  -N all -I all -h "host all all 0.0.0.0/0 sha256"
gs_guc reload -Z gtm -N all -I all -c "password_encryption_type=1"
gs_guc reload -Z gtm -N all -I all -c "listen_addresses='*'"





欢迎光临 重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2