Postgres-XL使用说明文档 下载本文

#---- GTM Slave ----------------------------------------------- gtmSlave=n ……

#---- GTM Proxy ------------------------------------------------------------------------------------------------------- gtmProxyDir=$HOME/pgxl9.5/data/gtm_pxy #---- Overall ------- gtmProxy=y

# Specify y if you conifugre at least one GTM proxy. You may not configure gtm proxies

# Specify y if you configure GTM Slave. Otherwise, GTM slave will not be configured and

gtmProxyNames=(gtm_pxy1 gtm_pxy2) # No used if it is not configured gtmProxyServers=(192.168.51.125 192.168.51.120) gtmProxyPorts=(20001 20001)

# Specify none if you dont' configure it.

# Not used if it is not configured.

gtmProxyDirs=($gtmProxyDir $gtmProxyDir)

#---- Configuration ---- gtmPxyExtraConfig=none

# Not used if it is not configured.

# Extra configuration parameter for gtm_proxy. Coordinator section has an example.

gtmPxySpecificExtraConfig=(none none)

#---- Coordinators ----------------------------------------------------------------------------------------------------

#---- shortcuts ----------

coordMasterDir=$HOME/pgxl9.5/data/coord coordSlaveDir=$HOME/pgxl9.5/data/coord_slave coordArchLogDir=$HOME/pgxc9.5/data/coord_archlog

#---- Overall ------------ coordNames=(coord1 coord2) coordPorts=(20004 20004) poolerPorts=(20010 20010)

# Master and slave use the same name # Master ports # Master pooler ports

# Assumes that all the coordinator (master/slave) accepts

coordPgHbaEntries=(192.168.51.0/24) #---- Master -------------

coordMasterServers=(192.168.51.125 192.168.51.120) coordMasterDirs=($coordMasterDir $coordMasterDir)

# none means this master is not available

coordMaxWALsernder=5 # max_wal_senders: needed to configure slave. If zero value is specified, coordMaxWALSenders=($coordMaxWALsernder $coordMaxWALsernder)

#---- Slave ------------- coordSlave=n

# Specify y if you configure at least one coordiantor slave. Otherwise, the following

# max_wal_senders configuration for each coordinator.

#---- Configuration files---

# You can put your postgresql.conf lines here. cat > $coordExtraConfig <

#================================================ # Added to all the coordinator postgresql.conf # Original: $coordExtraConfig

log_destination = 'stderr' logging_collector = on log_directory = 'pg_log' listen_addresses = '*' max_connections = 1024 EOF

#---- Datanodes ------------------------------------------------------------------------------------------------------- #---- Shortcuts --------------

datanodeMasterDir=$HOME/pgxl9.5/data datanodeSlaveDir=$HOME/pgxl9.5/data/dn_slave

datanodeArchLogDir=$HOME/pgxl9.5/data/datanode_archlog

#---- Overall --------------- #primaryDatanode=datanode1

# Primary Node.

# At present, xc has a priblem to issue ALTER NODE against the primay node. Until it is fixed, the test will be done # without this feature. primaryDatanode=dn1

# Primary Node.

datanodeNames=(dn1dn2dn3dn4) datanodePorts=(20008 20009 20008 20009)

# Master ports

# Master pooler ports

datanodePoolerPorts=(20012 20013 20012 20013) datanodePgHbaEntries=(192.168.51.0/24) #---- Master ----------------

# Assumes that all the coordinator (master/slave) accepts

datanodeMasterServers=(192.168.51.125 192.168.51.125 192.168.51.120 192.168.51.120)# none means this master is not available. datanodeMasterDirs=($datanodeMasterDir/dn1 $datanodeMasterDir/dn2 $datanodeMasterDir/dn3 $datanodeMasterDir/dn4) datanodeMaxWalSender=5

# max_wal_senders: needed to configure slave. If zero value is

datanodeMaxWALSenders=($datanodeMaxWalSender $datanodeMaxWalSender $datanodeMaxWalSender $datanodeMaxWalSender)

13.3 初始化集群

以postgres用户执行:

$ pg_ctl -c ~/pgxc_ctl/pgxc_ctl.conf init all

其他命令: 1)启动集群: pg_ctl start all

效果如下图:

2)停止集群 pg_ctl stop all

13.4 修改PostgreSQL数据库默认用户postgres的密码

PostgreSQL数据库创建一个postgres用户作为数据库的管理员,密码随机,所以需要修改密码,方式如下:

步骤一:登录PostgreSQL $ su – postgres

psql –p 20004 –U postgres –h 192.168.51.125 (登录coordinator节点进行修改) 步骤二:修改登录PostgreSQL密码

Alter user postgres with password ‘sfa5000_zhjkb’;

注:密码postgres要用引号引起来,命令最后有分号

步骤三:退出PostgreSQL客户端 \\q

效果如下图所示:

13.5 检查并修改配置

(1) gtm节点配置(scada_server1节点) $ su – postgres

$ cd pgxl9.5/data/gtm $ vi gtm.conf

在gtm.conf文件的最下面,可看到如图所示内容(由集群初始化时自动添加的内容):

(2) gtm_proxy节点(scada_server2节点,scada_server3节点) $ su – postgres

$ cd pgxl9.5/data/gtm_pxy $ vi gtm_proxy.conf

在gtm_proxy.conf文件的最下面,可看到如图所示内容(由集群初始化时自动添加的内容):

(3) coordinater节点(scada_server2节点,scada_server3节点) ① 检查并修改postgres.conf文件 $ su – postgres

$ cd pgxl9.5/data/coord $ vi postgres.conf

在postgres.conf文件的最下面,可看到如图所示内容(由集群初始化时自动添加的内容): 在scada_server2上的coord配置信息: