This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes JBoss + Amazon EC2 + IP Binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss + Amazon EC2 + IP Binding" Watch "JBoss + Amazon EC2 + IP Binding" New topic
Author

JBoss + Amazon EC2 + IP Binding

Marcus Gough
Greenhorn

Joined: Apr 21, 2011
Posts: 1
Hi Ranchers,

Currently I run JBoss 6 on a dedicated server. Remote clients connect via EJB and all is well. To start the server, i run a command like:

run.sh -b {{server ip address}}

The key here is that the server ip address must be set for the remote connections to work (0.0.0.0 is no good).

I am keen to migrate my solution to Amazon EC2. I have managed to get setup, but unfortunatly I cannot start the JBoss server with the public (elastic) IP address binded as I would on a dedicated server. I have spent two days experimenting and googling to find a solution to my problem but without luck

Does anybody have any experience of overcoming this issue? Any pointers would be hugely appreciated.

Many Thanks,

Marcus.

Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 492
    
    5
EC2 and elastic IP behaviour don't correspond exactly to that of a dedicated server with a static IP address.
In a regular dedicated/virtual server with static IP address, if you do an ifconfig, you'll see the static IP address in there.
But in EC2, you won't see the elastic IP.
That's because the elastic IP is never assigned to the instance, as a normal static IP would be.
EC2 uses NATting to map elastic IP to the private IP of EC2 instance it's currently bound to.
Since elastic IP is never assigned to the instance, you can't do run.sh -b <elasticIP>

Instead just execute with private IP or 0.0.0.0:
1. run.sh -b <privateIP>
OR
run.sh -b 0.0.0.0

2. The EC2 firewall should be configured to allow access to JNDI/RMI ports, etc.
For that, check which security group is applied for your instance (you can get this from AWS console when you select the instance)
In the sidebar "Security Groups" page, select this security group and add appropriate inbound rules for each port you want (JNDI and RMI are the only two needed, I guess...never tried remote EJB on EC2, just tried web server).

Now when your client accesses remote EJB on EC2, the routing will be
client --> elastic IP -> EC2 firewall -> EC2 NAT -> [Elastic IP to private IP] -> EC2 instance
Carrie Coy
Greenhorn

Joined: May 23, 2011
Posts: 2
Which port numbers, specifically, need to be open on the EC2 firewall? I followed these instructions and opened ports 8080, 1098-1099, 4444-4445, 8009, 8083, and 8093 and I still can't connect to http://elastic-ip:8080... Jboss is running and bound to the private IP. Any tips on how to diagnose this?
Carrie Coy
Greenhorn

Joined: May 23, 2011
Posts: 2
Sorry, I neglected the obvious. As soon as I opened outbound port 8080, I was able to connect.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss + Amazon EC2 + IP Binding
 
Similar Threads
Tomcat crashes: ClassNotFound JreMemoryLeakPreventionListener
Setting up JBOSS server at home
How to convert simple Java Code into amazon's AMI
invoke EJB on a remote machine with dynamic IP
command line arguments