MemSQL - unable to connect remotely to EC2 cluster using MySQL client - amazon-ec2

I have used http://cloud.memsql.com to successfully deploy a MemSQL cluster to EC2 as documented here: http://docs.memsql.com/4.0/setup/setup_cloud/.
I can SSH to the master aggregator, and successfully login to the MemSQL prompt locally. However, I cannot connect remotely using a MySQL client application.
I have double-checked port 3306 is open and just for testing have applied all privileges to root:
GRANT ALL PRIVILEGES ON *.* TO root#'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
The documentation states:
Once your cluster is up and running, connect to the master aggregator using any valid MySQL client driver.
Can anyone advise on a step I have missed?
--
UPDATE 1 - The source range is open for the MemSQL port:
3306 tcp 0.0.0.0/0
UPDATE 2 - ufw has been disabled for testing.

Currently, clusters spun up by cloud.memsql.com lock down their security group to the vpc for the MemSQL ports (like 3306). If you want to access it from outside of the vpc, you will need to add a new rule to the group. Something like this would open the group completely:
Add an Ingress rule for port 3306-3306 for CIDR: 0.0.0.0/0
Note that this will open the cluster to the world, and anyone will be able to connect. Instead of 0.0.0.0/0, I recommend using your public ip and a /32 like so: YOUR_IP/32

It turned out to be a DNS issue by the provider I was using. Tried connecting using a cell phone and had no issues.

Related

Unable to connect to Airflow server running on EC2

I am trying to set up an Apache Airflow server on ec2. I managed to get it running and verify status by hitting /health endpoint using curl on http://localhost:8989. Airflow listens on port 8989 here.
The next I want is to be able to connect to the admin dashboard/UI using the browser on EC2's public IP. So I added the inbound rule in the AWS security group ec2 instance belongs to.
While connecting to Airflow, I am getting the following error
Failed to connect to ec2-XX-XX-XXX-XXX.compute-1.amazonaws.com port 8989: Operation timed out
Not sure what else I need to do to reach server running on ec2.
If you can SSH to an EC2 instance, you've added a security group rule for ingress on another port, but can't reach the instance on that port, here are some other things to check:
Firewall running on the instance. Amazon Linux and recent official
Ubuntu AMIs shouldn't have iptables or some other firewall running on
them by default, but if you're using another AMI or someone else has
configured the EC2 instance, it's possible to have iptables/ufw or
some other firewall running. Check processes on your instance to make
sure you don't have a firewall.
Network ACL on the VPC subnet. The default ACL will permit
traffic on all ports. It's possible that the default has been changed
to allow traffic only on selected ports.
Multiple security groups assigned to the EC2 instance. It's possible
to assign more than one security group to the instance. Check to make
sure you don't have a rule in some other security group that's
blocking the port.

Connecting to Aurora AWS Serverless

I’ve now tried to create a serverless Aurora (MySQL compatible) database and connect to it for two days, and I just can’t seem to get it to work. Supposedly I should have been able to get it up and running in five minutes.
In any case, I created am Aurora Serverless database in the US East (N. Virginia) region (us-east-1), and have been able to connect to it with the AWS Query Editor. I also have an EC2 server in the same region, and have given the Aurora database the same security group (under RDS > Security Group), and in the security group I have opened for MYSQL/Aurora (TCP, 3306) from all sources. When I click the modify button on the database, there is also another (VPC) Security Group listed (rds-launch-wizard-4), which was created automatically. This one I also located under my EC2 dashboard and gave access to all ports from all sources (inbound), and to all ports (outbound). And there is a networking VPC & subnet group, which I don’t know what to do with, if anything.
I try to connect to the database, using this command line command:
mysql -h hest2.cluster-xxxxx.us-east-1.rds.amazonaws.com -P 3306 -u root –p
It generates an error “ERROR 2003 (HY000): Can't connect to MySQL server on” on both my EC2 instance, my local computer and on other online servers.
From the EC2 instance, try doing a telnet on the DB port to test if all your security group settings are applied correctly.
telnet hest2.cluster-xxxxx.us-east-1.rds.amazonaws.com 3306
If the connection does go through, then the issue is with your client code. Cross check that you have wired the right endpoint in your code.
If the telnet connection does not group (I'm guessing that it would not), then it is guaranteed that your security group settings are not set correctly. In order to debug this further, we would need more details on:
The list of vpc security groups associated with your cluster.
The details of each of these vpc security groups (You've mentioned that
you've opened up everything, but I'd like to see the exact rules in
place)
As for laptop and other servers - If they are outside the VPC, then it would not work. Aurora Serverless is accessible only from within the VPC as of now.

How to connect to an Oracle Database running on Amazon AWS EC2?

I have an Oracle Database instance running in Amazon AWS EC2 service. (it is not RDS Relational Database Services).
How can I configure my Oracle SQl Developer to to access this remote databse in AWS EC2?
By checking AWS documentation I found only references to connect to Oracle databse running in RDS services.
I apreciate your help.
Thanks
In AWS, edit the Security Group for your instance to add a rule (if one doesn't already exist).
Inbound
Type = SSH
Protocol = TCP
Port Range = 22
Source = "My IP", or "Custom" (as you wish)
In SQL Developer, open View -> SSH.
Right-click "SSH Hosts", New SSH Host.
Name = whatever you like
Host = your server's IPv4 Public IP address
Port = 22 (default)
Username = root or ec2-user, whichever is appropriate for the linux AMI you used
Use key file = tick this and select your key file for your instance
Add a Local Port Forward = tick this and accept the defaults (localhost, port 1521)
Edit the properties of your SQL Developer Database Connection
Connection Type = SSH
Port Forward = the name of the SSH Host you created earlier
SID / Service name = whatever SID or Service name you need
If you want to add another layer of security. SSH or DMZ + Load Balancing is the way to go. If not Make sure the following are all open for the IP. firewall, VPC Network, AWS inbound outbound rules.

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.

Connect to Amazon (AWS) EC2 instance via browser

I am having trouble connecting to an Amazon Elastic Cloud Computer Instance via a browser.
I attempted going to ********.compute-1.amazonaws.com , but the browser returns that the connection has timed out.
I can connect via ssh and winscp. That is how I uploaded a web app I developer. I have also created a security group and added rules to open ports 22 and 80.
Do I have to assign the security group to the instance somehow?
The security group's rules also do not have a source IP, well they do its 0.0.0.0/0
I would really appreciate any and all help in getting this site ' viewable ' via a browser.
By default, your instances will only be in the default security group. If it's an EC2 instance you cannot change security groups while the instance is running, you'll have to specify them in advance. If it's a VPC instance you can change security groups at runtime.
Add the rule to the default group
You can however add the rule to allow port 80 to that default security group; just don't create a new security group as it can not be associated with the running instance.
Is the web server up?
Also, make sure that your web server is up and running. From your instance (using SSH shell access), check if the right process is listening on port 80, using the command netstat -lnp. You should then see a row with proto tcp and a Local Address ending in :80. The IP Address listed should be either 0.0.0.0 (meaning 'any IP') or a specific IP of a listening network interface.
Web server not up
If you are in need of a web server, take a look at Apache or Nginx. They both support PHP.
Hope this helps.
I had also faced similar issue with ec2 micro instance. I was using Red-Hat AMI. Despite of opening ports 8081 in security group, I was not able to a telnet to the host port. Disabling the iptable did the trick for me:
sudo /etc/init.d/iptables stop
Do not forget to disable firewall if you use windows for your server.
I faced the same issue while setting up redash AMI image on AWS. Inbound security rules should be changed when instance is not running. Let's say if the instance is running (meaning it's active and started); If you change the inbound rules of that machine you'll still face firewall issue. So Stop the machine on which you want to change the inbound rules on. Change the inbound rules. Start the machine now. Now you can hit the machine url from the ip you just opened the access to the machine to.
The EC2 instance firewall is maybe enabled.
Check it with this command:
sudo systemctl status firewalld
if enabled you can disable it with :
sudo systemctl disable firewalld
or setup rules to allow port 80 trafic

Resources