近期在学习PostgreSQL-XL,现在把PostgreSQL-XL的安装部署步骤简单记录一下。
机器准备:
3台虚拟机信息:
? ? ? ? ? ? ? ? gtm:a. 版本信息:Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
? ? ? ? ? ? ? ? ? ? ? ? b. IP:192.168.100.199? ?
? ? ? ? ? ? ? ? node1:a. 版本信息:Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
? ? ? ? ? ? ? ? ? ? ? ? ? ? b. IP:192.168.100.201
? ? ? ? ? ? ? ? node2:a. 版本信息:Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux
? ? ? ? ? ? ? ? ? ? ? ? ? ? b. IP:192.168.100.202
安装(三台虚机同时按下面步骤安装):
? ? ? ? 1、下载源码:官方下载,网盘下载。
? ? ? ? 2、解压源码
tar xvf postgres-xl-v9.2-src.tar.gz
? ? ? ? 3、编译安装
./configure --prefix=/opt/pgxl
make
make install
'/usr/bin/perl' /bin/collateindex.pl -f -g -i 'bookindex' -o bookindex.sgml HTML.index
Can't open perl script "/bin/collateindex.pl": No such file or directory
make[4]: *** [bookindex.sgml] Error 2
make[4]: Leaving directory `/root/postgres-xl/doc-xc/src/sgml'
make[3]: *** [sql_help.h] Error 2
make[3]: Leaving directory `/root/postgres-xl/src/bin/psql'
make[2]: *** [all-psql-recurse] Error 2
make[2]: Leaving directory `/root/postgres-xl/src/bin'
make[1]: *** [all-bin-recurse] Error 2
make[1]: Leaving directory `/root/postgres-xl/src'
make: *** [all-src-recurse] Error 2
解决方法:
#yum install docbook-style-dsssl
#find / -name collateindex.pl
/usr/bin/collateindex.pl
#cp /usr/bin/collateindex.pl /bin/
节点部署:
新建用户(三台虚机依次操作,注意:一定要用相同的用户,否则会发生用户找不到的问题):
[root@localhost opt]# useradd pgxl
[root@localhost opt]# chown -R pgxl pgxl/
[root@localhost opt]# su pgxl
[pgxl@localhost pgxl]$ ls
bin? data_gtm? include? lib? share
[pgxl@localhost pgxl]$ cd bin/
[pgxl@localhost bin]$ ls
clusterdb? createuser? dropuser? gtm_ctl? ? initgtm? ? ? ? pg_config? ? ? pg_dump? ? ? ? pg_resetxlog? postmaster? vacuumdb
createdb? ? dropdb? ? ? ecpg? ? ? gtm_proxy? makesgml? ? ? pg_controldata? pg_dumpall? ? ? pg_restore? ? psql
createlang? droplang? ? gtm? ? ? initdb? ? pg_basebackup? pg_ctl? ? ? ? ? pg_receivexlog? postgres? ? ? reindexdb
[pgxl@localhost bin]$
初始化:
gtm初始化:
[pgxl@localhost bin]$ ./initgtm -D /opt/pgxl/data_gtm/ -Z gtm
The files belonging to this GTM system will be owned by user "pgxl".
This user must also own the server process.
?
?
creating directory /opt/pgxl/data_gtm ... ok
creating configuration files ... ok
?
Success. You can now start the GTM server using:
?
? ? ./gtm -D /opt/pgxl/data_gtm
or
? ? ./gtm_ctl -Z gtm -D /opt/pgxl/data_gtm -l logfile start
?
[pgxl@localhost bin]$
node1初始化(initdb初始化过程和pg初始化过程一致,这里就不多赘述了):
[pgxl@localhost bin]$ ./initdb -D /opt/pgxl/data/coordinator1/ --nodename coordinator1
[pgxl@localhost bin]$ ./initdb -D /opt/pgxl/data/datanode1/ --nodename datanode1
[pgxl@localhost bin]$ ./initgtm -D /opt/pgxl/data/gtm_proxy1/ -Z gtm_proxy
The files belonging to this GTM system will be owned by user "pgxl".
This user must also own the server process.
?
creating directory /opt/pgxl/data/gtm_proxy1 ... ok
creating configuration files ... ok
?
Success. You can now start the GTM proxy server using:
?
? ? ./gtm_proxy -D /opt/pgxl/data/gtm_proxy1
or
? ? ./gtm_ctl -Z gtm_proxy -D /opt/pgxl/data/gtm_proxy1 -l logfile start
node2初始化:
[pgxl@localhost bin]$ ./initdb -D /opt/pgxl/data/coordinator2/ --nodename coordinator2
[pgxl@localhost bin]$ ./initdb -D /opt/pgxl/data/datanode2/ --nodename datanode2
[pgxl@localhost bin]$ ./initgtm -D /opt/pgxl/data/g