sourcecode

MariaDB: 시작 후 바로 종료

copyscript 2022. 9. 14. 22:22
반응형

MariaDB: 시작 후 바로 종료

그래서 mariadb를 시작하려고 하면 다음과 같은 일이 일어납니다.

Job for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

systemctl status mariadb.service 는 다음과 같이 표시됩니다.

    * mariadb.service - MariaDB database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Mon 2019-02-18 10:11:09 UTC; 4min 1s ago
  Process: 779 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 692 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]
  Process: 690 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 689 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 779 (code=exited, status=0/SUCCESS)

Feb 18 10:09:36 vps-zap348646-1 systemd[1]: Starting MariaDB database server...
Feb 18 10:09:37 vps-zap348646-1 mysqld[779]: 2019-02-18 10:09:37 140439143227328 [Note] /usr/sbin/mysqld (mysqld 10.1.29-MariaDB-6ubuntu2) starting as process
Feb 18 10:11:07 vps-zap348646-1 systemd[1]: mariadb.service: Start operation timed out. Terminating.
Feb 18 10:11:09 vps-zap348646-1 systemd[1]: mariadb.service: Failed with result 'timeout'.
Feb 18 10:11:09 vps-zap348646-1 systemd[1]: Failed to start MariaDB database server.

journalctl -xe는 다음을 나타냅니다.

Feb 18 10:17:09 vps-zap348646-1 systemd[1]: Starting MariaDB database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mariadb.service has begun starting up.
Feb 18 10:17:10 vps-zap348646-1 mysqld[940]: 2019-02-18 10:17:10 139827003494336 [Note] /usr/sbin/mysqld (mysqld 10.1.29-MariaDB-6ubuntu2)
Feb 18 10:18:39 vps-zap348646-1 systemd[1]: mariadb.service: Start operation timed out. Terminating.
Feb 18 10:18:41 vps-zap348646-1 systemd[1]: mariadb.service: Failed with result 'timeout'.
Feb 18 10:18:41 vps-zap348646-1 systemd[1]: Failed to start MariaDB database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mariadb.service has failed.
--
-- The result is RESULT.

마지막으로 error.log in mysql:

2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: The InnoDB memory heap is disabled
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Using Linux native AIO
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Using SSE crc32 instructions
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Initializing buffer pool, size = 1.0G
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Completed initialization of buffer pool
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Highest supported file format is Barracuda.
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: 128 rollback segment(s) are active.
2019-02-18 10:17:10 139827003494336 [Note] InnoDB: Waiting for purge to start
2019-02-18 10:17:10 139827003494336 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.2 started; log sequence number 103241    029
2019-02-18 10:17:10 139827003494336 [Note] Plugin 'FEEDBACK' is disabled.
2019-02-18 10:17:10 139825235617536 [Note] InnoDB: Dumping buffer pool(s) not yet started
2019-02-18 10:17:10 139827003494336 [Note] Server socket created on IP: '127.0.0.1'.
2019-02-18 10:17:10 139827003494336 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.1.29-MariaDB-6ubuntu2'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Ubuntu 18.10
2019-02-18 10:18:39 139827002763008 [Note] /usr/sbin/mysqld: Normal shutdown

2019-02-18 10:18:39 139827002763008 [Note] Event Scheduler: Purging the queue. 0 events
2019-02-18 10:18:39 139825283266304 [Note] InnoDB: FTS optimize thread exiting.
2019-02-18 10:18:39 139827002763008 [Note] InnoDB: Starting shutdown...
2019-02-18 10:18:39 139827002763008 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2019-02-18 10:18:41 139827002763008 [Note] InnoDB: Shutdown completed; log sequence number 103241039
2019-02-18 10:18:41 139827002763008 [Note] /usr/sbin/mysqld: Shutdown complete

내가 눈이 멀었거나 오류가 없고 mariadb가 작동하지 않는다.너희 중 한 명이 좋은 생각이 있을 거야감사합니다.

편집:

일단 해결책을 찾았습니다.시작 시 타임아웃으로 인해 mariadb가 셧다운되어 있기 때문에 타임아웃을 0으로 설정했습니다.현재로서는 이 해결책으로 충분하지만 진정한 해결책이 있을 것이다.

10.1.10 이후 MariaDB는 systemd를 사용하여 서비스를 시작합니다./etc/init.d/mysql 스크립트는 더 이상 사용되지 않으므로 MYSQLD_STARTUP_TIMEOUT은 영향을 미치지 않습니다.

당신은 당신의 마리아답이 필요해요.서비스 파일이 예에서는 타임아웃이 포함되어 있지 않기 때문에 MariaDB 디폴트가 사용되고 있었습니다.추가만 하면 됩니다./etc/systemd/system/mariadb.service.d/override.conf파일링 후 그 안에 넣습니다.

[Service]
TimeoutStartSec = 0

[Service] 섹션은 타임아웃되지 않습니다.파일을 작성한 후:

# systemctl daemon-reload
# systemctl restart mysql.service

언급URL : https://stackoverflow.com/questions/54745076/mariadb-shutdown-right-after-start

반응형