标题: pgpool- [打印本页] 作者: hmily36 时间: 2007-02-05 22:18 标题: pgpool- 不知道有哪位用了pgpool的没有?好像用slony 的比较多,是由于pgpool有什么缺陷吗?
哪位用了pgpool的发个配置文档看看作者: cg111 时间: 2007-02-05 22:47
我用过,基本不用配置,直接使用的。好象就修改了一下postgresql的配置文件,使pgpool可以通过TCP/IP访问posygresql就可以了。作者: hmily36 时间: 2007-02-05 23:03
谢谢,不过PGPOOL应该需要配置pgpool.conf吧,就是不怎么明白他是怎么同步数据的。我有2台服务器,想是一台做主服务器,一台做备份服务器,是不是2台都需要安装PGPOOL?作者: cg111 时间: 2007-02-05 23:28
Copy pgpool.conf.sample as pgpool.conf
具体配置文件可以看如下地址: http://pgpool.projects.postgresql.org/
我计算机上运行示例:
netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5433 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5434 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:39283 127.0.0.1:5432 ESTABLISHED
tcp 0 0 127.0.0.1:5432 127.0.0.1:39283 ESTABLISHED
tcp 0 1 192.168.1.42:49137 212.58.240.143:80 SYN_SENT
tcp 0 0 192.168.1.42:56599 63.245.209.21:80 ESTABLISHED
tcp 0 0 192.168.1.42:56600 63.245.209.21:80 ESTABLISHED
tcp6 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN
tcp6 0 0 :::8009 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::8180 :::* LISTEN
其中:5432是postgesql8.1的端口,5433是pgpool的端口,5434是postgre8.2的端口。
使用psql连接postgres8.1:
#>psql -p 5433 test
口令:
Welcome to psql 8.1.6, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
连接情况:
postgres@myhome:/home/cg$ psql -p 5433
口令:
Welcome to psql 8.1.6, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
[ 本帖最后由 likuku 于 2007-2-6 15:12 编辑 ]作者: hmily36 时间: 2007-02-06 19:41
谢谢cg111 以及likuku
我是按照http://pgpool.projects.postgresql.org/的说明进行安装的,pgpool 的文档不是说了可以同步数据的吗?原文:pgpool can be used as a replication server. This allows real-time backup of the database. pgpool sends the exact same query to each PostgreSQL servers to accomplish replication. .................按照这个文档配置了,但是数据不能同步。作者: likuku 时间: 2007-02-12 18:23
pgsqldb.org 的 阿弟 在这两者中还是建议使用 pgCluster