dn02备管理

生成备节点

  1. [tbase@VM_0_29_centos ~]# pg_basebackup -p 23002 -h 172.16.0.47 -U tbase -D /data/tbase/data/pgxz/dn02 -X f -P -v

参数配置

  1. [tbase@VM_0_29_centos ~]# vim /data/tbase/data/pgxz/dn02/recovery.conf
  2. standby_mode = on
  3. primary_conninfo = 'host = 172.16.0.47 port = 23002 user = tbase application_name = s1'

服务管理

  • 启动服务
  1. [tbase@VM_0_29_centos ~]# pg_ctl -Z datanode -D /data/tbase/data/pgxz/dn02 start
  • 关闭服务
  1. [tbase@VM_0_29_centos ~]# pg_ctl -Z datanode -D /data/tbase/data/pgxz/dn02 stop
  2. [tbase@VM_0_29_centos ~]# pg_ctl -Z datanode -D /data/tbase/data/pgxz/dn02 stop -m f #快速关闭
  3. [tbase@VM_0_29_centos ~]# pg_ctl -Z datanode -D /data/tbase/data/pgxz/dn02 stop -m i #强制关闭
  • 重载参数
  1. [tbase@VM_0_29_centos ~]# pg_ctl -D /data/tbase/data/pgxz/dn02 reload
  • 查询状态
  1. [tbase@VM_0_29_centos ~]# pg_ctl -D /data/tbase/data/pgxz/dn02 status