ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Postgres-XC单机安装

Postgres-XC单机安装

原创 Linux操作系统 作者:std1984 时间:2012-12-04 14:19:01 0 删除 编辑
单机环境: CentOS 6 64bit,  pgxc-v1.0.1.tar.gz
 
解压 pgxc-v1.0.1.tar.gz,进入pgxc,
 ./configure --without-readline --without-zlib    ( 注:由于服务器未安装readline和zlib包,故省去)
gmake
gmake install
 
安装协调结点,数据结点和GTM,
cd /usr/local/pgsql/bin/
./initdb -D /usr/local/pgsql/data_coord1 --nodename coord1
./initdb -D /usr/local/pgsql/data_datanode1 --nodename datanode1
./initdb -D /usr/local/pgsql/data_datanode2 --nodename datanode2
./initgtm -D /usr/local/pgsql/data_gtm -Z gtm
 
启动服务:
./gtm -D /usr/local/pgsql/data_gtm &
./postgres -X -p 15432 -D /usr/local/pgsql/data_datanode1 &
./postgres -X -p 15433 -D /usr/local/pgsql/data_datanode2 &
./postgres -C -D /usr/local/pgsql/data_coord1 &
 
进入postgres-xc,创建元数据
./psql
create node datanode1 with(type='datanode', port=15432);
create node datanode2 with(type='datanode', port=15433);
select pgxc_pool_reload();
./createdb test
 
创建测试数据库
./psql test
create table user_info_hash(id int primary key,firstname text,lastname text,info text) distribute by hash(id) to node datanode1,datanode2;
insert into user_info_hash select generate_series(1,10000),'zhou','digoal','DBA';

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16582684/viewspace-750515/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-12-29

  • 博文量
    171
  • 访问量
    1401347