MariaDB Mati, Bagaimana Cara Backup Database?


luncur

Beginner 2.0
Hai teman-teman. Hari ini saya menghadapi kejadian yang kurang mengenakkan. Salah Satu VPS saya di Linode, yang berjalan dengan Centminmod tadi pagi hardisknya penuh, lalu Mariadb-nya tiba-tiba mati. Saya kira setelah menambah hardisk Mariadb akan up lagi, sayangnya tidak. Segala tutorial di internet udah coba, belum ada yang berhasil. Bahkan untuk mysqldump-pun tidak bisa. Coba innodb_force_recovery = 1 juga tidak bisa. Takut juga. Cuma sampai proses mysqldump yang gagal nggak berani terusin lagi karena gimana restornya?



Ini saat hardisk penuh
Code:
df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/root      ext4       47G   46G     0 100% /
devtmpfs       devtmpfs  2.0G     0  2.0G   0% /dev
tmpfs          tmpfs     2.0G     0  2.0G   0% /dev/shm
tmpfs          tmpfs     2.0G  8.7M  2.0G   1% /run
tmpfs          tmpfs     2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/loop0     ext4      5.8G   25M  5.5G   1% /tmp
tmpfs          tmpfs     394M     0  394M   0% /run/user/0
 

luncur

Beginner 2.0
mysqlrestart

Code:
[23:08][[email protected] ~]# mysqlrestart
Restarting mysql (via systemctl):  Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
                                                           [FAILED]

Code:
mysql -v input
[23:03][[email protected] ~]# mysql -v
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")
 

luncur

Beginner 2.0
Code:
[06:51][[email protected] ~]# mysqldump --all-databases > /home/mysqlbackup/alldatabases.sql
mysqldump: Got error: 2002: "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")" when trying to connect
[06:57][[email protected] ~]#

journalctl -u mariadb --no-pager

Code:
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: tablespace but not the InnoDB log files. See
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: for more information.
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: 2019-04-01 04:46:52 7f6f0ad6e900 InnoDB: Error: page 282 log sequence number 179057809143
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: is in the future! Current system log sequence number 178723624540.
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: tablespace but not the InnoDB log files. See
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: for more information.
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: 2019-04-01 04:46:52 7f6f0ad6e900 InnoDB: Error: page 1184 log sequence number 179057809143
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: is in the future! Current system log sequence number 178723624540.
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: tablespace but not the InnoDB log files. See
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
Apr 01 04:46:52 sg2.domain.com mysqld[26047]: InnoDB: for more information.
Apr 01 04:46:55 sg2.domain.com systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Apr 01 04:46:55 sg2.domain.com systemd[1]: Failed to start MariaDB 10.1.38 database server.
Apr 01 04:46:55 sg2.domain.com systemd[1]: Unit mariadb.service entered failed state.
Apr 01 04:46:55 sg2.domain.com systemd[1]: mariadb.service failed.
 

luncur

Beginner 2.0
Apakah ada tuan-tuan yang pernah mengalami hal serupa? Bagaimana cara menyelamatkan databasenya kalau server mariadb-nya mati?
 

luncur

Beginner 2.0
Ga bisa dump/start service karena disknya kepenuhan
Coba hapus data2 yg ga pakai dlu seperti misalnya logs/backup atau cari data yg gede yg ga pakai
Jika sdh ada ruang, baru start servicenya lg
Disknya sudah saya gandakan tuan. Sekarang lowong lebih dari 50%, tapi Mariadb tetap tidak bisa start, restart dll . :(
 

luncur

Beginner 2.0
Code:
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/root      ext4      158G   52G   98G  35% /
devtmpfs       devtmpfs  3.9G     0  3.9G   0% /dev
tmpfs          tmpfs     3.9G     0  3.9G   0% /dev/shm
tmpfs          tmpfs     3.9G  8.7M  3.9G   1% /run
tmpfs          tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/loop0     ext4      5.8G   25M  5.5G   1% /tmp
tmpfs          tmpfs     797M     0  797M   0% /run/user/0
 

luncur

Beginner 2.0
systemctl status mariadb.service -l
Code:
[10:36][[email protected] ~]# systemctl status mariadb.service -l
● mariadb.service - MariaDB 10.1.38 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf, openfileslimit.conf, protecthome.conf
   Active: failed (Result: exit-code) since Mon 2019-04-01 10:36:15 UTC; 1min 42s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 3903 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 3675 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 3673 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 3903 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Apr 01 10:36:12 sg2.domain.com mysqld[3903]: 2019-04-01 10:36:12 7f4207ece900 InnoDB: Error: page 1184 log sequence number 179057809143
Apr 01 10:36:12 sg2.domain.com mysqld[3903]: InnoDB: is in the future! Current system log sequence number 178723625292.
Apr 01 10:36:12 sg2.domain.com mysqld[3903]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
Apr 01 10:36:12 sg2.domain.com mysqld[3903]: InnoDB: tablespace but not the InnoDB log files. See
Apr 01 10:36:12 sg2.domain.com mysqld[3903]: InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
Apr 01 10:36:12 sg2.domain.com mysqld[3903]: InnoDB: for more information.
Apr 01 10:36:15 sg2.domain.com systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Apr 01 10:36:15 sg2.domain.com systemd[1]: Failed to start MariaDB 10.1.38 database server.
Apr 01 10:36:15 sg2.domain.com systemd[1]: Unit mariadb.service entered failed state.
Apr 01 10:36:15 sg2.domain.com systemd[1]: mariadb.service failed.
You have new mail in /var/spool/mail/root
[10:37][[email protected] ~]#
 

Top