• ベストアンサー

PostgreSQLが起動しない・・・

choconamacreamの回答

  • ベストアンサー
回答No.3

それ以外にも、以下のようなコマンドを使ってデータベースサーバプログラムの起動が出来ますよね。 postmaster -D /usr/local/pgsql/data ただ、以下のURLのドキュメント内には、次のような記述があります。 「何を実行するにしても、サーバはPostgreSQLユーザアカウントで起動させなければなりません。 rootであってはいけませんし、他のユーザでもいけません。」 パッケージによるインストールであれば、自動でpostgresユーザが作られているはずだと思うけど。(Debianは使ったことないので、確証はなし。) su - postgres 上記のコマンドでログインするなり、パスワードを忘れたのならroot権限にてpasswdコマンドから変更するなりした後、もう一度postmasterを起動してみよう! ちなみに、パーミッション関係のエラーは、「Permission denied」ですよね。

参考URL:
http://www.postgresql.jp/document/pg803doc/html/postmaster-start.html

関連するQ&A

  • 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の起動時にとまっている事は 明らかです。 いったい何が原因なのか、さっぱりわかりません。 どなたかヒントだけでもいただけたら幸いです。 よろしくお願いします。

  • 起動時エラー

    RedHat9にPosgreSQL 7.3をインストールしたんですが、DB起動時にエラーが出てます。 DB起動コマンドは、 pg_ctl start -D /usr/local/pgsql/data -l /home/postgres/logfile postmaster successfully started DB停止コマンドは、 pg_ctl stop -D /usr/local/pgsql/data メッセージは、 pg_ctl: cannotfind /usr/local/pgsql/data/postmaster.pid Is postmaster running? postmastar.pidファイルを探しましたが、確かにありません。 そして、logfileは以下です。 LOG: startup process (pid 14202) was terminated by signal 6 LOG: aborting startup due to startup process failure 一度は起動停止確認は出来たのですか、2回目からできなくなってしまい、大変困っています。 ポート番号はデフォルトの5432のままです。 どうしたらいいのかわかりません。 よろしくお願いいたします。

  • postmasterについて

    VineLInux+PostgreSQL7.1.1で動かそうとしています。 ところが、インストール、initdbまでは出来たのですが、 psql等のコマンドを実行すると、以下のように [post@togane bin]$ ./psql -l psql: connectDBStart() -- connect() failed: 接続を拒否されました Is the postmaster running locally and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'? と、表示されます。 postgres.confでportをデフォルト以外で15432と設定しています。 他にもpostmasterが動いているかを確認するために pg_ctlコマンドを実行したのですが、 [post@togane bin]$ ./pg_ctl -w start pg_ctl: Another postmaster may be running. Trying to start postmaster anyway. pg_ctl: cannot start postmaster Examine the log output. と、エラーが出てしまいます。 今、私が参考にしている本は 石井達夫著 PostgreSQL完全後略ガイド 技術評論社 です。この本にある通り進めていったつもりなのですが うまく動かないので困っています。 どなたか御指導の程宜しくお願いします。

  • Cygwin上のPostgreSQLで pg_ctl start するとエラーになります。

    こんにちは。マルチポストですが、お許しください。超急ぎです。 Cygwinで動いているpostgresqlで、書籍の指示どうり、「pg_ctl start」とするとエラーになります。以下がCygwinコンソール上のないようです。 Administrator@windows2000 ~ $ pg_ctl start pg_ctl: Another postmaster may be running. Trying to start postmaster anyway. FATAL: File /usr/local/pgsql/data/PG_VERSION is missing. This is not a valid da ta directory. pg_ctl: cannot start postmaster Examine the log output. 誰か分かる人がいたら教えてください。よろしくおねがいします。

  • PostgreSQLをサーバ起動時にstartさせたい

    PostgreSQLをサーバ起動時にstartさせたいと思っています。 /etc/rc.d/rc.localに下記を追記しましたが、起動してくれません。ログファイルも作成されていませんでした。 echo -n "Starting PostgreSQL: " su -l pgsql -s /bin/sh -c "/usr/local/pgsql/bin/pg_ctl -l /var/log/postgresql.log start > /dev/null 2>&1" < /dev/null echo "done." 何が悪いのでしょうか?PostgreSQLは手動でstartすることはできます。 また、PostgreSQLの起動スクリプトを作成し、webminで制御したいと思うのですが、PostgreSQLの起動スクリプトの書き方について参考になるHPがあれば紹介していただきたいと思っています。 よろしくお願いいたします。

  • 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側は要らないのですが。

  • tcpip_socketの設定をするとpostgres起動時にエラーになる。

    開発によるテストで外部からtcp/ip接続を行いたいので、 tcpip_socket = true という項目をpostgresql.confに追加してみましたが、 postgres起動時に以下のようなエラーにり起動できません。 起動時のコマンド: pg_ctl -D /usr/local/pgsql/data start -w -o "-S -i" エラー: FATAL: unrecognized configuration parameter "tcpip_socket" postmaster (PostgreSQL) 8.1.9 何か原因分かりますでしょうか。

  • 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 は試しましたがダメでした。

  • PostgreSQLの自動起動

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

  • 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です。