如何通过ssh控制台重新启动PostgreSQL?
当我在SO上搜索此东西时,我只会发现:postgres,ubuntu如何在启动时重新启动服务?实例重新启动后陷入群集
小智 9
systemctl restart postgresql@<postgres_version>-<cluster_name>.service
Run Code Online (Sandbox Code Playgroud)
默认情况下 cluster_name = 'main',运行此命令以列出您拥有的所有集群:
ls /var/lib/postgresql/
Run Code Online (Sandbox Code Playgroud)
如果您想知道 postgresql 是否正在运行,请尝试以下命令:
systemctl status postgresql@<postgres_version>-<cluster_version>.service
Run Code Online (Sandbox Code Playgroud)
我的 postgresql 服务名为 postgresql-9.5;如果你得到"postgresql: unrecognized service"你可以找到它的名字
sudo service --status-all | grep postgresql
Run Code Online (Sandbox Code Playgroud)
然后按照接受的答案继续。
| 归档时间: |
|
| 查看次数: |
9292 次 |
| 最近记录: |