设为首页 加入收藏

TOP

Postgres-X2部署步骤(三)
2015-12-01 16:02:58 来源: 作者: 【 】 浏览:22
Tags:Postgres-X2 部署 步骤

freezing database template1 ... ok
freezing database postgres ... ok
?
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
?
Success.
?You can now start the database server of the Postgres-XC coordinator using:
?
? ? postgres --coordinator -D /home/postgres/pgxc/nodes/dn_master/datanode2
or
? ? pg_ctl start -D /home/postgres/pgxc/nodes/dn_master/datanode2 -Z coordinator -l logfile
?
?You can now start the database server of the Postgres-XC datanode using:
?
? ? postgres --datanode -D /home/postgres/pgxc/nodes/dn_master/datanode2
or
? ? pg_ctl start -D /home/postgres/pgxc/nodes/dn_master/datanode2 -Z datanode -l logfile
?
Done.
Starting all the datanode masters.
Starting datanode master datanode1.
Starting datanode master datanode2.
Done.
ALTER NODE coord1 WITH (HOST='192.168.238.130', PORT=5432);
ALTER NODE
CREATE NODE datanode1 WITH (TYPE='datanode', HOST='192.168.238.131', PORT=15432, PRIMARY);
CREATE NODE
CREATE NODE datanode2 WITH (TYPE='datanode', HOST='192.168.238.132', PORT=15432);
CREATE NODE
Done.


4、运行演示


[postgres@localhost ~]$ psql -h 192.168.238.130 -p 5432 -d postgres -U postgres
psql (PGXC 1.3devel, based on PG 9.4beta1)
Type "help" for help.
?
postgres=# create table test(id int, name text) distribute by replication;
CREATE TABLE
postgres=# insert into test values (1,'wang'),(2,'shuo');
INSERT 0 2
postgres=# select * from test;
?id | name
----+------
? 1 | wang
? 2 | shuo
(2 rows)
?
postgres=# \q
[postgres@localhost ~]$ psql -h 192.168.238.131 -p 15432 -d postgres -U postgres
psql (PGXC 1.3devel, based on PG 9.4beta1)
Type "help" for help.
?
postgres=# select * from test;
?id | name
----+------
? 1 | wang
? 2 | shuo
(2 rows)
?
postgres=# \q
[postgres@localhost ~]$ psql -h 192.168.238.132 -p 15432 -d postgres -U postgres
psql (PGXC 1.3devel, based on PG 9.4beta1)
Type "help" for help.
?
postgres=# select * from test;
?id | name
----+------
? 1 | wang
? 2 | shuo
(2 rows)
?
postgres=#


总结:


相较于手动部署,利用pgxc_ctl部署效率以及正确率是非常高的,欢迎大家尝试。


------------------------------------华丽丽的分割线------------------------------------


------------------------------------华丽丽的分割线------------------------------------


首页 上一页 1 2 3 4 下一页 尾页 3/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇编译安装Redis Stable最新版本 下一篇PostgreSQL用C完成存储过程实例

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: