postgres,ubuntu如何在启动时重新启动服务?实例重新启动后陷入群集 [英] postgres, ubuntu how to restart service on startup? get stuck on clustering after instance reboot

查看:126
本文介绍了postgres,ubuntu如何在启动时重新启动服务?实例重新启动后陷入群集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Postgres db 9.1 AWS EC2 上运行,而 ubuntu 12.04



我对实例感到很困惑(即在我选择9.1之前安装了所有类型的postgres XX)。



现在在该数据库上工作一个月后,我发现如果重新启动实例 postgres 无法正确加载,其状态显示为正在运行的群集。这将一直持续到我

  sudo服务postgresql重新启动

从终端,然后再次运行。



如何将这行添加到ubuntu启动中,以便每个



还有其他可能解决此问题的解决方案。

/etc/rc.local 中,该行在初始化阶段的最后一个执行。


I have a Postgres db 9.1 running on AWS EC2, with ubuntu 12.04.

I messed a lot with the instance (i.e installed all kinds of postgres X.X before i settled on 9.1).

Now after a month working on that db, I discovered that if I restart my instance postgres doesn't load correctly, its status says "Running clusters". this will last forever until I

sudo service postgresql restart

from terminal, and then it works again.

How do I add this line, to ubuntu startup so that each time it loads, it will restart this service, and hopefully solve my problem?

Also any other solution which might solve this.

解决方案

I guess it would be best to fix the database startup script itself. But as a work around, you can add that line to /etc/rc.local, which is executed about last in init phase.

这篇关于postgres,ubuntu如何在启动时重新启动服务?实例重新启动后陷入群集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆