The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changing value of datadir on a cpanel production box

Discussion in 'General Discussion' started by hariskhan, Apr 15, 2006.

  1. hariskhan

    hariskhan Well-Known Member

    Joined:
    Apr 15, 2004
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    This is a fbsd 5.4 box with cpanel's latest edition, recently installed.

    I have my servers setup like the following;

    /usr has about 20 GB, /var has about 8 GB space, /home has about 160 GB of space

    To my knowledge, cpanel runs /scripts/upcp every 7 hours (it was once every 24 hrs in the old days)

    I need to store all the mysql databases on /home, so there wouldn't be a limitation of space, if the databases for the portals I host grow further up.

    I have so far no custom settings mentioned in /etc/my.cnf on cpanel boxes.

    My question are;

    - If I make a change like datadir=/home/db (or some folder under /home) and restart mysql daemon, will it be over-written by cpanel when /scripts/upcp runs? (Does cpanel take into account the changes I'v made in /etc/my.cnf or over-write them to its factory defaults)

    or

    would those changes stay ...

    - In what event would those changes be over-written? (as a precaution)
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    cPanel doesn't touch /etc/my.cnf so you can make those changes there. The alternative is to move /var/lib/mysql to /home/mysql (remove /var/lib/mysql) and create a symlink to it:

    ln -s /home/mysql /var/lib/mysql

    This avoids configuration file changes.

    /scripts/upcp should only be running every 24 hours. If it is running more frequently you need to check the root cron job.
     
  3. eger

    eger Well-Known Member

    Joined:
    Feb 28, 2003
    Messages:
    128
    Likes Received:
    0
    Trophy Points:
    16
    I ran into a similar issue on a FBSD cPanel box where I ran out of /var space for mysql. I backup up my db dir then moved it to the /home partition and created a symlink just as Chirpy suggested and it worked just fine.
     
Loading...

Share This Page