Tunnel between local linux machine( behind NAT) to aws instance(linux) - linux

Is there any utility through which i can create a tunnel between local linux machine and aws instance..
I used this http://www.rkeene.org/projects/info/wiki/142
Its good, but multiple connections don't work properly.
Please suggest me other possibilities

The simplest way I see it's establishing a VPN connection between your external machine and your AWS VPC. You could just have an EC2 instance running OpenVPN facing internet on AWS, and set a client on the other end. You could even use Amazon VPN, but it implements IPSEC, which could be a little more tricky to connect from you Linux box. Another advantage of OpenVPN is that you can have as many clients as you want coming from anywhere.

Related

Can't connect remotely to Jenkins being run on a Debian 8 VM

I've recently set up a Debian 8 Jessie VM on Google Cloud. I've installed Jenkins and have the service up and running(verified by "sudo service jenkins status"), yet I can't connect to the VM's external IP from another machine. I used to run Jenkins from my personal computer until I decided I needed a dedicated server to run it continuously. When I was running it on my personal machine I would just access localhost:8080 and the Jenkins dashboard would load fairly quickly. However, upon trying to access the external IP address of the VM running Jenkins, I'm usually greeted with "Connection refused" in my web browser.
At the suggestion of most posts I've seen regarding such issues, I've lifted all firewalls on the VM and have tried to ensure that the VM is listening at the correct IP address, but nothing seems to be able to change the outcome presented by my browser. Where does the issue most likely reside: the VM, Google Cloud, or Jenkins? I'm at a loss.
My first guess is a connection/firewall issue. To test this, you could try a port forward using SSH: SSH into your server with a local port forward: ssh -L 8080:localhost:8080 yourserver. You should then be able to direct your web browser at http://localhost:8080/ and your packets flow through the SSH connection. If that makes it work, have a good look at
How to open a specific port such as 9090 in Google Compute Engine . Or better yet, if you are the only one to use that Jenkins server, just keep using the SSH tunnel. It's much more secure than opening jenkins to the public world.
Have you tried installing tcpdump on the VM and doing a packet capture? That way you can determine where the traffic is being dropped. If you don't see any traffic, then it is being dropped somewhere in the cloud before it gets to your VM. If you are seeing traffic, then you need to determine is it Jenkins or some agent on the host (perhaps a firewall but you mentioned you cleared all the rules) ... I would suggest stopping the Jenkins service and then trying to access it again. Do you get the same "Connection Refused" message? If so, then it is something on the VM. If not, then it something at the application layer, i.e. Jenkins.
Happy hunting!!!

Mongoerror: failed to connect to server localhost:27017 on first connect

I have created an application using MEAN, After that, I have created the ec2 Linux instance, where I am running this application.I have installed all the dependencies.
Added port 27017 on security group page.
running the command on the ec2 instance as node server.js
Node: My mongo DB is outside my cloud instance i.e on my laptop.
How can I fix this error?
You need to open your laptop to internet which is almost impossible (and you shouldn't). That means you need a MongoDB server which is accessible by your EC2 Linux instance.
You may use a free mongodb hosting such as mlab
On the other hand you can enable another EC2 instance and setup your own mongodb. Beware that you may need to setup firewall if it's not an internal network.

Docker : Linking containers on different host machines

How can i connect two containers on different host machines in Docker ? I need to use data from mongodb on one host by a nodejs application on another host ? Can any one give me an example like this?
You could use the abassador pattern for container linking
http://docs.docker.com/articles/ambassador_pattern_linking/
Flocker is also addressing this issue, but needs more time for infrastructure setup:
https://docs.clusterhq.com/en/0.3.2/gettingstarted/
You might want to checkout also Kontena (http://www.kontena.io). Kontena supports multicast (provided by Weave) and DNS service discovery. Because of DNS discovery you can predict before the deploy what addresses each container will get.
As Flocker, Kontena also needs some time for infrastructure setup: https://github.com/kontena/kontena/tree/master/docs#getting-started
But you will get service scaling and deploy automation as a bonus.
You can connect container from different host by creating an overlay network.
Docker Engine supports multi-host networking out-of-the-box through
the overlay network driver.
It doesn't matter what machine the other container is on, all you need to is ensure that the port is exposed on that machine and then direct the second container on the first machine to the IP of the second machine.
Machine 1: Postgres:5432 172.25.8.10 ifconfig
Machine 2: Web Server:80 172.25.8.11 -> Point DB to 172.25.8.10:5432

Virtual machine in Azure not quite the same as a real machine

Hope somebody could give me a hint?
When trying to use an Azure virtual machine to host a database I have problems with the hostname:port way to access the virtual machine instead of just hostname.
For example, I got a preview scadcam.cloudapp.net:51165 virtual machine. When I try to access the database hosted in there, my application thinks I´m trying to comunicate with the database thru this port.
Is there a way to define a url that does not show the port? Something like scadcam.cloudapp.net/51165 ?
I´m sure there are a lot of applications that may have this type of problem, so I suppose there is a way to do it?
Reagards
So you want to host a database in a Virtual Machine, so I'm assuming you're trying to host an instance of SQL Server. If you want to connect to the hostname without having to specify the port you should start by doing the following:
Create an unnamed instance in your SQL Server installation
Add an endpoint for port 1433 to your virtual machine (see this link)
Also, if you're using .NET to connect to that database it's pretty easy to specify the port if you don't use port 1433:
Data Source=myserver.cloudapp.net,4999;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
In your question I also see that you're talking about scadcam.cloudapp.net:51165. Note that 51165 is probably the random port that is used for remote desktop, and you can't use that same port to connect to your database.

Keeping Elastic Search alive on Amazon EC2 Linux Instance

I have elastic search running on a linux instance on Amazon EC2. I use tunnelier to connect to the instance. I'm new to EC2 and tunnelier (I'm more familiar with Windows Servers and Remote desktop). The problem is that when I disconnect the tunnelier console, my Elastic Search Server is no longer available for clients connecting to it. I would like to know how to keep the Elastic Search Server alive, serving client requests without my having to keep a tunnelier session active.
I guess I didn't ask this properly or so. Anyway, I found the answer here: http://www.elasticsearch.org/tutorials/2011/08/22/elasticsearch-on-ec2.html. Really really helpful. Thanks a million to the author. Helped me set up elastic search as a service on EC2.

Resources