环境准备

机器准备

  • 服务器数量

2台,IP分别为: 172.16.0.29,172.16.0.47

  • 硬件配置

CPU:4核内存:8G系统盘:50G数据盘:200G

  • 操作系统要求

centos7.3

创建OS用户

  • 创建操作系统运行用户
  1. [root@VM_0_29_centos ~]# adduser -d /data/tbase tbase
  • 配置操作系统用户密码
  1. [root@VM_0_29_centos pgxztmp]# passwd tbase
  • 创建tbase应用程序运行目录
  1. [root@VM_0_29_centos pgxz]# su tbase
  2. [tbase@VM_0_29_centos install]$ mkdir -p /data/tbase/install/pgxz
  • 创建tbase数据目录
  1. [root@VM_0_29_centos pgxz]# su tbase
  2. [tbase@VM_0_29_centos install]$ mkdir -p /data/tbase/data/pgxz
  • 上传pgxz应用程序到目录/data/tbase/install/pgxz下面,目录的结构为
  1. [tbase@VM_0_29_centos pgxz]$ ll /data/tbase/install/pgxz
  2. total 4
  3. drwxrwxr-x 2 pgxz pgxz 4096 Nov 10 04:33 bin
  4. drwxrwxr-x 4 pgxz pgxz 189 Nov 10 04:33 include
  5. drwxrwxr-x 4 pgxz pgxz 172 Nov 10 04:33 lib
  6. drwxrwxr-x 3 pgxz pgxz 24 Oct 1 14:54 share
  7. [tbase@VM_0_29_centos pgxz]$
  • 配置pgxz用户的环境变量
  1. [tbase@VM_0_29_centos ~]$ vim /data/tbase/.bashrc
  2. # .bashrc
  3. # Source global definitions
  4. if [ -f /etc/bashrc ]; then
  5. . /etc/bashrc
  6. fi
  7. export TBASE_HOME=/data/tbase/install/pgxz
  8. export PATH=$TBASE_HOME/bin:$PATH
  9. export LD_LIBRARY_PATH=$TBASE_HOME/lib:${LD_LIBRARY_PATH}

配置公共参数

  1. [tbase@VM_0_29_centos ~]# mkdir -p /data/tbase/global/
  2. [tbase@VM_0_29_centos ~]#vim /data/tbase/global/postgresql.conf.user
  3. listen_addresses = '0.0.0.0'
  4. max_connections = 500
  5. max_pool_size = 65535
  6. shared_buffers = 1GB
  7. max_prepared_transactions = 2000
  8. maintenance_work_mem = 256MB
  9. wal_level = logical
  10. max_wal_senders = 64
  11. max_wal_size = 1GB
  12. min_wal_size = 256MB
  13. log_destination = 'csvlog'
  14. logging_collector = on
  15. log_directory = 'log'
  16. log_filename = 'postgresql-%A-%H.log'
  17. synchronous_commit = local
  18. synchronous_standby_names = ''

安装配置拓补结构说明

节点名称IP目录
gtm主172.16.0.29/data/tbase/data/pgxz/gtm
gtm备172.16.0.47/data/tbase/data/pgxz/gtm
cn01172.16.0.29/data/tbase/data/pgxz/cn01
cn02172.16.0.47/data/tbase/data/pgxz/cn02
dn01主172.16.0.29/data/tbase/data/pgxz/dn01
dn01备172.16.0.47/data/tbase/data/pgxz/dn01
dn02主172.16.0.47/data/tbase/data/pgxz/dn02
dn02备172.16.0.29/data/tbase/data/pgxz/dn02