How to connect acheive TCP Socket Connection to Amazon EC2 Cloud Instance - sockets

We are using TCP socket connection to send messages from one PC to another PC. Now, we have migrated our project to a cloud environment. It is possible to send messages from our own PC to the Amazon Cloud Instance. I have already tried this but I am unable to get the response in EC2 instance and also checked it by disabling firewall but no use. Please help me. Does anyone know how to achieve TCP Socket connection using Amazon EC2?

What are the settings of the security group of your aws instance?
Verify that you have allowed inbound traffic.
Check the below link on AWS security groups to know how to configure:
Amazon EC2 Security Groups .

Related

Unable to connect to CloudSQL instance that is part of a VPC network

I have created a CloudSQL instance which was part of a VPC I have created.
I'm able to connect to this CloudSQL using CloudSQL Proxy service. But I'm unable to connect to this instance using public IP of the instance though I added the firewall rule to this VPC.
The error I'm getting:
Unable to connect to host <public-ip-of-cloudsql>, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL said:
Can't connect to MySQL server on '<public-ip-of-cloudsql>' (4)
Following is the firewall rule I added and provided my home IP address in the blocked out area.
Please let me know if I'm missing something. I can provide more details if needed.
These are the steps you should follow in order to connect to Cloud SQL using the public IP:
Created a Cloud SQL instance, including configuring the default user.
Assuming you use a local client:
2.Install the client.
3.Configure access to your Cloud SQL instance.
4.Connect to your Cloud SQL instance.
You can find a detailed explanation here: Connecting MySQL client using public IP
If you are using the Cloud SQL proxy to connect via public ip, it requires port 3307 to be open to the address.
If you aren't using the Cloud SQL proxy to connect via public ip, you need to authorize your external IP.
I was able to connect CloudSQL which is part of a VPC by just adding the client IP address as Authorized networks.
It's weird, I tried many times before but couldn't succeed. It is working now.
Thanks, guys for answers.

Bluemix Secure Gateway AS 400 DB2 Connection refused Issue

I have configured Bluemix Secure gateway client to connect to DB2 on AS 400 using a Windows machine. I am able to run the Db2 connection successfully from the application on Windows machine where Secure gateway client is running. But when I run the same application on Bluemix with modifying the code to depict Secure Gateway client destination details, I get 'Connection Refused' error.
I had gone through how to connect a bluemix app to on-premise db/as400? , which mentions about Secure gateway client for OS 400.
Wanted to understand how to fix the issue for 'Connection Refused' ? Do we have to use different DB2Driver/ DB2 Connect string from Bluemix? or Any other settings to be done on AS400 server?
Given that the Connection refused error is occurring between your BlueMix application and the SG Servers and no logs are being generated on the SG Client, it sounds like the issue is with a listener not being opened on the SG Servers rather than an issue between the SG Client and DB2. All listeners should come up when the SG Client initially connects to the SG Servers.
Are you able to cURL or telnet the cloud host:port provided with this particular destination? Or is this connection refusal specific to your BlueMix app? In either case, this answer will provide more direction on where to investigate further.

UDP Socket over cloud provider

I am using Appache Tomcat to host webpages that can be accessed by authenticated users and a UDP socket has been opened on port 14550 in which devices sends a stream of communication messages. The system is working fine in the local network. I tried to host the this in Openshift and later found that Openshift does not allow external UDP communication. Now I am considering Amazon EC2 instance, new VM in Azure or in GCP. I would like to know that will there be any issue in using the sockets from my application. Thank you in advance.
No, on AWS EC2 everything is allowed, you just need to configure your Security Group to allow specific web traffic, UDP traffic can also be allowed their.
I was also looking for possible workaround for this issue, but it's quite easy irrespective of what platform language you are using to develop socket program on AWS EC2, as am using Node.js nginx in my case, this should work for all supporting platforms.
Configure Security Group
In the AWS console, open the EC2 tab.
Select the relevant region and click on Security Group.
You should have an default security group if you
have launched an Elastic Beanstalk instance in that region for your
app.
click on Actions button at top, and select Edit inbound rules.
here in Type column select All UDP, or you can set some Custom UDP
rule as well to listen at your socket port.
And there just enter port of your UDP server Ex: 2020.
And that's it!
Note: If something is not working, check the "Events" tab in the Beanstalk application / environments and find out what went wrong.

how to setup mongo mms for pc that is in local subnetwork?

I have a ubuntu pc's in internal sub-network that I'm running mongo on them. This machines are inaccessible from outside my company network.
I've seen the http://www.10gen.com/mongodb-monitoring-service which allow me to monitor the mongo setup. But which ip should I add into this cloud service?
Does there exists some install file to be installed on my pc, to allow me the monitoring the mongo?
The MMS monitoring agent will try to contact the MMS server on the internet and will push information in regular intervals, so there is no need to open listening ports.
The outbound connection will try to address port 443 (HTTPS), so the outbound connection should work by default in all but the most restrictive setups.
The MMS agent is written in python and requires some python-specific setup, but you can follow the installer steps from the manual.

Does amazon AWS (EC2/S3) have port 2195 enabled?

Clearly its not on their FAQ. Nor can I find it on the web. Any one with an account can test the following for me?
telnet gateway.sandbox.push.apple.com 2195
I would start using their free tier and move on to the paid service later.
regards
mb
yes, if you own an ec2 instance you have full control over ports, i.e you decide what you want open.
http://aws.amazon.com/articles/1697
note outbound ports are open (aws firewall only blocks incoming)
the only cavet is if you run a firewall on the ec2 instance well (iptables/windows firewall), you would then need to configure the outbound rule.