• 締切済み

Fedora6でPostgreSQL8.1が起動しない

Linux超初心者です。 Fedora Core 6 カーネル2.6 を使っています。 PostgreSQLをGNOMEのパッケージマネージャでインストールしました。 バージョンは8.1.xxだと思います。 問題ですが、postmasterが起動できません。 su - postgres postmaster -i -D /var/lib/pgsql/data を実行すると FATAL: data directory "/var/lib/pgsql/data" has group or world access DETAIL: Permissions should be u=rwx (0700). と怒られます。詳しい方、ご教授願います。 chmod 777 /var/lib/pgsql/data は試しましたがダメでした。

みんなの回答

noname#98978
noname#98978
回答No.3

FedoraCore6にPostgresqlをインストールしました。 なんら苦労せず、動きました。 # yum install postgresql-server # /etc/init.d/postgresql start データベースを初期化中:         [ OK ] postgresql サービスを開始中:      [ OK ] # ps ax | grep postgresql 3834 ?     S     0:00 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data 3836 ?     S     0:00 postgres: logger process 3838 ?     S     0:00 postgres: writer process 3839 ?     S     0:00 postgres: stats buffer process 3840 ?     S     0:00 postgres: stats collector process

jimachan
質問者

お礼

回答ありがとうございます。 yum は yum -y update を最初にやって忘れてました。 やってみます。

  • xiade
  • ベストアンサー率64% (88/137)
回答No.2

ディレクトリ /var/lib/pgsql/data のオーナとグループは何になっていますか? PostgreSQL用のオーナ(ユーザ)になっていますか? 基本的に、原因はすべてログに出ていますよ。ログの確認の仕方がよくわからなければ、とりあえず起動するようになるまでは pg_ctl ではなく 最初の質問のとおり postmaster を直接起動してエラーメッセージを眺めてください。 ・ログの確認の仕方は近々身につけましょう。これはPostgresに限らず何においても必要になります。 > 調子に乗ってユーザーを作ろうとしたら以下の結果でした。 > connections on Unix domain socket "/tmp/.s.PGSQL.5432"? 先走りすぎですよ(笑) まだ PostgreSQL サーバが正常に起動していません。 エンジンかかってないのにアクセル踏んでもダメです。 あせらずゆっくり、地道に :)

jimachan
質問者

お礼

ご回答、アドバイス、ありがとうございます。 >ディレクトリ /var/lib/pgsql/data のオーナとグループは何になっていますか? GUIツールで見ると オーナ  postgres - PostgreSQL Server グループ postgres となっています。 >・ログの確認の仕方は近々身につけましょう。これはPostgresに限らず何においても必要になります。 おっしゃるとおりですね。ログを見るようにします。 >あせらずゆっくり、地道に :) ありがとうございます!

  • xiade
  • ベストアンサー率64% (88/137)
回答No.1

原因と答えがまるまる書いてあるではないですか :) > FATAL: data directory "/var/lib/pgsql/data" has group or world access > DETAIL: Permissions should be u=rwx (0700). chmod 700 /var/lib/pgsql/data してください。

jimachan
質問者

お礼

回答ありがとうございます。ばかな初心者ですみません。 chmod 700 /var/lib/pgsql/dataしてみましたが、ダメでした。 ホルトしたみたいです。Ctrl+Cしました。 pg_ctl -D /var/lib/pgsql/data -l logfile start としてみると。 postmaster starting と表示されました。 調子に乗ってユーザーを作ろうとしたら以下の結果でした。険しい道のりです。 -bash-3.1$ createuser -P o2 Enter password for new role: Enter it again: Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) y Shall the new role be allowed to create more new roles? (y/n) y createuser: could not connect to database postgres: could not connect to server: そのようなファイルやディレクトリはありません Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

関連するQ&A

  • PostgreSQLが起動しない・・・

    はじめまして、tanu_2です。 玄箱HGをDebian化し、いろいろと遊んでいます。 PostgreSQLをapt-getでインストールし、Webアプリを動かしていたのですが、昨日より突然、PostgreSQLが動かなくなってしまいました。 原因が分からず、サーバを再起動し、 # /etc/init.d/postgresql start や $ pg_ctl start などを試してみたのですが、動きません。 念のため、初期化(initdb)も試みたのですが、これも失敗してしまいます。 /var/log/postgresql/postgres/logを覗いてみると、 FATAL: could not write lock file "/var/lib/postgres/data/postmaster.pid": No space となっており、上記ディレクトリにpostmaster.pid書き込みできないよ、と言われているっぽかったので、パーミッションを変更したりして みましたが、postgresql startにしろ、pg_ctl startにしろ、それぞれのコマンドで起動すると、強制的にパーミッションが「700」に変更されてしまうようで、結果は同じでした。 どなたか、解決策をご教示願えませんでしょうか? よろしくお願いします。m(_ _)m

  • postgrsqlを別のディレクトリに初期化したい

    postgrsqlを別のディレクトリに初期化したい Cent osのデータベースサーバーの選択としてpostgrsqlをインストールしました。 データは /var/lib/pgsql/data にできました。 /varの空きが少なかったので、/var/lib/pgsql/dataを削除し、 ルートに/pgsqlを作成し、そこに初期化しました。 >initdb -E UTF8 -D /pgsql/data すると、/pgsql/dataに初期データが生成されましたが、 いつの間にか/var/lib/pgsql/dataにも出来ています。 [root@linuxpc ~]# ls -pl /pgsql/data 合計 108 -rw------- 1 postgres postgres 4 9月 8 15:54 PG_VERSION drwx------ 5 postgres postgres 4096 9月 8 15:54 base/ drwx------ 2 postgres postgres 4096 9月 8 15:54 global/ drwx------ 2 postgres postgres 4096 9月 8 15:54 pg_clog/ -rw------- 1 postgres postgres 3396 9月 8 15:54 pg_hba.conf -rw------- 1 postgres postgres 1460 9月 8 15:54 pg_ident.conf ・・・略・・・ -rw------- 1 postgres postgres 13793 9月 8 15:54 postgresql.conf [root@linuxpc ~]# ls -pl /var/lib/pgsql/data 合計 132 -rw------- 1 postgres postgres 4 9月 8 15:55 PG_VERSION drwx------ 5 postgres postgres 4096 9月 8 15:55 base/ drwx------ 2 postgres postgres 4096 9月 8 16:02 global/ drwx------ 2 postgres postgres 4096 9月 8 15:55 pg_clog/ -rw------- 1 postgres postgres 3182 9月 8 15:55 pg_hba.conf -rw------- 1 postgres postgres 1460 9月 8 15:55 pg_ident.conf ・・・略・・・ -rw------- 1 postgres postgres 13793 9月 8 15:55 postgresql.conf -rw------- 1 postgres postgres 57 9月 8 16:02 postmaster.opts -rw------- 1 postgres postgres 45 9月 8 16:02 postmaster.pid どちらが有効なのでしょうか? /var/lib/pgsql/data側は要らないのですが。

  • RedHat9にPostgreSQL構築できるが、再起動すると消滅

    WindowsXP内のVMWareに仮想マシンRedHat9を構築して便利に使っています。今回この中ににPostgreSQL構築しpostgresql-8.1.3.tar.gzを/usr/local/srcにダウンロード #useradd postgres #mkdir /usr/local/pgsql #mkdir /usr/local/pgsql/data #cd /usr/lcal/src #tar zxfv postgres-8.1.3.tar.gz #chown postgres.postgres /usr/locl/pgsql #chown -R postgres.postgres postgresql.1.3 #su - postgres $cd /usr/local/src/postgresql-8.1.3 $./configure $gmake $gmake install 以上で無事postgreSQLデータベースが完成 引き続きユーザpostgresで $/usr/local/pgsql/bin/initdb -D /usr/local/pogsql/data $/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data $/usr/local/pgsql/bin/createdb TestDB $/usr/local/pgsql/bin/psql TestDB で作成したTestDBに接続でき、テーブルも作りました。 ところがRedHat9をいったん再起動するとできている筈のTestDBに接続できなくなります。どこかにどこかに設定ミスがありますか。何かヒントをいただければうれしいです。 $/usr/local/

  • RedHat ES4でPostgreSQLを自動起動したい

    RedHatにPostgreSQL8.2.3をインストールしました。 インストール自体は他のディストリビューションでも何回も行っているので 特に問題なく終了しました。しかし自動起動がうまくいきません。 /etc/init.d/postgresqlを以下の内容で作成しました。 ----- ここから ----- #!/bin/sh # chkconfig: - 87 13 # description: PostgreSQL8.2 # processname: postmaster # pidfile: /var/run/postgresql.pid pidfile=/var/run/postgresql.pid . /etc/init.d/functions case "$1" in start) su - postgres -c "pg_ctl start" touch $pidfile ;; stop) su - postgres -c "pg_ctl stop -m fast" rm -f $pidfile ;; restart) su - postgres -c "pg_ctl stop -m fast" su - postgres -c "pg_ctl start" ;; *) echo "Usage: /etc/rc.d/init.d/postgresql {start|stop}" esac exit 0 ----- ここまで ----- このスクリプト自体はrootにて # /etc/init.d/postgresql start できちんとDBが起動する事は確認しています。これを以下のようにして 自動起動の設定を行いました。 # chmod 755 /etc/init.d/postgresql # chkconfig --add postgresql # chkconfig --level 35 postgresql on # chkconfig --level 06 postgresql off 問題はここからで、この状態で再起動を行うと、起動時にpostgresqlを 実行するところでとまってしまうのです。pidファイルなどゴミが無い事は 確認済みなのですが・・・その状態でもネットワークログインは出来るので プロセスを確認すると以下のようなプロセスが残った状態でとまっていました。 root 2765 0.0 0.0 5920 760 ? S 00:47 0:00 initlog -q -c /etc/rc5.d/S87postgresql start root 2766 0.0 0.0 6916 1336 ? S 00:47 0:00 /bin/sh /etc/rc5.d/S87postgresql start root 2769 0.0 0.0 6124 1276 ? S 00:47 0:00 su - postgres -c pg_ctl start この状態で # kill 2765 2766 2769 とすると起動がまた再開されるので、PostgreSQLの起動時にとまっている事は 明らかです。 いったい何が原因なのか、さっぱりわかりません。 どなたかヒントだけでもいただけたら幸いです。 よろしくお願いします。

  • PostgreSqlインストールで

    Linux環境にPostgreSqlをインストールしたいのですが以下のエラーがでて困ってます; 手順としては 1, ./configure 2, gmake 3, su 4, gmake install 5, mkdir /usr/local/pgsql/data 6, chown postgres /usr/local/pgsql/data 7, su - postgres 8, /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data 9, /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 & 10, /usr/local/pgsql/bin/createdb test 11, /usr/local/pgsql/bin/psql test まず手順8で以下のエラーが出ます database "postgres" does not exist その後、手順9を実行すると以下のエラーがでます createdb: could not connect to database template1: could not connect to server: そのようなファイルやディレクトリはありません Is the server runnning locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? 解決策等ご存知でしたら教えて頂けないでしょうか? よろしくお願い致します。

  • 続 PostgreSQLのインストール

    fedora core1です。 postgreSQLで 一般ユーザーでログイン後 vi .bashrcで エディターを起動し export PATH=$PATH;/usr/local/pgsql/bin export MANPATH=$MANPATH:/usr/local/pgsql/man export POSTGRES_HOME=/usr/local/pgsql export PGLIB=$POSTGRES_HOME/lib 追加編集後 :wqで終了すると E45: 'readonly' オプションが設定されています (! を追加で上書き) :wq!で ".bashrc" ".bashrc" E212: 書込み用にファイルを開けません というエラーがでました。 これはどう対処したらよいでしょうか?

  • PostgreSQLの自動起動

    皆さん、こんにちは。 Fedora Core 4にPostgreSQLを入れて、自動起動させようとしています。 /etc/rc.localにpostmaster -Sと書いたのですが、自動起動しません。 パスが通っていないのかとフルパスで指定してもうまく行きません。 postgresユーザでこれを実行するとうまくいきます。 /etc/rc.localに指定すれば、OS起動時に書いてあるものは何でも 動くのではないのでしょうか? どうすればPostgreSQLが自動起動するのでしょうか?

  • PostgreSQLはインストールされている?

    $ /usr/local/pgsql/bin/postmaster -D PGDATA を実行すると、 database system is ready と表示されますが、 # rpm -qa|grep postgres を実行すると、何も表示されません。PostgreSQL7.2.3はインストールされているといえるのでしょうか?

  • postgreSQLのinitdb

    postgreSQL7.2.3のインストールを行いました。 % tar vxfz postgresql-7.2.3.tar.gz % cd postgresql-7.2.3 % ./configure --enable-locale --enable-multibyte=EUC_JP |& tee Configure.out % make | & tee Make.out % su # tcsh % make install | &tee Make_install.out % chown -R postgres:postgres /usr/local/pgsql ここまでは何も問題なく終わったのですが、 次に initdb を実行したところ以下エラーが出ます。 % su postgres % /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data ld.so.1: /usr/local/pgsql/bin/pg_encoding: 重大なエラー: libgcc_s.so.1: open に 失敗しました: ファイルもディレクトリもありません。 initdb: pg_encoding failed Perhaps you did not configure PostgreSQL for multibyte support or the program was not successfully installed. ↑ここまで 「マルチバイトサポートしていません」 「インストールに失敗しています」というような内容なのですが、 何がダメだったのでしょうか? ちなみにOSは Solaris9/02です。

  • PostgreSQLをCentOS5にインストールしました。

    閲覧有難うございます。 質問内容なのですが、Postgresqlをインストールしたのですがpostgresql.confとpg_hba.confが見つかりません。 OSはCentOS5です。 インストール方法は以下の手順で行いました。 # /usr/sbin/adduser postgres # chown postgres:postgres /usr/local/pgsql # mkdir /usr/local/src/postgres-8.2.6 # chown postgres:postgres /usr/local/src/postgresql-8.3.7 # su - postgres # cd /usr/local/src # tar xfz /usr/local/src/postgres-8.2.6.tar.gz # cd /usr/local/src/postgres-8.2.6 # ./configure # make # make install また、 [root@ ~]# su - postgres -bash:  LD_LIBRARY_PATH=/usr/local/pgsql/lib: そのようなファイルやディレクトリはありません -bash:  export: command not found -bash:  PATH=/usr/local/pgsql/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin: そのようなファイルやディレクトリはありません -bash:  export: command not found -bash:  MANPATH=/usr/local/pgsql/man:: そのようなファイルやディレクトリはありません -bash:  export: command not found -bash:  export: command not found -bash:  PATH=/usr/local/pgsql/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin: そのようなファイルやディレクトリはありません -bash:  export: command not found -bash:  MANPATH=/usr/local/pgsql/man:: そのようなファイルやディレクトリはありません -bash:  export: command not found [postgres@ ~]$ のようなエラーがはかれるようになりました。 どうか皆様のお力をお貸しください。