2017-09-14 105 views
1

希望有人能帮助我:状态:“MariaDB的服务器停机”

我有我的服务器上运行的许多网站和我使用MariaDB的。 当我这样做:

​​

我得到:

Job for mariadb.service failed because the control process exited with 
error code. See "systemctl status mariadb.service" and "journalctl -xe" 
for details. 

systemctl状态mariadb.service

mariadb.service - MariaDB database server 

    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) 

    Drop-In: /etc/systemd/system/mariadb.service.d 
      └─migrated-from-my.cnf-settings.conf 
    Active: failed (Result: exit-code) since Thu 2017-09-14 03:16:51 UTC; 1min 6s ago 
    Process: 13247 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code= 
    Process: 13086 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/gale 
    Process: 13070 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, s 
    Process: 13033 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, st 
    Main PID: 13247 (code=exited, status=1/FAILURE) 
    Status: "MariaDB server is down" 
    CGroup: /system.slice/mariadb.service 
      └─3803 /usr/sbin/mysqld 

须藤journalctl -xe

Sep 14 03:35:51 ubuntu systemd[1]: Failed to start MariaDB database server. 
    -- Subject: Unit mariadb.service has failed 
    -- Defined-By: systemd 
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel 
    -- 
    -- Unit mariadb.service has failed. 
    -- 
    -- The result is failed. 
    Sep 14 03:35:51 ubuntu systemd[1]: mariadb.service: Unit entered failed state. 
    Sep 14 03:35:51 ubuntu sudo[13566]: pam_unix(sudo:session): session closed for user root 
    Sep 14 03:35:51 ubuntu systemd[1]: mariadb.service: Failed with result 'exit-code'. 
    Sep 14 03:35:52 ubuntu sshd[13753]: Failed password for root from 123.183.209.136 port 38816 ssh2 
    Sep 14 03:35:52 ubuntu sshd[13753]: Received disconnect from 123.183.209.136 port 38816:11: [preauth] 
    Sep 14 03:35:52 ubuntu sshd[13753]: Disconnected from 123.183.209.136 port 38816 [preauth] 
    Sep 14 03:35:52 ubuntu sshd[13753]: PAM 1 more authentication failure; logname= uid=0 euid=0 tty=ssh ruser 
    Sep 14 03:36:34 ubuntu sshd[13756]: Connection closed by 123.183.209.136 port 60477 [preauth] 
    Sep 14 03:36:36 ubuntu postfix/pickup[12161]: 703AA5C0C5: uid=0 from=<root> 
    Sep 14 03:36:36 ubuntu postfix/cleanup[12162]: 703AA5C0C5: message-id=<[email protected] 
    Sep 14 03:36:36 ubuntu postfix/cleanup[12162]: warning: 703AA5C0C5: write queue file: No space left on dev 
    Sep 14 03:36:36 ubuntu postfix/pickup[12161]: warning: maildrop/5152F5C0C4: error writing 703AA5C0C5: queu 
    Sep 14 03:37:17 ubuntu sshd[13760]: Received disconnect from 123.183.209.136 port 25567:11: [preauth] 
    Sep 14 03:37:17 ubuntu sshd[13760]: Disconnected from 123.183.209.136 port 25567 [preauth] 
    Sep 14 03:37:36 ubuntu postfix/pickup[12161]: 7764B5C0C5: uid=0 from=<root> 
    Sep 14 03:37:36 ubuntu postfix/cleanup[12162]: 7764B5C0C5: message-id=<[email protected] 
    Sep 14 03:37:36 ubuntu postfix/cleanup[12162]: warning: 7764B5C0C5: write queue file: No space left on dev 
    Sep 14 03:37:36 ubuntu postfix/pickup[12161]: warning: maildrop/5152F5C0C4: error writing 7764B5C0C5: queu 
    Sep 14 03:37:47 ubuntu sudo[13765]:  bob : TTY=pts/0 ; PWD=/home/bob ; USER=root ; COMMAND=/bin/journa 
    Sep 14 03:37:47 ubuntu sudo[13765]: pam_unix(sudo:session): session opened for user root by bob(uid=0) 
    lines 1238-1265/1265 (END) 

我真的不想失去我的分贝。 接下来应该做什么?

非常感谢

这就是DF给我:

Filesystem  1K-blocks  Used Available Use% Mounted on 
    /dev/root  49362256 46854648   0 100%/
    devtmpfs   2019828  0 2019828 0% /dev 
    tmpfs   2021768  0 2021768 0% /dev/shm 
    tmpfs   2021768 17968 2003800 1% /run 
    tmpfs    5120  0  5120 0% /run/lock 
    tmpfs   2021768  0 2021768 0% /sys/fs/cgroup 
    tmpfs    404356  0 404356 0% /run/user/1000 
    tmpfs    404356  0 404356 0% /run/user/0 
+0

您是否注意到来自postfix的警告:设备上没有剩余空间?如果postfix使用与mariadb相同的磁盘卷,那可以解释失败:磁盘已满。使用'df'确认。 –

+0

投票将此问题移至dba.stackexchange.com。堆栈溢出用于编码问题,这个问题似乎并不是一个编码问题。 –

+0

哦,非常感谢您找到根本原因。 – Henri

回答

1

见第一个文件系统(的/ dev /根)为100%满!除了tmpfs卷之外,还没有安装其他卷。所以mariadb试图在启动时向磁盘写入内容,但不能,所以它放弃并关闭。

你必须弄清楚什么是填满你的磁盘,并修剪你可以。例如,作为一个猜测,我首先查看http服务器日志,因为你说你在这个服务器上托管了很多站点。我看到许多服务器通过让httpd将所有内容记录几个月,几个月来填满磁盘空间。

将来,您可能希望为该服务器配置多个磁盘卷,因此如果一个卷填满,它不会干扰其他卷。

还考虑自动化日志旋转。

如果磁盘空间使用的罪魁祸首不是日志,而实际上是mariadb数据目录,那么您可能需要立即获取额外的磁盘卷,并将mariadb内容移动到它,然后才能使您的网站重新联机。

除非您可以在服务器的其他地方找到一些其他地方的东西,您可以在短时间内删除并留出足够的空间。

+0

太棒了!一定要配置自动日志旋转。以下是一个示例博客文章:http://www.thegeekstuff.com/2011/07/rotate-apache-logs/文件的位置可能会有所不同,具体取决于您使用的是哪种Linux版本。 –

+0

偶尔运行'df',这样你就知道你是否已经接近完成磁盘了! –