[Solved] Multiserver with ISPConfig db's on single db server

Discussion in 'General' started by remkoh, Oct 4, 2023.

  1. remkoh

    remkoh Active Member HowtoForge Supporter

    I'm trying to setup a new multiserver environment but with ISPConfig db's of several member servers on a single db server (which will also become db server in ISPConfig).
    ISPConfig's install script allows you to do so but after install the member has connection issues to the db with ISPConfig's server script every time.
    I can't get a handle on why.
    Connecting to the db from the command line and a php mysqli test script on the member works just fine.
    Only with a local db on the member everything works like it's supposed to do.
    Also with a local mysql proxy (so I then too can use localhost during ISPConfig install) the server script can't connect afterwards.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    In general, it should work with a central DB server which contains all databases. But personally, I won't do that and I do not test such setups. The local databases are used to provide a faster setup by avoiding to route network traffic over the network which add network latencies to each request.
     
  3. remkoh

    remkoh Active Member HowtoForge Supporter

    As they are vm's on the same host I care more about resources than latency.
    No database server in a vm means less resources necessary.
    If the db server vm would be down it has no direct impact on the dns server vm functioning.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the debug output from server.sh with the connection issue.
     
  5. remkoh

    remkoh Active Member HowtoForge Supporter

    That's what I thought because the option is available during install.
    But apparently it doesn't and I don't know why.
    It's not a network or firewall issue as connecting from the command line and a php mysqli test script is no problem.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    It must be a failure in the database connection. The connection must work with the IP address and hostname. Did you test both?
     
  7. remkoh

    remkoh Active Member HowtoForge Supporter

    I changed the hostname of the master server to it's IP address in /usr/local/ispconfig/server/lib/config.inc.php and /usr/local/ispconfig/interface/lib/config.inc.php but the result of running /usr/local/ispconfig/server/server.sh remains the same.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    I meant if you tested if the connection works using IP and hostname using mysql command, not changing things in ISPConfig.
     
  9. remkoh

    remkoh Active Member HowtoForge Supporter

    Both hostname and IP address work just fine from the command line.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    According to the code, connection with master database details works, but with the details provided for the local database, the connect fails.
     
    remkoh and ahrasis like this.
  11. remkoh

    remkoh Active Member HowtoForge Supporter

    Found that out too in the meantime.
    During the install a sql user was created with hostname access.
    When I changed the hostname to IP address in sql ISPConfig started to work.
    Strange enough resolving the hostname gives the same IP address.
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Most likely you can resolve it from that slave node, but maybe it can't be resolved to the same IP from within the mysql node? That's why I add all nodes in all /etc/hosts files of all nodes to ensure that no name resolving issues for mysql connections can occur in multiserver setups.
     
    ahrasis likes this.

Share This Page