MySQL service randomly stopped - where do I check for the problem?

Discussion in 'Server Operation' started by Benji, Dec 13, 2019.

  1. Benji

    Benji New Member

    I restarted the service with
    sudo /etc/init.d/mysql start
    It seems to be working fine now.

    But I want to know what caused the service to stop? Is there a log somewhere in ISPConfig that I can check?
    Any ideas appreciated.

    Thanks.
     
  2. Steini86

    Steini86 Active Member

    As far as I know, you cannot look at the logfiles from ispconfig (although I have never tried/wanted to do so).
    Generally, it depends on your system: If it uses systemd, use journalctl to view log files: https://www.linode.com/docs/quick-answers/linux/how-to-use-journalctl/
    (journalctl -u mysql)
    If it uses initd, the logfiles are located at /var/log, where mysql should be at /var/log/mysql/
     
  3. Benji

    Benji New Member

    Hey thanks for your help.
    I discovered this in the error log file below. It seems MySQL got shutdown because of being out of memory. What does that mean? I don't know.
    • Code:
      Out of memory error: InnoDB: Fatal error: cannot allocate memory for the buffer pool
    • Code:
      InnoDB can't start without enough memory [ERROR] Plugin 'InnoDB' init function returned error. [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. [ERROR] Unknown/unsupported storage engine: InnoDB [ERROR] Aborting
    • mysqld is shutting down. Shutdown complete.
    I have found this solution, (https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04) I don't know if this is a practical working solution, but I will give it a try. Basically the tutorial is saying that I need to create a swap file. Anything else I need to do?
     
    Last edited: Dec 13, 2019
  4. Steini86

    Steini86 Active Member

    How much memory does your server have? -> "free -h".
    Important is the value at "total" and "available". You could increase the swap file, however, that will b slow. Better is to find out, what uses up all your memory and change that (or upgrade your hardware)
     
  5. Benji

    Benji New Member

    Total = 985M
    Available = 443M

    Is that good in your opinion?
     
  6. Steini86

    Steini86 Active Member

    Depends on what you want to do. Obviously it is not enough for all the things you tried to start (that is why mysql shut down)
     
  7. Benji

    Benji New Member

    What did I try to start? You mean it is not enough running ISPConfig with a Wordpress site?
     
  8. Steini86

    Steini86 Active Member

    For just one wordpress site you don't need ispconfig. ISPC "just" manages the services you have installed. ISPC itself does (almost) not use resources. It depends on your installation, if you have installed postfix/spamassassin/clamd/mysql/whatsoever .. Just for one wordpress site which does not have much visitors, 1GB ram is enough. If you are running many other services, then it is not enough. There is no single answer to your problem. YOU need to know, what you need and what you have installed ,..
    Your initial error message was, that the mysql service (which is needed for wordpress) failed due to lack of free memory.
     
  9. Benji

    Benji New Member

    I do not need the DNS services, or all of the services associated with the Email server. I think I got those services unchecked in ISPC. I'm not sure if that actually disables those services from running. If they are still running, is there a permanent way to kill them from ever running? I do want to install more Worpdress sites in the future, which is why I'm running ISPC.

    Is there a command I can run to check all the services that are running?
     
  10. Steini86

    Steini86 Active Member

    No, it disables the service from being managed by ISPC, they run then on their own.
    You can uninstall (remove) them. If you are starting with a new server I would suggest to start over from scratch and only install the services you need.
    Depends on your system. Since you don't know how to administrate a server I assume Ubuntu/Debian. If you managed to install a recent version, it will be running systemd:
    systemctl list-unit-files --state=enabled will list all enabled services (autostart).
    To see the running, services, you can use systemctl --type=service --state=running

    For more information see: https://www.tecmint.com/list-all-running-services-under-systemd-in-linux/
     

Share This Page