求助, postgres9.5无法启动

qq_34532107 2018-11-09 04:10:18
-- 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
...全文
249 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Aubrey_AI 2018-12-06
  • 打赏
  • 举报
回复
-- 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=/data/pgdata/ OOMScoreAdjust=-1000 Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj Environment=PG_OOM_ADJUST_VALUE=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启动服务,注意将文档中的参数改成本机环境
丁劲犇 2018-11-22
  • 打赏
  • 举报
回复
这个数据库的权限设置比较严格。要用他自己的账号启动在windows上如果是绿色版的目录,还要注意给完全访问的权限才可以。
Aubrey_AI 2018-11-16
  • 打赏
  • 举报
回复
启动需要切到postgres用户下,看起来你是在root下启动的!
还有postgres.conf文件配置也检查下

952

社区成员

发帖
与我相关
我的任务
社区描述
PostgreSQL相关内容讨论
sql数据库数据库架构 技术论坛(原bbs)
社区管理员
  • PostgreSQL社区
  • yang_z_1
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧