Amazon Instance Ec2 Connection Timeout - amazon-ec2

I am using Amazon EC2 services & and its working correctly but suddenly from 3-days before when we try to access our instance using ssh connection we got following error:
"ssh: connect to host ec2----***.compute-1.amazonaws.com port **: Connection timed out"
when I try to access our sites deployed on our EC2 instance, I received the same error ,
"The connection has timed out
The server at ec2----***.compute-1.amazonaws.com is taking too long to respond"
there is no problem in network connection from our side as we are able to access other web site and services smoothly.
I can't even able to access hosted site without this.

I encountered the same problem.
I followed the troubleshooting in http://alestic.com/2010/05/ec2-move-ebs-boot-instance
Then when I tried to start a new instance, I got an message from Amazon:
Server.InsufficientInstanceCapacity: We currently do not have sufficient m1.small capacity in the Availability Zone you requested (us-east-1b). Our system will be working on provisioning additional capacity. You can currently get m1.small capacity by not specifying an Availability Zone in your request or choosing us-east-1d, us-east-1c, us-east-1a.
Maybe, you have an instance is us-east-1b, too.

You can try to access the System Console (either via the amazon web console or elasticfox) and check for any errors/messages that might help you arrive at the cause of this.

In ~/.ssh/config, add the following lines:
ServerAliveInterval 50
This will keep on pinging the server every 50 seconds to keep the connection alive.

Related

SSH connection in Amazon EC2 crashes after a while

I am testing the free services from Amazon EC2. I followed the manual and was able to access the server. After one minute inside the server, it crashes and I have to close my console and reboot the instance.
By reading the guides from Amazon, I found that I should set the Route Table, which I was not able to find. Maybe the dashboard has changed.

Connect to Multichain network using aws EC2

I am trying to learn basics of blockchain by trying the multichain platform, I have been following multichain guide to make a private blockchain, I am using two instances of EC2, I managed to create a blockchain using my first instance :
>multichaind secondChain -daemon
MultiChain Core Daemon build 1.0 alpha 27 protocol 10007
MultiChain server starting
Looking for genesis block...
Genesis block found
Other nodes can connect to this node using:
multichaind secondChain#XXX.XX.X.XX:XXXX
Node started
However, when I try to connect to the blockchain using a second instance of EC2, I am getting rejected :
>multichaind secondChain#XXX.XX.X.XX:XXXX
MultiChain Core Daemon build 1.0 alpha 27 protocol 10007
Retrieving blockchain parameters from the seed node XXX.XX.X.XX:XXXX ...
Error: Couldn't connect to the seed node XXX.XX.X.XX on port XXXX - please check multichaind is running at that address and that your firewall settings allow incoming connections.
Which is kind of expected, as I need to grant connect rights to that machine. However, It should return me a wallet address so I can grant the connection rights.
I think this is related to EC2 settings that are probably not allowing me to connect. I have few knowledge of EC2 and networks in general. I can't figure this out.
Have you checked if the access to the port is granted on the instance you're trying to connect?
If multichaind says "please check multichaind is running at that address and that your firewall settings allow incoming connection"
It is usually one or the other. Port and Running already.
Since you havent yet granted, its probably port.

Changes to iptable blocked all the ports, hence unable to connect to this Amazon EC2 instance through putty

Yesterday I was working on blocking of access to Redis server from out side doing by doing some changes to "iptable" file, unfortunately it blocked all the port which includes port 80 and 22 also, Hence I was unable to connect to EC2 instance from putty. Will you tell me how to resolve this issue.
You will have to do something like this: https://aws.amazon.com/articles/5213606968661598
I hope you are using EBS and not ephemeral storage. You know you could have used EC2 Security Groups instead of iptables, and then you could have easily fixed your mistake.

Connect to RabbitMQ on EC2 from external client

Similar questions have been asked
RabbitMQ on Amazon EC2 Instance & Locally?
and
cant connect from my desktop to rabbitmq on ec2
But they get different error messages.
I have a RabbitMQ server running on my linux EC2 instance which is set up correctly. I have created custom users and given them permissions to read/write to queues. Using a local client I am able to correctly receive messages. I have set up the security groups on EC2 so that ports (5672/25672) are open and can telnet to those ports. I also have set up rabbitmq.conf like this.
[
{rabbit, [
{tcp_listeners, [{"0.0.0.0",5672}]},
{loopback_users, []},
{log_levels, [{connection, info}]}
]
}
].
At the moment I have a client on the server publishing to the queue.
I have another client running on a server outside of EC2 which needs to consume data from the same queue (I can't run both on EC2 as the consume does a lot of plotting/graphical manipulation).
When I try to connect however from the external client using some test code
try {
ConnectionFactory factory = new ConnectionFactory();
factory.setUri("amqp://****:****#****:5672/");
connection = factory.newConnection();
} catch (IOException e) {
e.printStackTrace();
}
I get the following error.
com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED -
Login was refused using authentication mechanism PLAIN. For details
see the broker logfile.
However there is nothing in the broker logfile as if I never tried to connect.
I've tried connecting using the individual getter/setter methods of factory, I've tried using different ports (along with opening them up).
I was wondering if I need to use SSL or not to connect to EC2 but from reading around the web it seems like it should just work but I'm not exactly sure. I cannot find any examples of people successfully achieving what I'm trying to do and documenting it.
Thanks in advance
The answer was simply that I needed to specify the host to be the same IP I use to SSH into. I was trying to use the Elastic IP/public dns of the instance of the EC2 instance which I thought should point to the same machine.
Although I did try many things including setting up an SSL connection it was not necessary.
All that is needed is:
Create rabbitmq user using rabbitmqctrl and give it appropriate permissions
Open the needed ports on EC2 via Security Groups menu (default is 5672)
Use client library to connect to correct host name/username/password/port where the host name is the same as the machine that you normally SSH into.

I cannot acess to the website host on Amazon EC2 instance even I think the configuration is right

I have a free Amazon EC2 instance. And I installed Apache web server on it. I have the DNS record for my domain point to the ip for the EC2 instance. I can not access to my website. Then I looked up and allow the http inbound. But I still failed to access my web? What might be the reason. Anybody gives me a clue?
Go to the AWS management console and look at the Security Group the instance is in. Then make sure you have the port open that you are trying to connect to (most likely 80). To open it to the world set the ip range to 0.0.0.0/0 and to open it to a specific ip (like only your house) set it to xxx.xxx.xxx.xxx/32.
That is almost always the reason people have problems connecting when they are new to AWS. I wrote this post, which should help get you setup.

Resources