Running MySQL on remote server

10 posts / 0 new
Last post
#1 Sun, 10/20/2013 - 00:17
yngens

Running MySQL on remote server

I have followed steps on http://www.virtualmin.com/documentation/id,running_mysql_on_a_remote_sys... to configure MySQL to run on another server. Two servers are located next to each other, but communicate with each other through local LAN. Now I am trying to make them work directly with each other. Both of the servers are connected to LAN through eth0. I've connected two servers with each other through eth1 with regular ethernet cat6 cable, but not sure how to set up the connection and will this way work at all. Both servers have CentOS 6.4 based Webmin, firewalls managed by APF. Could anyone elaborate what should by my next steps? Thanks!

Sun, 10/20/2013 - 02:44
Locutus

The documentation you linked seems quite extensive and explains the process very well. I wouldn't know what to say besides repeating what's said there. :) So did you follow those steps? Where exactly did you run into what problems?

Sun, 10/20/2013 - 17:53 (Reply to #2)
yngens

The documentation is indeed comprehensive on software configuration part, but please re-read my post - I am trying to make needed configuration on hardware part. The documentation is well explained how to connect to ANY REMOTE MySQL server, whereas in our case two servers are located next to each other, they are not as REMOTE and can be connected directly to each other. They are currently are communication through LAN, but why not to connect them directly to each other as both of them have extra ethernet ports. I just need to figure out how to make requests from main server for MySQL databases go through eth1 instead of eth0.

Sun, 10/20/2013 - 02:44
Locutus

(Deleted duplicate due to web server error)

Mon, 10/21/2013 - 02:45
Locutus

Ah okay, so your topic is a bit misleading, since it's not about the MySQL part specifically. ;)

Before I write a whole essay about how to connect two servers, can you please elaborate what your problem about that is exactly? Normally, you just connect them with a cable and configure the NICs with a separate IP network etc., set the routing properly, and the rest, like choice of correct interface, works automatically.

Mon, 10/21/2013 - 03:05 (Reply to #5)
yngens

My problem is I never did this before and googling gives vast volume of various resources, but not exactly what I am looking for. So I thought since some Virtualmin users move their MySQL database on a separate server, then someone definitely walked the path that I am trying now and could share some recommendations. The steps you described is exactly the solution I am looking for:

connect them with a cable and configure the NICs with a separate IP network etc., set the routing properly, and the rest, like choice of correct interface

I will try now dig about these steps in the net to find more detailed instructions, but would appreciate if you can give more detailed instructions. Thanks!

Mon, 10/21/2013 - 04:53 (Reply to #6)
Locutus

Your endeavor is really independent from MySQL, since connecting two servers directly, while both are also connected to the Internet separately, can be done for a lot of purposes.

As for details, well you'd use the Webmin networking config module to configure the second NIC in both servers just like you configure the primary one. You'd give the servers private IP addresses on those NICs, e.g. 10.0.0.1 and 10.0.0.2, and set the mask to /24 or 255.255.255.0 for both. Gateway and nameserver are not required, since they are not connected to the outside network on those NICs. That should have the system automatically create the proper routing table entries.

Then you'd use the private IP whenever server 1 needs to talk to server 2 directly, and vice versa. E.g. when you have a web software installed on server 1 which needs to talk to MySQL on server 2, you'd use "10.0.0.2" as MySQL IP instead of server 2's external IP. Then the traffic will automatically go through the correct interface.

Mon, 10/21/2013 - 16:00 (Reply to #7)
yngens

This is more than enough, I will try to experiment later today. Thank you very much!

Mon, 10/21/2013 - 02:44
Locutus

(Duplicate deleted due to web server error. Eric, could you please check that? Since a few days, when I make posts from my tablet with Dolphin, I get a webserver error and my post is created twice.)

Topic locked