我使用經典命令安裝了 postgresql 10:
brew 安裝 postgresql@10
然后我啟動了服務:
brew 服務啟動 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 使用的默認埠)的服務。
uj5u.com熱心網友回復:
我分享了進一步調查的程序,也許可以解決問題。
- 檢查檔案
/opt/homebrew/opt/postgresql@10/[email protected]。該路徑由brew services命令給出。 - 打開檔案,查看日志寫在哪里。就我而言:
<key>StandardErrorPath</key> <string>/opt/homebrew/var/log/postgresql@10.log</string>
- 看看日志。我的情況是我看到有一個檔案被鎖定,可能是由沒有釋放鎖定的 postgresql 的前一個實體鎖定的。重啟我的 Mac 解決了這個問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/317139.html
標籤:PostgreSQL 苹果系统 自制
