簡體   English   中英

'service postgresql start' 無法在 Fedora 上啟動 postgres 服務

[英]'service postgresql start' fails to start postgres service on Fedora

這里是 postgres 的新手!

我按照此處所述編輯了 pg_hba.conf,但是當我嘗試重新啟動 postgresql 服務時,嘗試失敗了。 下面是命令行 output,其中包含我可以收集到的所有信息。

[root@arunpc modules]# service postgresql restart
Redirecting to /bin/systemctl  restart postgresql.service
Job failed. See system logs and 'systemctl status' for details.
[root@arunpc modules]# systemctl status postgresql.service
postgresql.service - PostgreSQL database server
      Loaded: loaded (/lib/systemd/system/postgresql.service; enabled)
      Active: failed since Sun, 08 Apr 2012 21:29:06 +0530; 14s ago
     Process: 12228 ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast (code=exited, status=0/SUCCESS)
     Process: 12677 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE)
     Process: 12672 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
    Main PID: 12184 (code=exited, status=0/SUCCESS)
      CGroup: name=systemd:/system/postgresql.service
[root@arunpc modules]# tail /var/log/messages
....
Apr  8 21:29:06 arunpc systemd[1]: postgresql.service: control process exited, code=exited status=1
Apr  8 21:29:06 arunpc systemd[1]: Unit postgresql.service entered failed state.
Apr  8 21:29:06 arunpc pg_ctl[12677]: pg_ctl: could not start server
Apr  8 21:29:06 arunpc pg_ctl[12677]: Examine the log output.

FWIW,這是使用的配置文件(pg_hba.conf):

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             postgres                                ident sameuser
local   all             all                                     ident sameuser
# IPv4 local connections:
host    all             all             127.0.0.1               password
# IPv6 local connections:
host    all             all             ::1                     password

這里可能是什么錯誤? 在我進行編輯之前它曾經工作得很好(因為這是一台開發機器,我很出色地沒有做任何備份)。

我還想獲得更詳細的日志 output。/var/log/messages 文件中的日志消息確實要求我“檢查日志輸出”——這是哪個日志 output? 我還可以采取哪些其他故障排除步驟?

提前謝謝了!

根據您的啟動腳本,它可能會將 postmaster 的 output 重定向到一個文件。 這通常是 PGDATA 目錄中的 server.log。 我會嘗試的事情:

  • 注釋掉 pg_hba.conf 中的所有內容並重試。 如果問題是該文件中的語法錯誤,那么注釋掉有問題的行將允許服務器啟動,然后您將能夠一次取消注釋一個,直到找到錯誤。

  • 直接從shell啟動postmaster,不送后台。 只需運行postmaster -D <pgdata dir>它應該會輸出一些更有用的日志。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM