1、创建用户postgresansible all -m shell -a "useradd postgres"
2、修改postgres用户的密码ansible all -m shell -a 'echo "postgres:postgres" | chpasswd'
3、批量安装基础软件包a艘绒庳焰nsible all -m shell -a "yum install -y flex biso荏鱿胫协n readline-devel zlib-devel openjade docbook-style-dsssl gcc"
4、在每个节点上获取安装软件,并解压缩
5、全部节点都创建pg垓矗梅吒xc路径,用来存放postgres文件ansible all -m shell -a "su - postgres -艘早祓胂c 'mkdir -p /home/postgres/pgxc/nodes/'"
6、修改每个节点的.bashrc文竭惮蚕斗件su - postgresvi .bashrcexport PGHOME=/h泠贾高框ome/postgres/pgxlexport PGUSER=postgresexport LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATHexport PATH=$PGHOME/bin:$PATHsource ~/.bashrc
7、关闭iptablessystemctl stop iptables.servicesystemctl disable iptables.service关闭SELinuxsetenforce 0
8、pgxc_ctl -c pgxc_ctl.conf init all