Point to a new mysql master db

Discussion in 'Installation/Configuration' started by topogigio, Mar 22, 2023.

  1. topogigio

    topogigio Member

    Hi,
    I need help to perform I task that I cannot find in any documentation or forum.

    I have a multi server environment. Master DB is on a separate server, that runs MariaDB only and is not part of ISPConfig servers (it is a central MariaDB server existent a long time before I started to use ISPConfig). Now I need to move the database to a new MariaDB Server, because I will dismiss the old one. So I need to change configurations in my ISPConfig servers to point them to the new database. Where are that settings and how can I change them?

    thanks
     
  2. topogigio

    topogigio Member

  3. till

    till Super Moderator Staff Member ISPConfig Developer

    These are all files on ISPConfig side. Unless you let other services like postfix etc. connect to the master database server directly, but normally each slave node has its own local database, so these services do not connect to the master database directly then.
     
  4. topogigio

    topogigio Member

    Thanks. I didn't change nothing: only clear setup using the guide.

    BTW my slave nodes don't use a local database, but also them are using personal databases running on the same central MariaDB I will dismiss. I understand now that it is not maybe the best way to implement ISPConfig, but when I started to work with it, it seemed good to use existing MariaDB dedicated server and avoid to setup a lot of small other MariaDBs on every Web/Mail node.
    So I will need later to move also the nodes DBs as the master. I see that node db configs are also in that same files, and I will only be required to "migrate" logins, password and permissions from the old MariaDB to the new one, because all that settings has been created by the setup script and not by me.

    Anything else I miss?
    Thanks
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    The reason why we use a DB on each node is that the setup is more fault-tolerant, and it is faster and also scales better.

    The node db's are used in many different service files, best do a recursive grep for the old db server hostname in /etc directory to find all occurrences on each node.
     
  6. topogigio

    topogigio Member

    Thanks, I found only some references in dovecot config.
     
  7. topogigio

    topogigio Member

    I did change one email server. It seems "quite ok": dovecot is up, and ispconfig processes commands.

    But if I run ispconfig_update.sh --force to test it, it fails as"
    ERROR 1046 (3D000) at line 35: No database selected
    mysqldump: Got error: 1049: "Unknown database 'ispconfig-xxxxx'" when selecting the database"

    I removed any reference to old server in config files, so I cannot understand where the problem come from.
    any idea?
     
  8. topogigio

    topogigio Member

    the problem was mysql_clientdb.conf, that was pointing to the "master" mariadb node (the old server where there is the master DB), and may be point to the "slave" node (the new server where I moved the slave DB).
    The thing that made me crazy is that every error during tests with update script, and also diag script, referred to problems accessing the master DB. Instead the problem was accessing the slave node with root credentials.

    It seems ok now. I hope it will run without hidden problems :)
     

Share This Page