【问题标题】:Error when start the postgres service with homebrew using Mac OS使用 Mac OS 使用 homebrew 启动 postgres 服务时出错
【发布时间】:2021-11-30 03:03:18
【问题描述】:

我使用经典命令安装了 postgresql 10:

brew install postgresql@10

然后我启动了服务:

brew services 启动 postgresql@10

输出显示:

成功启动postgresql@10(标签:homebrew.mxcl.postgresql@10)

但是当我运行这个命令时:

酿造服务

这是我得到的:

Name          Status  User         Plist
cassandra     stopped              
postgresql    stopped              
postgresql@10 error   username /opt/homebrew/opt/postgresql@10/homebrew.mxcl.postgresql@10.plist  

似乎服务运行不正常。以前我有另一个版本的 Posgresql。它再次是版本 10,但安装了提供的安装程序,但 postgresql 的网页。但是我应该删除它。

我用这个命令查看使用的端口:

lsof -nP +c 15 | grep LISTEN

我没有使用端口 5432(postgresql 使用的默认端口)的服务。

【问题讨论】:

    标签: postgresql macos homebrew


    【解决方案1】:

    我分享了进一步调查并可能解决问题的过程。

    1. 检查文件/opt/homebrew/opt/postgresql@10/homebrew.mxcl.postgresql@10.plist。此路径由brew services 命令给出。
    2. 打开文件并查看日志的写入位置。就我而言:
    <key>StandardErrorPath</key>
    <string>/opt/homebrew/var/log/postgresql@10.log</string>
    
    1. 查看日志。在我的情况下,我看到有一个文件被锁定,可能是由 postgresql 的前一个实例没有释放锁定。重新启动我的 Mac 解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-14
      • 2017-10-07
      • 1970-01-01
      • 2013-11-28
      • 2018-01-05
      • 2015-05-02
      • 2015-03-30
      • 1970-01-01
      相关资源
      最近更新 更多