【发布时间】:2021-10-23 12:12:43
【问题描述】:
我现在在 postgresql@11 上遇到了有关 brew 服务的问题。在我重新安装 (from this blog) postgresql@11 后,它立即在brew services 上给出错误。然后我运行了这个brew services restart -vvv postgresql@11 它返回了这个结果:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.postgresql@11</string>
<key>ProgramArguments</key>
<array>
<string>~/.homebrew/opt/postgresql@11/bin/postgres</string>
<string>-D</string>
<string>~/.homebrew/var/postgresql@11</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>~/.homebrew/var/log/postgresql@11.log</string>
<key>StandardOutPath</key>
<string>~/.homebrew/var/log/postgresql@11.log</string>
<key>WorkingDirectory</key>
<string>~/.homebrew</string>
</dict>
</plist>
当我检查~/.homebrew/var/log/postgresql@11.log 文件时,它是空的。我还检查了该文件的权限,但没关系(r,w)。在没有任何解释的情况下仍然出现此错误(空日志)。 2天前它还在工作,但不知何故我把它弄坏了。我还检查了 postmaster.pid 但该文件在我的机器上不存在,我这样搜索:find . -name "postmaster.pid"
另外,在我重新安装 postgresql@11 后,我的 postgresql@11 目录 (~/.homebrew/var/postgresql@11) 都是空的。
最后,在我的目录中 -> ~/.homebrew/Cellar/postgresql@11/11.13/bin 有 postmaster 文件,但它不是 postmaster.pid 文件,我不知道它是做什么用的,但是当我这样做时,ls -al 显示如下 -> postmaster -> postgres
我的机器是 m1 芯片 macos 上的 macOS Big Sur 11.5.2。希望有人能给我一个想法。
我现在意识到我的安装也有问题。
brew postinstall postgresql@11 结果 ->
Last 15 lines from ~/Library/Logs/Homebrew/postgresql@11/post_install.01.initdb:
2021-08-23 08:27:42 +0300
~/.homebrew/Cellar/postgresql@11/11.13/bin/initdb
--locale=C
-E
UTF-8
~.homebrew/var/postgresql@11
no data was returned by command ""~/.homebrew/Cellar/postgresql@11/11.13/bin/postgres" -V"
The program "postgres" is needed by initdb but was not found in the
same directory as "~/.homebrew/Cellar/postgresql@11/11.13/bin/initdb".
Check your installation.
Warning: The post-install step did not complete successfully
You can try again using:
brew postinstall postgresql@11
但是我看到的是 initdb 和 postgres 在同一个 bin 文件夹中:/
谢谢,
【问题讨论】:
标签: postgresql macos homebrew apple-m1 postgresql-11