Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

mysql 5.6 to mariadb 10.1.x centos 7.x datadir issue

Discussion in 'Database Discussion' started by jsparks, Nov 9, 2017.

Tags:
  1. jsparks

    jsparks Member

    Joined:
    Sep 16, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Halifax
    cPanel Access Level:
    Root Administrator
    I'm looking to upgrade/switch away from MySQL 5.6 in favor of MariaDB 10.1.x however, I received the following fatal error:

    As of MariaDB 10.1.16, the data directory cannot reside in /home, /usr, /etc, /boot, or /root directories on systemd equipped systems. You must move your MySQL data directory outside of these directories before continuing with this upgrade.

    I understand from a bit of research that this might be related to the default SELinux permissions but not exactly sure.

    My question and issue is that my sql datadir is >170gb, and I don't have another partition other than /home to move it to. Is there anyway I can work around this, perhaps a symlink??

    After a couple hours of googling I've hit a wall, surely someone else has encountered this, and was able to persevere?

    Thanks in advance!
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Using a data directory within /home, /usr, /etc, /boot, or /root is unsupported because of changes in MariaDB that would lead to it failing to start (MariaDB uses a default systemd unit configuration that enables the "ProtectSystem" and "ProtectHome" features). Unfortunately, the only supported workaround in your case would be to setup a new server with an updated partition scheme with enough space for your databases in /var/lib/mysql and then migrate the accounts to it via "WHM >> Transfer Tool".

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jsparks

    jsparks Member

    Joined:
    Sep 16, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Halifax
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    If mysql datadir is set to /home/mysql, could I just bind this to a different path via mount --bind? Optionally, I've read that setting ProtectHome=false in /usr/lib/systemd/system/mariadb.service could do the trick.

    I've not tested either of these options in CPanel, but would you know if either of these methods would provide a stop-gap solution?

    Thanks
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    While unsupported, setting up a bind mount to point /var/lib/mysql/ to the desired /home/ directory should allow it to work until you've had a chance to increase the size of your /var/ partition or migrate to a server with a new partition scheme.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Kurieuo

    Kurieuo Well-Known Member

    Joined:
    Dec 13, 2002
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Australia
    I've read its good to avoid bind mounting unless necessary since it can look like just a second copy. Is there any downside to this with cPanel detecting database sizes or the like? Is there any real disadvantage to bind mounting the mysql folder?

    I find myself in a similar situation where I need to move the var/lib/mysql folder (or maybe logs would be a better option for now) because I just overlooked the mysql folder in a rushed server move.
     
  6. Kurieuo

    Kurieuo Well-Known Member

    Joined:
    Dec 13, 2002
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Australia
    JS, how did your move go? Any issues noticed since?
     
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Kurieuo,

    The downside is that we don't test cPanel & WHM on environments where the MySQL data directory is configured as a bind mount. While I've not seen reports of any problems with this setup, it's not something we routinely test against. I recommend against setting up the bind mount for this purpose if at all possible. It's only intended as a temporary workaround until you have an opportunity to add a new mount with additional space or migrate the accounts to a server with a new partition scheme.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice