简体   繁体   中英

Amazon EC2 connecting to another EC2 EBS

I am using cakephp for coding when I am configuring the database, connection failed. My situation is that I want to connect to an ebs database that is located in another EC2 instance.

Is there a way to connect amazon ec2 to another ec2 ebs?

I have a database(ebs) in the first ec2, currently I have another server that is ready to connect to the first ec2 ebs database. Is there a way to connect to the ebs database in the first ec2 instance? I do not want to maintain multiple database therefore need to consolidate the data in one ebs database. Are there ways to connect?

Thank you

This question needs a lot more information/details but I'm gonna take a shot.

I assume you mean just have your database on another instance, in which case you just to make sure that you open up the port on the Security Groups where your database is listening on.

I'm gonna assume you are running mysql too, so for that case you need to open up port 3306 on your security groups.

Also in your /etc/my.cnf file make sure the following is commented out:

skip-networking

and make sure you have the following, if you want to allow connections only on the network interface that has configured YOUR-SERVER-IP

bind-address=YOUR-SERVER-IP

For the changes to take effect just restart mysql (Ubuntu/Debian)

service mysql restart

If you are using something like Postgresql , the configs are similar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM