I have written a client-server application in Java and I want to run it on Amazon EC2 Ubuntu instacnes. The client runs on an EC2 instance and the server on one and the third EC2 instance is for hosting postgreSQL database. I have some questions regarding the network connection and hope that somebody could help. :)
I know that I have to use the public DNS to connect from the client to the server. Can I just use
socket = new Socket(host, port);with the host the public DNS as a string or do I have to use something like
InetAddress address = InetAddress.getByName(host);?
Which ports are I am allowed to use? Socket will listen on this port.
Do I have to configure something else for the EC2 instance to get a connection?
On one EC2 instance I will install postgreSQL. I think that I just can install it like with normal Ubuntu. Can I then just connect to the database using the public DNS from the EC2 instance and the port I set in the postgreSQL or do I have to maker other settings?