Connection Time Out in AWS EC2

Connection Time Out in AWS EC2

 

Possible reasons for timeout when trying to access EC2 instance

  • The most likely one is that the Security Group is not configured properly to provide SSH access on port 22 to your i.p.
  • The local firewall configuration does not allow SSH access to the server.
  • The server is not started properly
  • Net connectivity
  • Wrong pem file / Host Name
  • Spelling mistake

 

When it times out or fails, check the following:

Security Group:

Make sure to have an inbound rule for tcp port 22 and either all ips or your ip. You can find the security group through the ec2 menu, in the instance options.

Routing Table:

For a new subnet in a vpc, you need to change to a routing table that points 0.0.0.0/0 to internet gateway target. When you create the subnet in your vpc, by default it assigns the default routing table, which probably does not accept incoming traffic from the internet. You can edit the routing table options in the vpc menu and then subnets.

Add Route to Routing Table
Destination: 0.0.0.0/0
Target: <Internet Gateway from earlier>

Elastic IP:

For an instance in a vpc, you need to assign a public elastic ip address, and associate it with the instance. The private ip address can’t be accessed from the outside. You can get an elastic ip in the ec2 menu (not instance menu).

Username:

Make sure you’re using the correct username. It should be one of ec2-user or root or ubuntu. Try them all if necessary.

Private Key:

Make sure you’re using the correct private key (the one you download or choose when launching the instance). Seems obvious, but copy paste got me twice.

Alternatively, Building everything back. This included:

  1. Create VPC
  2. Create Internet Gateway
  3. Attach Internet Gateway to VPC
  4. Create Routing Table
  5. Add Route to Routing Table
  6. Create Subnet

Convert the PEM file to a PPK file

This blog will teach how to convert the PEM file to a PPK file

1. Run Puttygen.

2. From the menu option “Conversions”, select “Import key”
PEM to PPK

3. In the dialog, locate the pem file and “Open” it.
PEM to PPK 2
4. If required Change the comment from ‘imported-openssh-key” to a something more descriptive like “my-db-server”
5. Optional: Enter a passphrase.
6. Create PPK file by clicking on “Save private key”

 

Naveen Dasari

Helical IT Solutions

INSTALLING JASPERSERVER IN AWS EC2 / LINUX

Things we need to find out before installing Jasperserver in AWS EC2 / Linux.

1)      Identifying whether your CPU is a 64bit or not. Use below command to find it

uname –m

Our CPU is a 64 bit.

 

2)      Identify whether Jasperserver default port 8080 is open or not? Below command helps you to identify it.

netstat -an | grep 8080| grep LISTEN

 

If nothing has not returned, then your port 8080 is free to use.

Installing Jasperserver

3)      Created a folder Helical and Jasperserver under home.

/home/Helical/Jasperserver.

 

4)      Downloaded Jasperserver 30-days trial from here http://www.jaspersoft.com/thanks-download-30-day

File name: Jasperreports-server-5.5-linux-x64-installer.run

 

Command used to download:

wget https://s3.amazonaws.com/jaspersoft_downloads/5.5/jasperreports-server-5.5-linux-x64-installer.run

 

If you face an Error saying “ -bash: wget: command not found.” Then it means wget package is not installed. Installed wget package using

 

yum install wget

 

Repeat wget command again.

 

5)      Downloaded “jasperreports-server-5.5-linux-x64-installer.run” under the location “/home/Helical/Jasperserver”.

 

Apply chmod 777 for the downloaded file

It was confirmed that port 8080 is not in use with any other process. Thus i am going forward with Jasperserver installation as

“./ jasperreports-server-5.5-linux-x64-installer.run”

Results of each step:

A)     Welcome to the JasperReports Server 5.5 Setup Wizard and its License Agreement. Do as it says and finals asks you to accept the license or not.

Press [Enter] to continue :

Reading the agreement

Accepting the License (y/n): Y

B)      It asks you to select the option of installation (Install All or Custom). If it is for the first time Installation select first option.

Please choose an install option below:

[1] Install All Components and Samples  (requires disk space of: 1.3 GB)

[2] Custom Install

Please choose an option [1] : 1

Jasper installation AWS 3

C)     It asks you to select a folder to install. By default it takes “/opt/jasperreports-server-5.5”

Jasper installation AWS 2

Press Enter simple Instead saying Yes(Y).

D)     It asks you to confirm the Installation by Continuing. Say (Y)

Do you want to continue? [Y/n]: Y

Jasper installation AWS

Start Your Jasperserver from the place you have installed it. Here the Jasperserver installed path is “/home/Helical/Jasperserver/y”.

Starting Jasperserver:

You can start the jasperserver in any one of the way sh ctlscript.sh start (or)  ./ ctlscript.sh start

Check the Status of the Service:

sh ctlscript.sh status

Once again the check the port number 8080 is engaged or not.

By default jasperserver uses Postgres Database thus from this installation even postgres DB will also be available on Port Number 5432 in your machine. No need to install it explicitly.

Location of Postgres: “/home/Helical/Jasperserver/y/postgresql/bin”

Now you must be able to access the Jasperserver from “ipaddress:8080/jasperserver-pro”. If not able to access it Check whether 8080 is configured to access TCP/IP incoming and outgoing in iptables.

Edit iptables as root user using vi /etc/sysconfig/iptables

 

Add a rule saying

 

-A INPUT -p tcp -m state –state NEW -m tcp –dport 8080 -j ACCEPT

 

Now you must be able to access the Jasperserver.