how to restart node application automatically on aws elastic-beanstalk

前端 未结 6 969
后悔当初
后悔当初 2021-02-01 19:34

I have googled this question for a while but can\'t find the answer. My question is while deploying the nodejs application on aws elastic-beanstalk servers, I want the nodejs ap

6条回答
  •  独厮守ぢ
    2021-02-01 20:18

    Yes, better option to use Supervisor, however in order to have ability to restart app server with help of aws console or beanstalk cli tools you need to put own handler to Elastic beanstalk hooks in the directory: /opt/elasticbeanstalk/hooks/restartappserver/enact Hook is shell, python or ruby script that placed in mentioned directory. Put logic of the supervisord restart here and you will be able to restart it with help of management console, aws cli tools (http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/restart-app-server.html), elastic beanstalk api: (http://docs.aws.amazon.com/elasticbeanstalk/latest/APIReference/API_RestartAppServer.html)

    How to add hook, install supervisiord etc you can read here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

提交回复
热议问题