1、停止gaussdb

$ gs_om -t stop

2、查看此时的服务状态

[omm@opengauss db1]$ gs_om -t status --detail
node         node_ip         instance                             state
--------------------------------------------------------------------------------------
1  opengauss 10.0.2.15       6001 /opt/huawei/install/data/db1 P Primary Normal

可见节点ip地址为10.0.2.15这个ip地址此时不是我们想要的了,我们来修改它

$ cd /opt/huawei/install/data/db1
$ vim postgresql.conf 
# 修改
# - Connection Settings -

listen_addresses = '10.60.67.87'                # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost'
                                        # (change requires restart)
local_bind_address = '10.60.67.87'
port = 26000                            # (change requires restart)


$ vim pg_hba.conf
# 修改
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
host    all    all    10.60.67.87/32    trust
# IPv6 local connections:
host    all             all             ::1/128                 trust

$gs_om -t start
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐