Aws opsworks multiple nodejs applications?

I have one OpsWorks Nodejs Stack. I am setting up several nodejs applications. Now the problem is that all nodejs server.js scripts are listening on port 80 to check Amazon life, but only one can use a port. I do not know how to solve this. I read the amazon documentation but could not find a solution. I read that I can try to change the spread of the recipe variables to set this life check to a different port, but this did not work. Any help?

+4
source share
2 answers

I struggled with this problem for a while and eventually found a very simple solution.


...

https://github.com/aws/opsworks-cookbooks/blob/release-chef-11.10/deploy/attributes/deploy.rb

...

default[:deploy][application][:nodejs][:port] = deploy[:ssl_support] ? 443 : 80

json , :

{
  "deploy" : {
    "app_name_1": {
      "nodejs": {
        "port": 80
      }
    },
    "app_name_2": {
      "nodejs": {
        "port": 3000
      }
    }
  },
  "mongodb" : {
    ...
  }
}

monitrc /etc/monit.d/node_web_app-.monitrc , monit !

+5

, node, 80. , , . .

0

Source: https://habr.com/ru/post/1568546/


All Articles