์๋ฌ ๋ด์ฉ
root@db-server:~# systemctl status mariadb.service
โ mariadb.service - MariaDB 10.5.8 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 Mon 2021-05-31 11:14:34 KST; 24s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 7202 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Process: 7199 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 3655 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 3422 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 3416 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 3393 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 3655 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
May 31 11:14:34 db-server mariadbd[3655]: 2021-05-31 11:14:34 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
May 31 11:14:34 db-server mariadbd[3655]: 2021-05-31 11:14:34 0 [ERROR] Plugin 'InnoDB' init function returned error.
May 31 11:14:34 db-server mariadbd[3655]: 2021-05-31 11:14:34 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
May 31 11:14:34 db-server mariadbd[3655]: 2021-05-31 11:14:34 0 [Note] Plugin 'FEEDBACK' is disabled.
May 31 11:14:34 db-server mariadbd[3655]: 2021-05-31 11:14:34 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
May 31 11:14:34 db-server mariadbd[3655]: 2021-05-31 11:14:34 0 [ERROR] Failed to initialize plugins.
May 31 11:14:34 db-server mariadbd[3655]: 2021-05-31 11:14:34 0 [ERROR] Aborting
May 31 11:14:34 db-server systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 31 11:14:34 db-server systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 31 11:14:34 db-server systemd[1]: Failed to start MariaDB 10.5.8 database server.
์์ธํ์
MySQL data ๋๋ ํ ๋ฆฌ๋ฅผ ๋ฎ์ด์ฐ๊ธฐ ํด๋๊ณ service mysql restart๋ฅผ ์คํํ๋๋ ๋ฐ์ํ ์๋ฌ์ด๋ค. ์ด ๊ฒฝ์ฐ ๊ธฐ์กด์ data ๋๋ ํ ๋ฆฌ๋ ์์ ์๊ฐ mysql์ธ๋ฐ root ๊ถํ์ผ๋ก ๋ฎ์ด์ฐ๊ธฐ ํ๋ ๋ฐ๋์ ์์ ์๊ฐ root๋ก ๋์ด์์ด์ mysql ์๋น์ค์์ ์ ๊ทผํ์ง ๋ชปํ์ฌ ๋ฐ์ํ ์๋ฌ์ด๋ค. ์ด ๊ฒฝ์ฐ mysql์ด ๋ฐ์ดํฐ ํด๋์ ์ ๊ทผ์ด ๋ถ๊ฐ๋ฅํ๊ธฐ ๋๋ฌธ์ ์ค์ ๋ก data ๋๋ ํ ๋ฆฌ์ mysql ๋ฐ์ดํฐ๋ฒ ์ด์ค๊ฐ ์์์๋ ์๋ค๊ณ ์๋ฌ๋ฅผ ๋ฑ์ด๋ธ๋ค.
ํด๊ฒฐ๋ฐฉ์
data ๋๋ ํ ๋ฆฌ์ ์์ ์๋ฅผ mysql๋ก ๋ณ๊ฒฝํด์ค๋ค.
# chown -R mysql:mysql /mariadb/data