标签:
Postgres-XL 是一个完全满足ACID的、开源的、可方便进行水平扩展的、多租户安全的。支持share-nothing;支持海量数据并行处理-MPP(Massively Parallel Processing)。是不是跟 greenplum很相似。
3台主机,安装centos6.2。当然可以准备多台服务器;这个视场景而定合理安排(gtm为一台独立的主机;例外每台机器最好同时配置一个Coordinator和一个Datanode,这样既不用担心二者的负载均衡,而且可以降低网络流量);
Postgres-XL下载安装
创建用户
配置环境变量
配置ssh免密码登录for pgxc_ctl;
配置集群并使用pgxc_ctl初始化集群;
#user and path pgxcOwner=postgres pgxcUser=$pgxcOwner pgxcInstallDir=/usr/local/pgxl-9.2 #gtm and gtmproxy gtmMasterDir=$HOME/pgxc/nodes/gtm gtmMasterPort=6666 gtmMasterServer=192.168.1.201 gtmSlave=n #gtm proxy gtmProxy=n #coordinator coordMasterDir=$HOME/pgxc/nodes/coord coordNames=(coord1 coord2) coordPorts=(5432 5432) poolerPorts=(6667 6668) coordPgHbaEntries=(192.168.1.0/32) coordMasterServers=(192.168.1.202 192.168.1.203) coordMasterDirs=($coordMasterDir/coord1 $coordMasterDir/coord2) coordMaxWALsernder=0 coordMaxWALSenders=($coordMaxWALsernder $coordMaxWALsernder) coordSlave=n coordSpecificExtraConfig=(none none none) coordSpecificExtraPgHba=(none none none) #datanode datanodeNames=(datanode1 datanode2) datanodePorts=(15432 15432) datanodePoolerPorts=(6669 6670) datanodePgHbaEntries=(192.168.1.0/32) datanodeMasterServers=(192.168.1.202 192.168.1.203) datanodeMasterDir=$HOME/pgxc/nodes/datanode datanodeMasterDirs=($datanodeMasterDir/datanode1 $datanodeMasterDir/datanode2) datanodeMaxWalSender=0 datanodeMaxWALSenders=($datanodeMaxWalSender $datanodeMaxWalSender) datanodeSlave=n primaryDatanode=datanode1
[postgres@localhost datanode1]$ psql -p 5432 postgres psql (PGXL 9.2.0, based on PG 9.2.4 (Postgres-XL 9.2.0)) Type "help" for help. postgres=# create role lottu nosuperuser login encrypted password ‘li0924‘; CREATE ROLE postgres=# create tablespace tbs_lottu owner postgres location ‘/home/postgres/data/lottu‘; ERROR: directory "/home/postgres/data/lottu" does not exist postgres=# create tablespace tbs_lottu owner postgres location ‘/home/postgres/data/lottu‘; CREATE TABLESPACE postgres=# create database lottu owner lottu template template0 encoding ‘UTF8‘ tablespace tbs_lottu; CREATE DATABASE postgres=# \c lottu lottu lottu=> create table lottu01 (id int primary key, name varchar(10)); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "lottu01_pkey" for table "lottu01" CREATE TABLE lottu=> insert into lottu01 select generate_series(1,1000),‘lottu‘||generate_series(1,1000); INSERT 0 1000 [postgres@localhost datanode1]$ psql -p 5432 lottu lottu psql (PGXL 9.2.0, based on PG 9.2.4 (Postgres-XL 9.2.0)) Type "help" for help. lottu=> select count(*) from lottu01; count ------- 1000 (1 row) lottu=> \q [postgres@localhost datanode1]$ psql -p 15432 lottu lottu psql (PGXL 9.2.0, based on PG 9.2.4 (Postgres-XL 9.2.0)) Type "help" for help. lottu=> select count(*) from lottu01; count ------- 492 (1 row) [postgres@localhost ~]$ psql -p 15432 lottu lottu psql (PGXL 9.2.0, based on PG 9.2.4 (Postgres-XL 9.2.0)) Type "help" for help. lottu=> select count(*) from lottu01; count ------- 508 (1 row)
标签:
原文地址:http://www.cnblogs.com/lottu/p/5646486.html