Multiserver setup troubles

Discussion in 'Installation/Configuration' started by GeorgeG, Nov 9, 2014.

  1. GeorgeG

    GeorgeG New Member

    [SOLVED] Multiserver setup troubles

    Hello All,

    I am toying with the idea of getting a multi-server setup across a number of LXC containers. In more detail, I have setup 4 containers on a server running ubuntu 14.04.1LTS:

    main.domain.tld (Int.IP: 10.0.3.100 Ext.IP: eee.xxx.ttt.111) (Master ISPConfig server - Web, DNS, File)
    guests.domain.tld (Int.IP: 10.0.3.150 Ext.IP: eee.xxx.ttt.222) (Slave ISPConfig Instance for guests - Web, File)
    db.domain.tld (Int.IP: 10.0.3.200) (Slave ISPConfig Instance - Database only)
    email.domain.tld (Int.IP: 10.0.3.250 Ext.IP: eee.xxx.ttt.222) (Slave ISPConfig Instance - Mail server)

    All four containers have the following entried in /etc/hosts
    10.0.3.100 main.domain.tld main
    10.0.3.150 guests.domain.tld guests
    10.0.3.200 db.domain.tld db
    10.0.3.250 email.domain.tld db

    I have 3 public IPs allocated to main, guests and email, as I would like to keep the db accessible only through specific applications.

    So far the installation seems to have been a success, I get all green lights under the monitor tab.

    I went on and I created a client that defaults on the main server, and a client that defaults on the guest server. I then created the DNS zones, and added a couple of websites. All seemd to be normal up until that point.

    I then created a database user under the client that uses main as the default server, followed by a new database. I selected db.domain.tld as the server, the related website (on main) typed the rest of the details and hit save.

    To my surprise though, the database was actually created on the database server running on the guest container!

    Any ideas on what might have cause this? or at least how to track the issue?

    Btw, I have used IPTables rules to route incoming traffic to the containers (as follows):
    iptables -t nat -I PREROUTING -d eee.xxx.ttt.111 -j DNAT --to-destination iii.nnn.ttt.111
    iptables -t nat -I POSTROUTING -s iii.nnn.ttt.111 -j SNAT --to-source eee.xxx.ttt.111

    All mysql instances are listeining to anything, while I am using iptables rules to allow access to the specific IPs only.

    Regards,
    GeorgeG
     
    Last edited: Nov 10, 2014
  2. GeorgeG

    GeorgeG New Member

    Hello All,

    Found it (I think)... it was a confusion with the internal and external IPs in the end...

    The IPTables rules on were set to accept mysql connections from the internal IPs only, but because the IPs were masquerated to the external IPs, it was failing, and ISPconfig was falling back to the guests slave server.

    Minor bug I think, as I should have received a warning or something... anyhow... too late, need sleep.

    Thanks,
    GeorgeG
     

Share This Page