cn02管理

初始化

  1. [tbase@VM_0_47_centos ~]# initdb --locale=zh_CN.UTF-8 -U tbase -E utf8 -D /data/tbase/data/pgxz/cn02 --nodename=cn02 --nodetype=coordinator --master_gtm_nodename gtm_1 --master_gtm_ip 172.16.0.29 --master_gtm_port 21000

参数配置

  1. [tbase@VM_0_47_centos ~]# vim /data/tbase/data/pgxz/cn02/postgresql.conf
  2. port = 15432
  3. pooler_port=15433
  4. include_if_exists ='/data/tbase/global/postgresql.conf.user'
  5. [tbase@VM_0_47_centos ~]# vim /data/tbase/data/pgxz/cn02/pg_hba.conf
  6. local all all trust
  7. host all all 127.0.0.1/32 trust
  8. host replication all 172.16.0.29/32 trust
  9. host all all 172.16.0.29/32 trust
  10. host replication all 172.16.0.47/32 trust
  11. host all all 172.16.0.47/32 trust
  12. host all all 0.0.0.0/0 md5

服务管理

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