Postgres_XL 简要安装配置说明

1.系统需求

CentOS 7.2 X64

postgres-xl-9.5r1.4.tar.gz

# yum install -y gcc-c++

# yum install -y readline-devel

# yum install -y zlib-devel

# yum install -y perl

# yum install -y flex

# yum install -y flex-devel

2.安装postgres-xl

/home/soft/

tar zxvf postgres-xl-9.5r1.4.tar.gz

./configure

make

make install

3.添加用户

adduser postgres

su - postgres

vi .bash_profile

export LD_LIBRARY_PATH=/usr/local/pgsql/lib

export PATH=/usr/local/pgsql/bin:$PATH

export MANPATH=/usr/local/pgsql/share/man:$MANPATH

4.建立data目录

--建立coord, datanode, gtm的data目录

mkdir -p /opt/pgxl/data/data_coord1

mkdir -p /opt/pgxl/data/data_datanode_1

mkdir -p /opt/pgxl/data/data_datanode_2

mkdir -p /opt/pgxl/data/data_gtm

chown postgres /opt/pgxl/data/data_coord1

chown postgres /opt/pgxl/data/data_datanode_1

chown postgres /opt/pgxl/data/data_datanode_2

chown postgres /opt/pgxl/data/data_gtm

5.初始化coordinator, datanode

su - postgres

/usr/local/pgsql/bin/initdb -D /opt/pgxl/data/data_coord1 \

--nodename coord1

/usr/local/pgsql/bin/initdb -D /opt/pgxl/data/data_datanode_1 \

--nodename datanode_1

/usr/local/pgsql/bin/initdb -D /opt/pgxl/data/data_datanode_2 \

--nodename datanode_2

/usr/local/pgsql/bin/initgtm -D /opt/pgxl/data/data_gtm -Z gtm

6.启动gtm, datanode, coordinator

-- gtm

/usr/local/pgsql/bin/gtm -D /opt/pgxl/data/data_gtm >/opt/pgxl/data/data_gtm/gtm_logfile.log 2>&1 &

-- datanode

/usr/local/pgsql/bin/postgres --datanode -p 15432 -c pooler_port=40101 \

-D /opt/pgxl/data/data_datanode_1 >/opt/pgxl/data/data_datanode_1/datanode1_logfile.log 2>&1 &

/usr/local/pgsql/bin/postgres --datanode -p 15433 -c pooler_port=40102 \

-D /opt/pgxl/data/data_datanode_2 >/opt/pgxl/data/data_datanode_1/datanode2_logfile.log 2>&1 &

-- coordinator

/usr/local/pgsql/bin/postgres --coordinator -c pooler_port=40100 \

-D /opt/pgxl/data/data_coord1 >/opt/pgxl/data/data_coord1/data_coord1_logfile.log 2>&1 &

7.配置节点类型、端口

/usr/local/pgsql/bin/psql -c "ALTER NODE coord1 \

WITH (TYPE = ‘coordinator‘, PORT = 5432)" postgres

/usr/local/pgsql/bin/psql -c "CREATE NODE datanode_1 \

WITH (TYPE = ‘datanode‘, PORT = 15432)" postgres

/usr/local/pgsql/bin/psql -c "CREATE NODE datanode_2 \

WITH (TYPE = ‘datanode‘, PORT = 15433)" postgres

8.配置执行导向

/usr/local/pgsql/bin/psql -c "EXECUTE DIRECT ON (datanode_1) \

‘ALTER NODE datanode_1 WITH (TYPE = ‘‘datanode‘‘, PORT = 15432)‘" postgres

/usr/local/pgsql/bin/psql -c "EXECUTE DIRECT ON (datanode_1) \

‘CREATE NODE datanode_2 WITH (TYPE = ‘‘datanode‘‘, PORT = 15433)‘" postgres

/usr/local/pgsql/bin/psql -c "EXECUTE DIRECT ON (datanode_1) \

‘CREATE NODE coord1 WITH (TYPE = ‘‘coordinator‘‘, PORT = 5432)‘" postgres

/usr/local/pgsql/bin/psql -c "EXECUTE DIRECT ON (datanode_2) \

‘ALTER NODE datanode_2 WITH (TYPE = ‘‘datanode‘‘, PORT = 15433)‘" postgres

/usr/local/pgsql/bin/psql -c "EXECUTE DIRECT ON (datanode_2) \

‘CREATE NODE datanode_1 WITH (TYPE = ‘‘datanode‘‘, PORT = 15432)‘" postgres

/usr/local/pgsql/bin/psql -c "EXECUTE DIRECT ON (datanode_2) \

‘CREATE NODE coord1 WITH (TYPE = ‘‘coordinator‘‘, PORT = 5432)‘" postgres

9.重载配置

/usr/local/pgsql/bin/psql -c "SELECT pgxc_pool_reload()" postgres

/usr/local/pgsql/bin/psql -c "EXECUTE DIRECT ON (datanode_1) \

‘SELECT pgxc_pool_reload()‘" postgres

/usr/local/pgsql/bin/psql -c "EXECUTE DIRECT ON (datanode_2) \

‘SELECT pgxc_pool_reload()‘" postgres

10.插入测试

创建测试表

登录 coordinator

/usr/local/pgsql/bin/createdb test

/usr/local/pgsql/bin/psql test

test=# create table t1(id int, name varchar(20))

test=# \dt

List of relations

Schema | Name | Type  |  Owner

--------+------+-------+----------

public | t1   | table | postgres

(1 row)

test=# insert into t1 SELECT generate_series(1,1000000) as key, ‘Peter‘||(random()*(10^3))::integer;

INSERT 0 1000000

test=# \timing

Timing is on.

test=# insert into t1 SELECT generate_series(1000001,5000000) as key, ‘Peter‘||(random()*(10^3))::integer;

INSERT 0 4000000

Time: 60653.631 ms

test=#

查看数据分布

登录datanode_1

[[email protected] ~]$ psql -p 15432 test

psql (PGXL 9.5r1.4, based on PG 9.5.5 (Postgres-XL 9.5r1.4))

Type "help" for help.

test=# select count(*) from t1;

count

---------

2502488

(1 row)

test=# \q

登录datanode_2

[[email protected] ~]$ psql -p 15433 test

psql (PGXL 9.5r1.4, based on PG 9.5.5 (Postgres-XL 9.5r1.4))

Type "help" for help.

test=# select count(*) from t1;

count

---------

2497512

(1 row)

test=# \q

登录 coordinator

[[email protected] ~]$ psql -p test

psql: invalid port number: "test"

[[email protected] ~]$ psql test

psql (PGXL 9.5r1.4, based on PG 9.5.5 (Postgres-XL 9.5r1.4))

Type "help" for help.

test=# select count(*) from t1;

count

---------

5000000

(1 row)

test=# \dt t1;

List of relations

Schema | Name | Type  |  Owner

--------+------+-------+----------

public | t1   | table | postgres

(1 row)

test=#

时间: 2024-10-10 17:57:01

Postgres_XL 简要安装配置说明的相关文章

Nginx简要安装配置说明

Nginx简要安装配置说明  一. Nginx简介   Nginx是一款高性能的HTTP和反向代理服务器软件,可以运行在UNIX.GNU/Linux.BSD.Mac OS X. Solaris 以及 Microsoft Windows等操作系统中.其优点是占用系统资源少,支持大并发连接(官方声称最大支持5万并发连接响应而只占2.5M内存):因其部署简单,配置灵活.高效.稳定的特点已被广泛应用于各大型网站架构中. 二.安装   1).安装所需环境  gcc-c++ .openssl-devel .

nagios 安装配置说明(一)

Nagios安装配置说明 修改YUM源为国内sohu的站点: [[email protected] ~]# cd/etc/yum.repos.d/ [[email protected] yum.repos.d]# ls CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo  CentOS-Vault.repo [[email protected] yum.repos.d]# mvCentOS-Base.repo CentOS-Bas

linux+php5.1.6+mysql5.0.2+apache2.0.55安装配置说明(转)

linux+php5.1.6+mysql5.0.2+apache2.0.55安装配置说明:一.mysql5.0.2的安装配置过程及说明:1. #tar -zvxf mysql-5.0.2-alpha.tar.gz2. cd mysql5.0.23. ./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql --with-charset=gbk  #--prefix=/usr/loc

Sersync2完全安装配置说明

当前版本的sersync依赖于rsync进行同步.如下图所示,在同步主服务器上开启sersync,将监控路径中的文件同步到目标服务器,因此需要在主服务器配置sersync,在同步目标服务器配置rsync.对于rsync配置,在google上可以找到很多资料,以下只是一些必要的配置和使用说明,仅供参考,请根据您的实际情况修改. 需要在同步主服务器上配置sersync,在同步目标服务器配置rsync,并在目标服务器开启rsync守候进程,这样在主服务器产生的文 件,就会被sersync实时同步到多个

APACHE安装配置说明

一.软件下载 1.apache:http://archive.apache.org/dist/httpd/httpd-2.2.12.tar.gz或者http://apache.etoak.com/httpd/httpd-2.2.13.tar.gz 二.环境检查 # rpm -qa|grep zlibzlib-devel-1.2.3-3zlib-1.2.3-3# rpm -qa|grep sslopenssl-devel-0.9.8b-10.el5openssl-0.9.8b-10.el5 如果需

Puppet的简要安装

一.Puppet简介    Puppet基于ruby语言开发的自动化系统配置工具,可以C/S模式或独立运行,支持对所有UNIX及类UNIX系统的配置管理,最新版本也开始支持对Windows操作系统有限的一些管理.Puppet适用于服务器管的整个过程 ,比如初始安装.配置更新以及系统下线    Puppet 是一个客户端/服务器(C/S)架构的配置管理工具,在中央服务器上安装 puppet-server 服务器(puppet master),在需要被管理的目标服务器上安装 puppet 客户端软件

Spark in action Spark 以及SparkR的安装配置说明

Spark以及SparkR的安装(standalone模式) From :ssdutsu @ Inspur Company  [email protected] 操作系统 CentOS 7 Java 版本 JDK 1.7 Spark安装过程请见PDF文件 Spark 1.0的安装配置文件 网址:http://www.it165.net/admin/html/201407/3379.html (别忘了配置免密码登陆和关闭防火墙) 下面重点描述如何在linux环境下安装R,Rstudio 以及Spa

第一步solr安装配置说明

1.solr安装及配置: 1.1.环境配置:Tomcat6 + jdk1.6 + solr-4.7.2:注:solr4.8及以上必须要jdk1.7以上才能正确编译 1.2.solr历史版本下载:http://archive.apache.org/dist/lucene/solr/ 2.将下载下来的solr-4.7.2压缩包解压,解压后的目录结构如下图: 3.把solr-4.7.2\example\目录下的,整个solr文件拷贝到电脑硬盘中的任意位置,这里存放在E盘下:E:\solr 4.将sol

mysql-NDBcluster安装配置说明

Mysql cluster介绍: MySQL Cluster 是一种技术,该技术允许在无共享的系统中部署"内存中"数据库的 Cluster .通过无共享体系结构,系统能够使用廉价的硬件,而且对软硬件无特殊要求.此外,由于每个组件有自己的内存和磁盘,不存在单点故障. MySQL Cluster 由一组计算机构成,每台计算机上均运行着多种进程,包括MySQL服务器,NDB Cluster 的数据节点,管理服务器,以及(可能)专门的数据访问程序.关于 Cluster 中这些组件的关系. &q