Amazon beanstalk tcp application not responding

I am running the nodejs tcp application on my aws linux ec2 instance. base code is given below

var net = require('net');
net.createServer(function(socket){
socket.write('hello\n');

socket.on('data', function(data){
    socket.write(data.toString().toUpperCase())
  });
}).listen(8080);

and run it like a charm, but I wanted to run the same application in aws beanstalk (only to get the advantage of automatic scaling). ya ya i'm not aws ninja. by the way, to get a public ip in beanstalk, I use aws VPC.

  • The beanstalk application will connect to VPC = checked.
  • VPC port 8080 open = verified.
  • change the port with hard code 8080 to process.env.PORT = checked.

but if I ping anything on port 8080, it does not return “hi” from the application. What am I missing?

+4
1

HTTP. ElasticBeanstalk (ELB), HTTP. , ELB, ELB HTTP.

.. ElasticBeanstalk , , . CloudFormation API, , , .

, .

ElasticBeanstalk nodejs Nginx EC2, TCP, . , ELB . Nginx, , , , nodejs.

ELB :

Standard ELB configuration for Beanstalk application for nodejs

ELB, TCP . - EC2 Load Balancers Beanstalk, :

TCP configuration for nodejs Beanstalk App

:

enter image description here

, , EC2 . , , , VPC NACL .

+3

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


All Articles