我一直在服务器上玩Dokku并使用它来部署MEAN应用程序。我真的很喜欢它,但我担心的是,在服务器重启(或崩溃)后,Dokku不会重启Mongo服务。我必须手动进入dokku mongodb:start
然后dokku MYAPP deploy
才能重新连接。否则我会遇到错误的网关错误。
感谢您的任何提示!我对这一切都很陌生。
答案 0 :(得分:1)
这是a bug in the dokku-mongodb plugin. Dokku本身使用Upstart脚本启动时启动。它已安装到/etc/init/dokku-redeploy.conf
,如下所示:
description "Dokku app redeploy service"
start on filesystem and started docker
script
sleep 2 # give docker some time
sudo -i -u dokku /usr/local/bin/dokku ps:restartall
end script
我建议使用类似的东西,或许:
description "Dokku MongoDB plugin redeploy service"
start on started dokku-redeploy
stop on runlevel [!12345]
setuid dokku
setgid dokku
exec /usr/local/bin/dokku mongodb:start
pre-stop exec /usr/local/bin/dokku mongodb:stop