How to stop a heroku server?

 ̄綄美尐妖づ 提交于 2021-02-07 03:20:29

问题


I have a staging server hosted on heroku, I just want to bring it down, but not destroy the app. How can I do it? Do I have any command like 'heroku stop' like 'heroku restart' for restarting?

OR

Is there a way to automate the server to turn off itself when it exceeds the 750 hr free usage?

Actually I don't want the server so I am trying to stop it, or leave it for the free hours.


回答1:


You can scale individual non-web processes down to zero quite happily:

$ heroku ps:scale worker=0
$ heroku ps:scale resque=0
etc...

and web to 1:

$ heroku ps:scale web=1

As Mischa says, you get one free dyno running, so leave your 1 web dyno running (I'm not sure you can stop the last web process)




回答2:


You can put it under maintenance, which stops it but doesn't delete it:

heroku maintenance:on

More info: https://devcenter.heroku.com/articles/maintenance-mode




回答3:


Login to the account, and click on the resource and then bring down the dyno count to 0 and the save. Now you can check by trying to open the site. It will be down.




回答4:


Easily disable/enable the App by going to your Heroku dashboard ==> resource tab the rest is on the picture below:



来源:https://stackoverflow.com/questions/9156498/how-to-stop-a-heroku-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!