Discover Centmin Mod today
Register Now

Sysadmin AlmaLinux Very strange issue running mariabackup restoration

Discussion in 'System Administration' started by ElChorizo, Jan 14, 2025.

  1. ElChorizo

    ElChorizo Member

    79
    10
    8
    Apr 29, 2021
    Ratings:
    +18
    Local Time:
    9:38 AM
    1.19.10
    10.3.28
    I've been using mariabackup to do database backups on our larger sites. Think 27GB databases.

    The first time I tried to use this tool I ran into a lot of issues... I was moving from a CentOS 7 machine to Alma Linux 9. The mariadb daemon was failing because upon restoration there was a version mismatch and most of the instructions didn't mention that I needed to run mariadb-upgrade. After I figured that out, restoration and daemon restart proceeded.

    However, Xenforo wouldn't connect because it would give me the error that it was unable to connect to the database. I could connect from the command line, but Xenforo refused to connect.

    I did the nprestart... mysql restart. I even changed the config.php to use root credentials and still the basic can't connect error.

    I rebooted the machine and it worked fine. Wow... weird, one off.

    Now this has happened on multiple machines after mariadb restoration. I have the process down, everything works... but I literally have to reboot the machine before it works sometimes. I've never seen anything like it in my life.

    Hoping someone can do some testing on this. Do a mariabackup on another machine, do a mairabackup --prepare. Copy it to a new machine, shut down mariadb, delete the mariadb, do a mariabackup --copy-back, change the permissions, restart the daemon, restart nginx/phpfpm.... and boom, error.

    Try everything to fix it, nothing. Reboot. Boom, works perfect.

    This has happened multiple times. This is on VPS and also bare metal. I've never had to reboot a linux box to fix a problem like this before, so it's very strange.

     
    Last edited: Jan 14, 2025
  2. eva2000

    eva2000 Administrator Staff Member

    58,904
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:38 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Was MariaBackup done via centmin.sh menu option 21 or outside of centmin.sh menu option 21 for the backup via MariaBackup?

    centmin.sh menu option 21 does mention MariaBackup needs to be same major versions on destination and source servers i.e. Mariadb 10.4 or 10.6 on both source and destination servers.

    Did you inspect MariaDB logs via journalctl for clues? Before reboot, what does inspecting MariaDB logs via command below give
    Code (Text):
    journalctl -u mariadb --no-pager

    and re-run command after reboot to compare

    I've never had to do reboot for MariaBackup restorations.
     
  3. ElChorizo

    ElChorizo Member

    79
    10
    8
    Apr 29, 2021
    Ratings:
    +18
    Local Time:
    9:38 AM
    1.19.10
    10.3.28
    Yup, there are zero errors. It's like PHP can't connect but doing it from command line with same credentials works fine. Very strange. Even after a php and nginx restart.

    Then a reboot, without changing a single thing and it's fixed.