[pgsql-jp: 26158] usogresの導入でハマっています

HAYAKAWA Hiroshi hayakawa @ sam.hi-ho.ne.jp
2002年 5月 28日 (火) 16:18:38 JST


早川@名古屋と申します。

usogresの導入でハマっています。

SoftwareDesign誌の2001/11月号と、
オフィシャルサイトにある導入方法のページ
<http://usogres.good-day.net/install.php3>
を参考にしています。

サーバーの環境は、
VineLinux2.5(FTP)
PostgreSQL 7.2
usogres-0.8.1
です。

PostgreSQLはVine2.5デフォルトのRPMのもの、
usogres-0.8.1はオフィシャルサイト
<http://usogres.good-day.net/>
からダウンロードしたtarballを
以下の手順でコンパイル&インストールしました。

$ tar zxvf usogres-0.8.1.tar.gz
$ cd usogres-0.8.1
$ ./configure --sysconfdir=/etc
$ make
$ su
# make install

とりあえず1台のマシンでテストをするため、
usogresの設定ファイル/etc/usogresrcは基本的にデフォルトのまま、
logdirのみ変更しました。
また、同じものをrootのホームに.usogresrcとしてコピーしてあります。

host = "127.0.0.1"
port = 5432
hostorg = "127.0.0.1"
portorg = 5434
hostcopy = "127.0.0.1"
portcopy = 5436
logdir = /var/log/usogreslog

すでに立ち上がっているpostmasterを
# /etc/rc.d/init.d/postgresql stop
で停止した上で、
以下の手順でデータベース領域を初期化しました。

# mkdir /var/lib/pgsql/data1
# mkdir /var/lib/pgsql/data2
# chown postgres:postgres /var/lib/pgsql/data1
# chown postgres:postgres /var/lib/pgsql/data2
# su - postgres
$ initdb -D /var/lib/pgsql/data1
$ initdb -D /var/lib/pgsql/data2

続いて、各データベース領域にあるpostgresql.confで、
data1の方を、
tcpip_socket = true
port =5434
とし、data2の方を、
tcpip_socket = true
port =5436
としました。

そしてユーザーpostgresの状態で、
念のためPORTも指定してpostmasterを2つ起動しました。
$ /usr/bin/postmaster -S -i -p 5434 -D /var/lib/pgsql/data1
$ /usr/bin/postmaster -S -i -p 5436 -D /var/lib/pgsql/data2

つづいてrootに戻ってusogresを起動します。
$ exit
# usogres

〜〜〜
ちなみにusogresをユーザーpostgresで起動すると
/var/log/messagesに以下のようなエラーが出ます。
May 28 14:51:10 dev usogres[11965]: UsoSem::open returns error.
〜〜〜

この時点で、プロセスは以下のように立ち上がっています。
(ps axの結果から抜粋)

12039 ?        S      0:00 /usr/bin/postmaster -S -i -p 5434 -D
/var/lib/pgsql/d
12040 ?        S      0:00 postgres: stats buffer process
12041 ?        S      0:00 postgres: stats collector process
12044 ?        S      0:00 /usr/bin/postmaster -S -i -p 5436 -D
/var/lib/pgsql/d
12045 ?        S      0:00 postgres: stats buffer process
12046 ?        S      0:00 postgres: stats collector process
12055 pts/1    S      0:00 usogres



さて、ここからpsqlを使っての動作確認なのですが、
どうもusogresがうまく動いていないようなのです。

メッセージ等からgoogleで検索かけても手掛かりがみつかりません。
何かお気づきorお心当たりの方がいらっしゃいましたら
示唆いただけますと幸いです。


以下、rootおよびユーザーpostgresのそれぞれで、
ホストを明示的に指定した場合と指定しない場合、
2つのpostmasterが動いているポート(5434,5436)と
usogresが待機しているポート(5432)、
およびポートを明示的には指定しない場合の組み合わせ、
合計16通りのpsqlの確認の結果です。

各データベース領域のpg_hba.confはデフォルトのままで
local   all     ident   sameuser
の1行のみ、
PostgreSQLユーザーは登録していません(createuserしてません)。

/tmpには以下の5つの関連ファイルができています。

srwxrwxrwx    1 postgres postgres        0 May 28 15:08 .s.PGSQL.5434=
-rw-------    1 postgres postgres       27 May 28 15:08 .s.PGSQL.5434.lock
srwxrwxrwx    1 postgres postgres        0 May 28 15:08 .s.PGSQL.5436=
-rw-------    1 postgres postgres       27 May 28 15:08 .s.PGSQL.5436.lock
prwx------    1 root     root            0 May 28 15:58 .usofifo|



●●●ここから●●●

[root @ dev /root]# psql -h localhost -p 5434 -l
psql: FATAL 1:  No pg_hba.conf entry for host 127.0.0.1, user root, database
template1

[root @ dev /root]# psql -h localhost -p 5436 -l
psql: FATAL 1:  No pg_hba.conf entry for host 127.0.0.1, user root, database
template1

[root @ dev /root]# psql -h localhost -p 5432 -l
psql: FATAL 1:  No pg_hba.conf entry for host 127.0.0.1, user root, database
template1

[root @ dev /root]# psql -h localhost -l
psql: FATAL 1:  No pg_hba.conf entry for host 127.0.0.1, user root, database
template1

[root @ dev /root]# psql -p 5434 -l
psql: FATAL 1:  user "root" does not exist
[root @ dev /root]# psql -p 5436 -l
psql: FATAL 1:  user "root" does not exist
[root @ dev /root]# psql -p 5432 -l
psql: could not connect to server: そのようなファイルやディレクトリはありま
せん
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
[root @ dev /root]# psql -l
psql: could not connect to server: そのようなファイルやディレクトリはありま
せん
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

[root @ dev /root]# su - postgres
bash-2.04$ psql -h localhost -p 5434 -l
psql: FATAL 1:  No pg_hba.conf entry for host 127.0.0.1, user postgres,
database template1

bash-2.04$ psql -h localhost -p 5436 -l
psql: FATAL 1:  No pg_hba.conf entry for host 127.0.0.1, user postgres,
database template1

bash-2.04$ psql -h localhost -p 5432 -l
psql: FATAL 1:  No pg_hba.conf entry for host 127.0.0.1, user postgres,
database template1

bash-2.04$ psql -h localhost -l
psql: FATAL 1:  No pg_hba.conf entry for host 127.0.0.1, user postgres,
database template1

bash-2.04$ psql -p 5434 -l
        List of databases
   Name    |  Owner   | Encoding
-----------+----------+----------
 template0 | postgres | EUC_JP
 template1 | postgres | EUC_JP
(2 rows)

bash-2.04$ psql -p 5436 -l
        List of databases
   Name    |  Owner   | Encoding
-----------+----------+----------
 template0 | postgres | EUC_JP
 template1 | postgres | EUC_JP
(2 rows)

bash-2.04$ psql -p 5432 -l
psql: could not connect to server: そのようなファイルやディレクトリはありま
せん
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
bash-2.04$ psql -l
psql: could not connect to server: そのようなファイルやディレクトリはありま
せん
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

●●●ここまで●●●


-----
With your dreaming, with your smile.
Hayakawa, Hiroshi <hayakawa @ sam.hi-ho.ne.jp>
Nagoya,Aichi,JAPAN ☆彡





pgsql-jp メーリングリストの案内