1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

After server reboot session table always corrupts

Discussion in 'Server Configuration and Hosting' started by Big Dan, Feb 2, 2015.

  1. Big Dan

    Big Dan Active Member

    Hi Guys,

    I see an issue on my server and am not sure if it's just me or other people see the same problem. Every time I have to reboot my VPS when it comes back online the session table is corrupted and has to be repaired. A quick mySQL repair fixes it but I'm wondering why it happens and if it can be prevented.

    I've tried both turning the forum off before reboot and not. It doesn't seem to have an effect. Is there something I can to do prevent this? I'm running a vanilla WHM install atop CentOS.

    Thanks,
    Dan
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Are you stopping and starting MySQL correctly?
     
  3. Big Dan

    Big Dan Active Member

    I assume I'd have to do that from the command line? WHM only gives the option to restart the service not start/stop.
     
  4. rainmotorsports

    rainmotorsports Well-Known Member

    The question is it shutting down properly when you issue a reboot to the vps. All critical applied actions need to be shutting down properly before the vps decides to restart. I am sure there are logs for the shutdown as well as mysql logging wether or not it shutdown properly. If its just getting killed you are always risking corruption.
     
  5. The Dark Wizard

    The Dark Wizard Well-Known Member

    According to the WHM Manuel, a graceful reboot will first wait for all connections to come to an end and then it stops mysql and other processes before rebooting the server.

    If you aren't using the Graceful one try that. Your table should stop corrupting.
     
    Big Dan likes this.
  6. melbo

    melbo Well-Known Member

    I run Fedora:
    Code:
    service mysqld stop
    service mysqld start
     
    Big Dan and The Dark Wizard like this.
  7. Big Dan

    Big Dan Active Member

    Thanks Guys. I'm using the Solus VM Control Panel my host provides to restart. I guess it's too much to expect it to wait for everything exit gracefully. :confused:

    If I stop mySQL from the command line doesn't cPanel try to "automagicly" restart it?

    Would I be better off just doing a shutdown -r 0 as root?
     
  8. melbo

    melbo Well-Known Member

    I stop Apache and mysqld and then reboot system after counting to 10 or so. I don't like to take chances with abrupt shutdowns.

    I don't use a CP though so am not sure what options you have in cpanel.
     
    Big Dan likes this.
  9. Big Dan

    Big Dan Active Member

    Thanks Melbo. When cPanel detects a critical service (apache, mysql, imap, etc) has stopped or crashed it tries to restart it automatically. I'm going to talk to my host and see if I'm working from the command line does the CP still try and restart. If so, how do I prevent that from happening.
     
  10. Luke F

    Luke F Well-Known Member

    If I'm not mistaken that will be the equivalent of a hard reboot, and you should only do it when rebooting via other means (SSH) is impossible
     
    Big Dan likes this.
  11. Big Dan

    Big Dan Active Member

    Ah, thanks for the tip. I'll definitely use WHM's graceful reboot feature from now on.
     
  12. The Forum Heroes

    The Forum Heroes Well-Known Member

    You should only ever reboot from SolusVM or WHM in the event the server is not responsive to SSH. Using graceful in WHM is lighter then doing a hard reboot, but it doesn't verify the process had stopped so it can still and often have the effect of a hard reboot, esp if you have a lot of open httpd connections or larger databases. Command line is the safest way.
     
    SneakyDave likes this.
  13. Big Dan

    Big Dan Active Member

    Thanks Mike. I'm a little confused if I reboot from the CL, cPanel won't try to restart the processes as the server is stopping them?
     
  14. Tracy Perry

    Tracy Perry Well-Known Member

    I don't use a panel... But I've always done a shutdown -r now (since i'm the only user) on the system. It always shuts down the associated services and then restarts the server.

    Command issued from SSH CLI
    Screen-Shot-2015-02-03-at-5.48.43-PM.jpg

    Results of the command as I'm monitoring the VM in a console from my ProxMox center
    Screen-Shot-2015-02-03-at-5.48.34-PM.jpg
     
  15. The Forum Heroes

    The Forum Heroes Well-Known Member

    As Tracy said. Just use shutdown -r now -r will prevent any process from restarting during the stopping process to reboot
     
    Big Dan likes this.
  16. MattW

    MattW Well-Known Member

    Not quite
    Code:
    DESCRIPTION
           shutdown arranges for the system to be brought down in a safe way.  All logged-in users are notified that the system is going down and, within the last five minutes of TIME, new logins are prevented.
    
           TIME  may have different formats, the most common is simply the word 'now' which will bring the system down immediately.  Other valid formats are +m, where m is the number of minutes to wait until shutting
           down and hh:mm which specifies the time on the 24hr clock.
    
           Once TIME has elapsed, shutdown sends a request to the init(8) daemon to bring the system down into the appropriate runlevel.
    
           This is performed by emitting the runlevel(7) event, which includes the new runlevel in the RUNLEVEL environment variable  as  well  as  the  previous  runlevel  (obtained  from  the  environment  or  from
           /var/run/utmp)  in  the  PREVLEVEL variable.  An additional INIT_HALT variable may be set, this will contain the value HALT when bringing the system down for halt and POWEROFF when bringing the system down
           for power off.
    
    OPTIONS
           -r     Requests that the system be rebooted after it has been brought down.
    
           -h     Requests that the system be either halted or powered off after it has been brought down, with the choice as to which left up to the system.
    
           -H     Requests that the system be halted after it has been brought down.
    
           -P     Requests that the system be powered off after it has been brought down.
    
           -c     Cancels a running shutdown.  TIME is not specified with this option, the first argument is MESSAGE.
    
           -k     Only send out the warning messages and disable logins, do not actually bring the system down.
     
  17. The Forum Heroes

    The Forum Heroes Well-Known Member

    yeah yeah.. but it also stops processes from restarting during the shutdown :p
     
  18. Tracy Perry

    Tracy Perry Well-Known Member

    Shutdown should be fully compliant with a clean shutdown - halting any and all running processes and then performing the appropriate choice of restart, halt or powered down.
    When issuing it, I've never had any problems with corruption on a Debian system nor the 3 CentOS systems I have set up.
     
  19. RoldanLT

    RoldanLT Well-Known Member

    I just always use this command on ssh "reboot".
    :rolleyes:
    Any disadvantage on that command? :cautious:
     
  20. Tracy Perry

    Tracy Perry Well-Known Member

    From the man reboot
    man shutdown

    I'll use shutdown myself due to the fact that's what I'm used to.
     
    Dryline likes this.

Share This Page