0

We are planning to setup 2 mysql servers in master-master replication

Is it possible to use direct Ethernet connection over gigabit ethernet port on the 2 servers?

Is there a way to bind mysql server(or any other process) to bind to a ethernet link i.e. eth1, so that it does not accidentally uses the default link which might be connected to overloaded router?

Thanks

doesnt_matter
  • 65
  • 2
  • 6

1 Answers1

0

Looks like you can only bind MySQL to 0, 1 or all interfaces on a system (MySQL: Bind to more than one IP address?)

You could try having MySQL bind to all interfaces on your server, configure a private IP space for the two directly connected NICs and configure MySQL to replicate using those private IP addresses.

Example:

Server 1 (Master):

NIC1 - 192.168.0.10 <- General access to server (connected to switch)

NIC2 - 10.0.0.10 <- Replication interface (directly connected to NIC2 on Server 2)

Server 2 (Secondary):

NIC1 - 192.168.0.11 <- General access to server (connected to switch)

NIC2 - 10.0.0.11 <- Replication interface (directly connected to NIC2 on Server 1)

Configure replication using the 10.0.0.x IP addresses and see if it works.

You can verify replication is occuring over the replication interfaces by using tcpdump to capture packets or checking the interface statistics for NIC2 using ifconfig.

FiZi
  • 84
  • 4
  • 1
    This should work. We have a setup similar to this one. If the dedicated replication interfaces are on a different subnet than the default link, it will route it through the correct interface anyway since it is directly connected. – jam Mar 20 '15 at 15:04
  • Thanks I will try it on virtual box, since it can have to ethernet connections – doesnt_matter Mar 22 '15 at 00:52