人大金仓日常命令记录

查看集群运行信息./repmgr service  status

[kingbase@kingbase01 bin]$ ./repmgr service  status
 ID | Name  | Role    | Status    | Upstream | repmgrd | PID     | Paused? | Upstream last seen
----+-------+---------+-----------+----------+---------+---------+---------+--------------------
 1  | node1 | primary | * running |          | running | 2274638 | no      | n/a                
 2  | node2 | standby |   running | node1    | running | 1559834 | no      | 1 second(s) ago    
 3  | node3 | witness | * running | node1    | running | 2214783 | no      | 0 second(s) ago    

集群配置文件路径,要求主备配置文件一致,不一致将启动失败。

kingbase/data/es_rep.conf

 命令行停止与启动集群

停止:./sys_monitor.sh  stop

[kingbase@kingbase01 bin]$ ./sys_monitor.sh  stop
2023-06-13 14:30:18 Ready to stop all DB ...
Service process "node_export" was killed at process 116837
Service process "postgres_ex" was killed at process 116838
.......

启动:./sys_monitor.sh  start

[kingbase@kingbase01 bin]$ ./sys_monitor.sh  start
2023-06-13 14:30:36 Ready to start all DB ...
2023-06-13 14:30:36 begin to start DB on "[172.16.1.1]".
waiting for server to start.... done

.......

备份模式,还原到新模式

#备份模式demo

./sys_dump -Uusername -h 192.168.1.1 -d DBname -f /opt/demo.dmp -Fc -n demo

#将demo模式还原到public模式

./sys_restore -Uusername -h 192.168.1.1 -d DBname /opt/demo.dmp -Fc -g demo -G public

查询数据库集簇系统参数

SELECT  name,setting from sys_settings; 

查询当前最大连接数

SELECT setting AS "最大连接数" FROM pg_settings WHERE name = 'max_connections';  

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值