• 締切済み

『psql: could not connect to server: そのようなファイルやディレクトリはありません』について

Sun Linux/PostgreSQL7.2を使用しWebサイトを開発中です。環境自体はとっても初心者です。 接続しようとしてTelnetから[psql db名]を入力すると下記エラーメッセージが帰ります。 開発中にエラーが発生しないので原因(きっかけ)すらわかりません。 psql: could not connect to server: そのようなファイルやディレクトリはありません Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? そこで、PostgreSQLの状況を見ようとして下記コマンドを入力すると、。 [root /root]# /etc/rc.d/init.d/postgresql restart PostgreSQL ・蒔・折掛 蔀河詳 ERROR! PostgreSQL ・少嘆 蔀河詳 [] [root /root]# /etc/rc.d/init.d/postgresql status postmaster is stopped [root /root]# /etc/rc.d/init.d/postgresql stop PostgreSQL ・蒔・折掛 蔀河詳 ERROR! [root /root]# /etc/rc.d/init.d/postgresql start PostgreSQL ・少嘆 蔀河詳 [] [root /root]# /etc/rc.d/init.d/postgresql status postmaster is stopped [root /root]# /etc/rc.d/init.d/postgresql stop PostgreSQL ・蒔・折掛 蔀河詳 ERROR! 停止しているのは解るのですが、起動できないようです。 やむを得ず、サーバー自体を再起動している状況です。 原因、対処法などご教授頂けませんか?よろしくお願い致します。

みんなの回答

  • anmochi
  • ベストアンサー率65% (1332/2045)
回答No.1

いや~これだけの情報ではなんとも・・・・。 Postgresルート(例えばRedhatのRPMのものなら/var/lib/pgsql/data/)を調べて、postgresql.confなどの中身を見てみるしかないのではないかな。 後、文字化けは解消しとこうよ。Xを起動してktermなどで表示させるか、Xが使えないならKonを使うか、Konもだめなら # export LANG=en_US と打って、コンソールを英語モードにしてから操作すると、大抵のコマンドは英語でメッセージを出すようになるので、英語を一生懸命読むようにしよう。

dead_man_walking
質問者

お礼

ご記入ありがとうございました。

関連するQ&A

  • PostgreSQLに接続できなくなる

    以下の環境で、PostgreSQLを使用しています。 -------------------- Cobalt Raq3 PostgreSQL 6.5.2 -------------------- CSEからPostgreSQLに接続して作業していますが、 PostgreSQL起動後約10分で、接続できなくなってしまいます。 そのときのエラー内容は、 「postmaster が -iオプション付きで起動していますか?」 というものです。 SSH で /etc/rc.d/init.d/postgresql restart と打つと接続できるようになりますが、 約10分たつとまたできなくなります。 このような現象の原因として考えられることは何でしょうか? ご存知の方いらっしゃいましたら、ヒントをください。 よろしくお願いします。

  • 【SuSE】PostgreSQLの自動起動が出来ない

    見ていただいてありがとうございます! SuSE LinuxでpostgreSQLの自動起動が設定できず 困っております。 ヒントでもかまいませんので、 ご教授いただきたく思っております。 postgreSQLのインストールはソースから行いました。 ログイン後なら、以下のコマンドを実行することで 起動することは可能な状態です。 #su - postgres #/usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data> logfile 2>&1 & ■自動起動させるために行ったこと 1.自動起動スクリプトファイル "/usr/local/src/postgresql-8.3.3/cntrib/start-script/linux" をディレクトリ"/etc/init.d/"にコピーしました。 2.自動起動スクリプトファイルを 「postgresql」にリネームし、 全員に実行権限を付与しました。 3."/etc/init.d/rc*.d"に以下の名前で シンボリックリンクを作成しました。  ・rc0.d、rc1.d、rc2.dに「K02postgresql」  ・rc3.d、rc5.dに「S98postgresql」 現在、上記の操作をした状態となっておりますが、 rootでログインしてコマンド #pr -e を実行しても 「postmaster」の行があらわれません。 ちなみに、コマンド #chkconfig -list を実行すると postgresqlの行の 3 と 5 がONになっています。 現在Linuxのことを勉強中ですので、 質問に情報不足などあるかもしれません。 ご指摘いただければ、至急追加情報を提示いたします。 よろしくお願いいたします!

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

  • DNSサーバーの構築「no servers could be reached」

    FEDORA3でDNSサーバー構築後にnslookupを行いましたが次のメッセージが表示されて動作しません。 「;;connection timed out; no servers could be reached」 半日ばかり問題を検討していますが解決できません(T_T)。 アドバイスをお願いします。 ◆環境◆ OS:FEDORA3 実際のインターネット環境で利用するためではなく自宅内練習のためドメイン名は任意で設定しています。 <BIND設定ファイル> zone "ABC.com" { type master; file "ABC.com"; }; zone "8.30.168.192.in-addr.arpa" type master; file "ABC.com.rev"; }; <ゾーンファイル> @ IN SOA NEKO.ABC.com. postmaster.ABC.com. ( IN NS NEKO.ABC.com NEKO IN A 192.168.30.9 INU IN A 192.168.30.10 ns IN CNAME NEKO <リゾルバ> search ABC.com nameserver 192.168.30.9 nameserver 127.0.0.1 「/etc/rc.d/init.d/named start」では「OK」が表示されるが「/etc/rc.d/init.d/named stop」では「OK」が表示されない。 「/etc/rc.d/init.d/named start」で起動後も「netstat -ln」でポート番号「53」が表示されない。 読みにくい長い文を読んで頂いてありがとうございます。 自分での解決が難しそうなので是非アドバイスをお願いします(T_T)!

  • PostgreSQLの自動起動

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

  • CentOS初期設定chkconfig認識不可。

    いつも教えて頂きありがとうございます。 標記の件。 http://centos.server-manual.com/centos5_setup.html に沿って初期設定を行っています。 説明では下記です。 [root@centos ~]# /etc/rc.d/init.d/yum-updatesd stop [root@centos ~]# chkconfig yum-updatesd off [root@centos ~]# yum -y update [root@centos ~]# yum -y install yum-cron [root@centos ~]# /etc/rc.d/init.d/yum-cron start [root@centos ~]# chkconfig yum-cron on [root@centos ~]# chkconfig --list yum-cron ところが実行すると [root@localhost kouzou]# /etc/rc.d/init.d/yum-updatesd stop yum-updates を停止中: [ OK ] [root@localhost kouzou]# chkconfig yum-updatesd off bash: chkconfig: command not found また他の # chkconfig yum-cron on # chkconfig --list yum-cron に関してもbash: chkconfig: command not found が出ます。 これでは前に進めません。 どなたかアドバイスの程、宜しくお願い申し上げます。

  • PostgreSQLのpsqlでユーザの扱いがうまくいかない

    こんにちは ただいま、PostgreSQL7.2.3をインストール(Redhat7.3)し、これからpsqlを使い、SQL操作をしようとしていたところですが、psqlと入力すると "psql: FATAL 1: Database "postgres" does not exist in the system catalog."となります。 PostgreSQLのユーザは "postgres","nobody"です。 現在、postgresからpostmaster -Sで起動しています. 下記に端末で行った作業内容をコピーしてみました。 今回インストールの参考にした書籍は"PHPxPostgreSQLで作る最強Webシステム」石井達夫著です。この本の手順に従ったつもりですが、うまくいきません。 [postgres@www root]$ postmaster -S [postgres@www root]$ psql -l List of databases Name | Owner | Encoding -----------+----------+---------- php | postgres | EUC_JP template0 | postgres | EUC_JP template1 | postgres | EUC_JP (3 rows) [postgres@www root]$ select dtname from php bash: syntax error near unexpected token `from' [postgres@www root]$ select dtname from template0 bash: syntax error near unexpected token `from' [postgres@www root]$ [postgres@www root]$ psql select dtname from php psql: warning: extra option from ignored psql: warning: extra option php ignored psql: FATAL 1: Database "select" does not exist in the system catalog. [postgres@www root]$ psql -l List of databases Name | Owner | Encoding -----------+----------+---------- php | postgres | EUC_JP template0 | postgres | EUC_JP template1 | postgres | EUC_JP (3 rows) [postgres@www root]$ psql psql: FATAL 1: Database "postgres" does not exist in the system catalog.

  • RaspberryPiで自動起動(VNCを立上げ)

    定番のVNCの自動ブートをしたいのですが、 /etc/init.d/にvncbootというのを作って、最後に以下をターミナルから書き込むと: update-rc.d /etc/init.d/vncboot defaults ↓ update-rc.d: error: initscript does not exist: /etc/init.d//etc/init.d/vncboot というエラーが出てきます。 定番の手順どおりやっているハズですが、全く理解できません。。 参考→ http://deviceplus.jp/hobby/raspberrypi_entry_027/ 同じような質問→ https://discuss.howtogeek.com/t/how-to-automate-your-always-on-raspberry-pi-download-box/972/12

  • iptablesの無効設定

    CentOS6.2を使用しています。 iptablesを無効にする為、以下の作業を行いましたが マシンを再起動すると動作しているようです。 何か足りない設定コマンドがありますでしょうか? #service iptables stop #chkconfig iptables off #/etc/rc.d/init.d/iptables stop 再起動後ステータスを確認すると以下の表示されてしまいます。 [root@マシン名 ~]# service iptables status テーブル: filter Chain INPUT (policy ACCEPT) num target prot opt source destination Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination 因みに 以下のようにsuコマンドで切り替えたり、rc.dの下の/init.d/iptables stopではなく、 #etc/init.d/iptables stopもしてみました。 [root@マシン名 ~]#su - [root@マシン名 ~]#/etc/init.d/iptables stop 宜しくお願い致します。

  • rootでもファイルを削除できない

    RedHat Linux 7.2です。 クラッカーに入られました。 /etc/rc.d/rc.local に killall -9 rpc.statd lpd と書き込まれていて、再起動できない状態になっています。 rc.localをrmコマンドで削除しようとしたら “許可されていない操作です"というエラーがでて削除できません。 viでの修正もmvもだめです。 -rwxr-xr-x 1 root root 25 Jun 30 17:22 /etc/rc.d/rc.local になっているのですが、rootで操作しているのに削除できないってどういう事でしょうか?