Javascript 是否有其他选项可以在ec2实例上运行多节点应用程序
我在一个文件夹中的节点js中有3个文件/应用程序Javascript 是否有其他选项可以在ec2实例上运行多节点应用程序,javascript,node.js,amazon-web-services,amazon-ec2,Javascript,Node.js,Amazon Web Services,Amazon Ec2,我在一个文件夹中的节点js中有3个文件/应用程序 mis1.js running on port 3000 mis2.js running on port 3002 mis3.js running on port 3003 但当我在ec2实例上运行它时,它会显示 ubuntu@ip-172-31-7-220:~/microservice$ node mis2.js Server running at http://localhost:3002/ 但在浏览器上,我只能访问3000的应用程序
mis1.js running on port 3000
mis2.js running on port 3002
mis3.js running on port 3003
但当我在ec2实例上运行它时,它会显示
ubuntu@ip-172-31-7-220:~/microservice$ node mis2.js
Server running at http://localhost:3002/
但在浏览器上,我只能访问3000的应用程序
在我的安全组中,我允许所有端口3000-3010
sudopm2
示例sudopm2mis1.js
运行这三个应用程序。当您使用cmd/ctrl C时,它会终止应用程序您需要修复侦听地址。“运行在”意味着它不暴露在外部。您需要将侦听地址从“localhost”更改为“0.0.0.0”,以侦听所有网络接口。