-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A new session with the ID 19601 has been created for the user root.
--
-- The leading process of the session is 30336.
Nov 09 16:08:26 iZwz9bb08phycz6015t7reZ systemd[1]: Started Session 19601 of user root.
-- Subject: Unit session-19601.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-19601.scope has finished starting up.
--
-- The start-up result is done.
Nov 09 16:08:26 iZwz9bb08phycz6015t7reZ systemd[1]: Starting Session 19601 of user root.
-- Subject: Unit session-19601.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-19601.scope has begun starting up.
Nov 09 16:08:26 iZwz9bb08phycz6015t7reZ sshd[30336]: pam_unix(sshd:session): session opened for user root by (uid=0)
Nov 09 16:08:31 iZwz9bb08phycz6015t7reZ polkitd[501]: Registered Authentication Agent for unix-process:30355:994346995 (system bus name :1.39250 [/usr/bin/pkttyagent --notify-fd 5 --fa
Nov 09 16:08:31 iZwz9bb08phycz6015t7reZ systemd[1]: Starting PostgreSQL 9.5 database server...
-- Subject: Unit postgresql-9.5.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-9.5.service has begun starting up.
Nov 09 16:08:31 iZwz9bb08phycz6015t7reZ pg_ctl[30367]: < 2018-11-09 16:08:31.343 CST >FATAL: could not create lock file "postmaster.pid": Permission denied
Nov 09 16:08:32 iZwz9bb08phycz6015t7reZ pg_ctl[30367]: pg_ctl: could not start server
Nov 09 16:08:32 iZwz9bb08phycz6015t7reZ pg_ctl[30367]: Examine the log output.
Nov 09 16:08:32 iZwz9bb08phycz6015t7reZ systemd[1]: postgresql-9.5.service: control process exited, code=exited status=1
Nov 09 16:08:32 iZwz9bb08phycz6015t7reZ systemd[1]: Failed to start PostgreSQL 9.5 database server.
-- Subject: Unit postgresql-9.5.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-9.5.service has failed.
--
-- The result is failed.
Nov 09 16:08:32 iZwz9bb08phycz6015t7reZ systemd[1]: Unit postgresql-9.5.service entered failed state.
Nov 09 16:08:32 iZwz9bb08phycz6015t7reZ systemd[1]: postgresql-9.5.service failed.
Nov 09 16:08:32 iZwz9bb08phycz6015t7reZ polkitd[501]: Unregistered Authentication Agent for unix-process:30355:994346995 (system bus name :1.39250, object path /org/freedesktop/PolicyK
uj5u.com熱心網友回復:
啟動需要切到postgres用戶下,看起來你是在root下啟動的!還有postgres.conf檔案配置也檢查下
uj5u.com熱心網友回復:
這個資料庫的權限設定比較嚴格。要用他自己的賬號啟動在windows上如果是綠色版的目錄,還要注意給完全訪問的權限才可以。uj5u.com熱心網友回復:
-- A new session with the ID 19601 has been created for the user root.這就是錯誤的地方,pg如果沒有進行配置,root啟動是會報錯的。如果要通過root用systemctl啟動,配置如下檔案:
vim /usr/lib/systemd/system/postgresql-11.service
[Unit]
Description=PostgreSQL 11 database server
Documentation=https://www.postgresql.org/docs/11/static/
After=syslog.target
After=network.target
[Service]
Type=notify
User=postgres
Group=postgres
Environment=PGDATA=https://bbs.csdn.net/data/pgdata/
OOMScoreAdjust=-1000
Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj
Environment=PG_OOM_ADJUST_VALUE=https://bbs.csdn.net/topics/0
ExecStart=/home/postgres/pgsql-11/bin/postmaster -D ${PGDATA}
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
KillSignal=SIGINT
TimeoutSec=0
[Install]
WantedBy=multi-user.target
然后就可以通過systemctl start postgresql-11.service啟動服務,注意將檔案中的引數改成本機環境
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/76713.html
標籤:PostgreSQL
