In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Recently, the company's business needs, the need to use Postgres-XL cluster, about this part of the knowledge, the network information is not much. After a period of inquiry and various detours, the installation is finally completed. The detailed steps will be fully recorded for reference. And I hope I can help those in need.
Let's start with:
Role assignment for host list and cluster installation
10.21.13.109 GTM10.21.13.67 coordinator&datanode10.21.13.60 datanode
two。 Create postgres users, this part I use ansible to complete the user creation, as well as the application of related software packages to save labor (yum can actually use the way that ansible comes with, so I ansible wrote more amateur)
Ansible all-m shell-a "useradd postgres" ansible all-m shell-a 'echo "postgres:postgres" | chpasswd'ansible all-m shell-a "yum install-y flex bison readline-devel zlib-devel openjade docbook-style-dsssl gcc"
3. Download the software on each node and extract it
Ansible all-m shell-a "wget https://www.postgres-xl.org/downloads/postgres-xl-9.5r1.6.tar.bz2"ansible all-m shell-a" mv / root/postgres-xl-9.5r1.6.tar.bz2 / tmp; chown postgres:postgres / tmp/postgres-xl-9.5r1.6.tar.bz2 "ansible all-m shell-a" tar-jxvf / tmp/postgres-xl-9.5r1.6.tar.bz2-C / home/postgres "
4. All nodes create pgxc paths to store postgres files
Ansible all-m shell-a "su-postgres-c 'mkdir-p / home/postgres/pgxc/nodes/'"
5. Modify the .bashrc file for each node, note: the modification / etc/profile does not take effect.
Su-postgresvi .bashrc
Add the following:
Export PGHOME=/home/postgres/pgxlexport PGUSER=postgresexport LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATHexport PATH=$PGHOME/bin:$PATH
To bring it into effect:
Source / .bashrc
6. Turn off the firewall or release the appropriate port, where I directly shut down the firewall for each virtual machine and restart them:
Service iptables stopchkconfig iptables off-takes effect after restart
7. Turn off SELinux:
View SELinux status:
/ usr/sbin/sestatus-v # # SELinux status: enabled if the SELinux status parameter is enabled
Temporary shutdown (no need to restart the machine):
Setenforce 0 # # set SELinux to permissive mode # # setenforce 1 set SELinux to enforcing mode
Permanently close:
Modify the / etc/selinux/config file to change SELINUX=enforcing to SELINUX=disabled
8. Go to each node to perform the following software installation steps, this process note that if there is an error in the middle, it needs to be resolved. For example, it is true that the gcc package and so on, otherwise the later compilation will not be successful.
Cd postgres-xl./configure-prefix=/home/postgres/pgxl/makemake installcd contrib/makemake instal
9. Execute the pgxc_ctl command to generate the template file to configure the cluster:
. / pgxc_ctl-will prompt Error to say that there is no configuration file, just ignore it
PGXC prepare-executing this command will generate a profile template
10. Modify the corresponding host name, port and other information according to the template, as follows:
Vi ~ / pgxc_ctl/pgxc_ctl.confpgxcInstallDir=$HOME/pgxcpgxcOwner=$USERpgxcUser=$pgxcOwnertmpDir=/tmplocalTmpDir=$tmpDirconfigBackup=nconfigBackupHost=pgxc-linkerconfigBackupDir=$HOME/pgxcconfigBackupFile=pgxc_ctl.bakgtmName=gtmgtmMasterServer=10.21.13.109gtmMasterPort=20001gtmMasterDir=$HOME/pgxc/nodes/gtmgtmExtraConfig=nonegtmMasterSpecificExtraConfig=nonegtmSlave=ngtmProxyDir=$HOME/pgxc/nodes/gtm_pxygtmProxy=ygtmProxyNames= (gtm_pxy1 gtm_pxy2) gtmProxyServers= (10.21.13.67 10.21.13.60) gtmProxyPorts= (20001 20001) gtmProxyDirs= ($gtmProxyDir $gtmProxyDir) gtmPxyExtraConfig=nonegtmPxySpecificExtraConfig= (none none) coordMasterDir=$HOME/pgxc/nodes/coordcoordSlaveDir=$HOME/pgxc/nodes/coord_slavecoordArchLogDir=$HOME/pgxc/nodes/coord_archlogcoordNames= (coord1) coordPorts= (20004) poolerPorts= (20010) coordPgHbaEntries= (10.21.13.0amp 25)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.