Problem to connect Event Server on AWS instance without ssh

349 views
Skip to first unread message

Victor Leung

unread,
Jan 11, 2015, 4:32:18 PM1/11/15
to predicti...@googlegroups.com
I am building a beer recommendations app using MEAN.js and PredictionIO v0.8.4. This is working on localhost and communicate via Raw HTTP JSON data. I have deployed the MEAN.js on Azure server and launched PredictionIO with 1-click on AWS EC2. I have a question in regards to serve global traffic for the Event Server. According to the documentations, I start the event server by running: 

pio eventserver --ip 0.0.0.0

Then inside the ssh client, I check the server status and it is working:


HTTP/1.1 200 OK
Server: spray-can/1.3.2
Date: Sun, 11 Jan 2015 21:15:47 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 18

{"status":"alive"}

However, out of the ssh client, it does't connect:

curl: (7) Failed to connect to 172.31.18.106 port 7070: Operation timed out

In other words, my node.js/express server can no longer communicate simply via RAW HTTP. Should I setup a SSH client on the Azure server? Is there any config that I could open up the connection publicly to my app for collecting data?

Thanks!

Donald Szeto

unread,
Jan 11, 2015, 5:56:14 PM1/11/15
to predicti...@googlegroups.com
Hi Victor,

Does the AWS EC2 security group associated with the PredictionIO EC2 instance allow public access of port 7070? Is 172.31.18.106 the public or private IP shown on your EC2 dashboard?

Regards,
Donald

Victor Leung

unread,
Jan 12, 2015, 2:20:45 AM1/12/15
to predicti...@googlegroups.com
Hi Donald,

The security group is using the one generated by AWS Marketplace. 172.31.18.106 is the Private IPs.  54.183.105.216 is the Public IP. 

The one I mentioned before is using private IPs. I tried to curl on public IP which doesn't work on both with or without ssh.

curl: (7) Failed to connect to 54.183.105.216 port 7070: Operation timed out

I also tried to start the event server using these IP address, i.e. "pio eventserver --ip 172.31.18.106 " or "pio eventserver --ip  54.183.105.216", but it both fails:

WARN] [01/12/2015 07:06:54.538] [EventServerSystem-akka.actor.default-dispatcher-3] [akka://EventServerSystem/user/IO-HTTP/listener-0] Bind to /54.183.105.216:7070 failed
 
[ERROR] [01/12/2015 07:06:54.541] [EventServerSystem-akka.actor.default-dispatcher-2] [akka://EventServerSystem/user/EventServerActor] Command failed.
 
[INFO] [01/12/2015 07:06:54.561] [EventServerSystem-akka.actor.default-dispatcher-2] [akka://EventServerSystem/system/IO-TCP/selectors/$a/0] Message
 
[akka.dispatch.sysmsg.DeathWatchNotification] from Actor[akka://EventServerSystem/system/IO-TCP/selectors/$a/0#-1398787013] to
 
Actor[akka://EventServerSystem/system/IO-TCP/selectors/$a/0#-1398787013] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted
 
with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'


So I think the command to start server with global traffic is using 0.0.0.0.

Thanks,
Victor

Donald Szeto

unread,
Jan 12, 2015, 10:49:44 AM1/12/15
to Victor Leung, predicti...@googlegroups.com
Hi Victor,

It's correct to use 0.0.0.0 as the binding IP. EC2 instances don't really have public IPs, so AWS will automatically route traffic from public IPs to the instance's private IP.

Could you please double check if the security group is allowing inbound traffic from everywhere to port 7070? Sometimes AWS could be glitchy.

Regards,
Donald


--
Donald Szeto
PredictionIO

Victor Leung

unread,
Jan 12, 2015, 3:50:34 PM1/12/15
to predicti...@googlegroups.com, victor...@gmail.com

Hey Donald,

I just changed the inbound rules and it WORKS!

THANKS a lot for your help! I have been stuck for a while. haha

Cheers,
Victor

akshay mahajan

unread,
Jul 3, 2015, 5:41:03 AM7/3/15
to predicti...@googlegroups.com
Hello, 

I am facing the exact same problem, and what's more confusing is that, I am able to access the engine on port 8000 over the internet with the exact set of security rules. But I cannot access 7070.

I triple checked the security group config. It's exactly the same for both ports. Any help will be appreciated!

Thanks,
@kshay

akshay mahajan

unread,
Jul 3, 2015, 7:11:47 AM7/3/15
to predicti...@googlegroups.com
Sorry for this - our internal firewall had this port access blocked. Now it's working as expected.

innocent udeogu

unread,
Jun 7, 2016, 1:14:04 AM6/7/16
to predictionio-dev, victor...@gmail.com
Please I need some help:
I get this from my app console
PredictionIO::EventClient::NotCreatedError (Connection refused - connect(2) for "localhost" port 7070)

I deployed on AWS EC2.

The image is a snapshot of my security group settings.

Things look good when I ssh but doesn't work on my client.

Thank.
Reply all
Reply to author
Forward
0 new messages