[pgpool-general-jp: 307] 「初めてのレプリケーション」
スクゥ 陶山 泰
suyama @ skoo.co.jp
2007年 12月 11日 (火) 10:59:31 JST
初めまして、陶山と申します。
12/8に博多であった「オープンソースカンファレンスin福岡」で、石井さん
の「pgpool-II 2.0について」の話を聞き、さっそく試行錯誤しています。
その中でどういう意味のエラーなのかどう対策すればいいのかわからないこ
とが発生して困っています。
システム構成は、[pgpool-general-jp:207] で示されているものとほぼ同じ
です。
■やりたいこと
2台のサーバーがあってレプリケーションをしたい
■やったこと
2台ともに同じバージョンのPostgreSQLをインストールしています。
それぞれportを5432と5432を指定して(本当はポート指定せずに)
postgresqlを起動しました。
その内1台にpgpool-IIをインストールしてあります。
サーバAIPアドレス 192.168.24.62 (pgpoolインストール)
サーバBIPアドレス 192.168.24.64
OS debian GNU/Linux 4.0r1 (ネットワークインストール)
PostgreSQL のバージョン 7.4 (apt-get install postgresql-7.4)
pgpool.confには
socket_dir = '/var/run/postgresql'
pcp_socket_dir = '/var/run/postgresql'
backend_socket_dir = '/var/run/postgresql'
replication_mode = true
load_balance_mode = true
として
backend_hostname0 = 'localhost'
backend_port0 = 5432
backend_weight0 = 1
backend_hostname1 = '192.168.24.64'
backend_port1 = 5432
backend_weight1 = 1
と設定しました。
pgpool の動いているホスト(192.168.24.62)から
$ psql -h 192.168.24.64 -l
とやりますと、
List of databases
Name | Owner | Encoding
-----------+----------+-----------
test_data | postgres | UNICODE
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
(3 rows)
ときちんとアクセスできています。
ここで、
$ createdb -p 9999 bench_replication
とやりますと
createdb: could not connect to database template1: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
となります。このエラーメッセージの意味がわからないため、対処することが
できないでいます。
なお、
$ psql template1 -h 192.168.24.64 -p 5432
としたり、
$ psql template1 -h 192.168.24.62 -p 5432
としたり、
$ psql template1 -h 192.168.24.64
や
$ psql template1 -h 192.168.24.62
や
$ psql template1
ではエラーがでずに template1 に接続できます。
また、/var/run/postgresql は
# ls -al
total 12
drwxrwsr-x 2 postgres postgres 4096 Dec 11 10:18 .
drwxr-xr-x 6 root root 4096 Dec 11 09:51 ..
srwxrwxrwx 1 postgres postgres 0 Dec 11 10:46 .s.PGSQL.5432
-rw------- 1 postgres postgres 34 Dec 11 10:46 .s.PGSQL.5432.lock
srwxrwxrwx 1 postgres postgres 0 Dec 11 10:18 .s.PGSQL.9898
srwxrwxrwx 1 postgres postgres 0 Dec 11 10:18 .s.PGSQL.9999
となっています。
なんとかここを解決して先へ進みたいのですが、指摘やヒント、アイデア等
ございましたら、教えていただけないでしょうか。
よろしくお願いいたします。
■バージョンなど
debian GNU/Linux 4.0r1
PostgreSQL 7.4.17
pgpool-II-2.0.1
pgpool-general-jp メーリングリストの案内