opengauss5.0:guc修改参数

编程入门 行业动态 更新时间:2024-10-20 08:54:18

opengauss5.0:guc修改<a href=https://www.elefans.com/category/jswz/34/1771441.html style=参数"/>

opengauss5.0:guc修改参数

ALTER SYSTEM SET命令用于设置POSTMASTER、SIGHUP、BACKEND级别的GUC参数。此命令会将参数写入配置文件,不同级别生效方式有所不同。

openGauss=# alter system set synchronous_commit=on;
ERROR:  unsupport parameter: synchronous_commit
ALTER SYSTEM SET only support POSTMASTER-level, SIGHUP-level and BACKEND-level guc variable,
and it must be allowed to set in postgresql.conf.
openGauss=# select name,context from pg_settings where name like 'synchronous_commit';
        name        | context
--------------------+---------
 synchronous_commit | user
(1 row)

  • 此命令仅限初始用户和拥有sysadmin权限的用户才可使用。

  • 不同级别GUC参数生效时间如下:

    • POSTMASTER级别的GUC参数需要重启后才生效。
    • BACKEND级别的GUC参数需要会话重新连接后才生效。
    • SIGHUP级别的GUC参数立即生效(需要等待线程重新加载参数,实际略微有延迟)。

[omm@node2 ~]$ gs_guc set -D /opt/openGauss/data/dn -c "synchronous_commit=on" -N all
The gs_guc run with the following arguments: [gs_guc -D /opt/openGauss/data/dn -c synchronous_commit=on -N all set ].
Begin to perform the total nodes: 3.
Popen count is 3, Popen success count is 3, Popen failure count is 0.
Begin to perform gs_guc for datanodes.
Command count is 3, Command success count is 3, Command failure count is 0.

Total instances: 3. Failed instances: 0.
ALL: Success to perform gs_guc!
 

重启数据库

[omm@node3 dn]$ gs_om -t restart
Stopping cluster.
=========================================
Successfully stopped cluster.
=========================================
End stop cluster.
Starting cluster.
======================================================================
Successfully started primary instance. Wait for standby instance.
======================================================================
.
Successfully started cluster.
======================================================================
cluster_state      : Normal
redistributing     : No
node_count         : 3
Datanode State
    primary           : 1
    standby           : 2
    secondary         : 0
    cascade_standby   : 0
    building          : 0
    abnormal          : 0
    down              : 0

Successfully started cluster.

 openGauss=# show synchronous_commit;
could not send data to server: 断开的管道
The connection to the server was lost. Attempting reset: Succeeded.
openGauss=# show synchronous_commit;
 synchronous_commit
--------------------
 on
(1 row)

更多推荐

opengauss5.0:guc修改参数

本文发布于:2024-02-17 03:24:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1692473.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数   guc

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!