서버의 디스크 공간이 부족하면 MariaDB를 중지/다시 시작할 수 없습니까?

서버의 디스크 공간이 부족하면 MariaDB를 중지/다시 시작할 수 없습니까?

CentOS Stream 릴리스 8을 사용합니다.

공간을 확보했지만 내 사이트는 여전히 다음과 같이 응답합니다.Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection refused in /var/www/sites/mysite/inc/DB.php

전에도 비슷한 문제가 있었고 systemctl restart mysql일반적으로 문제를 해결했지만 몇 분 동안 아무것도 하지 않고 중단된 것처럼 보입니다. 와 같다 systemctl stop mysql.

내부적으로 뭔가 작업을 하고 있다고 가정하고 더 많은 시간을 주어야 할까요?

아니면 다른 일을 해야 하나요?

다음은 다음과 같습니다 /var/lib/mysql/mysql.err.

2022-11-18 19:15:04 1003402 [ERROR] Error writing file '/var/lib/mysql/slow_log' (errno: 28 "No space left on device")
2022-11-18 20:50:45 938512 [Warning] Aborted connection 938512 to db: 'mysite' user: 'root' host: '127.0.0.1' (Got timeout reading communication packets)
2022-11-18 20:50:45 906873 [Warning] Aborted connection 906873 to db: 'mysite' user: 'root' host: '127.0.0.1' (Got timeout reading communication packets)
2022-11-18 21:05:35 0 [Warning] mariadbd: Disk is full writing '/var/lib/mysql/aria_log.00000001' (Errcode: 28 "No space left on device"). Waiting for someone to free space... (Expect up to 60
2022-11-18 21:05:35 0 [Warning] mariadbd: Retry in 60 secs. Message reprinted in 600 secs
2022-11-18 21:15:35 0 [Warning] mariadbd: Retry in 60 secs. Message reprinted in 600 secs
2022-11-18 21:25:35 0 [Warning] mariadbd: Retry in 60 secs. Message reprinted in 600 secs
2022-11-18 21:35:35 0 [Warning] mariadbd: Retry in 60 secs. Message reprinted in 600 secs
2022-11-18 21:45:35 0 [Warning] mariadbd: Retry in 60 secs. Message reprinted in 600 secs
2022-11-18 21:55:35 0 [Warnin2022-11-19 13:05:51 0 [ERROR] mariadbd: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
2022-11-19 13:06:21 0 [ERROR] mariadbd: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_co
2022-11-19 13:06:21 0 [ERROR] Plugin 'Aria' init function returned error.
2022-11-19 13:06:21 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2022-11-19 13:06:21 0 [Note] InnoDB: Uses event mutexes
2022-11-19 13:06:21 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-11-19 13:06:21 0 [Note] InnoDB: Number of pools: 1
2022-11-19 13:06:21 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-11-19 13:06:21 0 [Note] InnoDB: Using Linux native AIO
2022-11-19 13:06:21 0 [Note] InnoDB: Initializing buffer pool, total size = 34359738368, chunk size = 134217728
2022-11-19 13:06:21 0 [Note] InnoDB: Completed initialization of buffer pool
2022-11-19 13:06:21 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1384180559603,1384180559603
2022-11-19 13:06:36 0 [Note] InnoDB: Read redo log up to LSN=1385773870592
2022-11-19 13:06:36 0 [Note] InnoDB: Ignoring data file './mysite/#sql-ib17516.ibd' with space ID 17501. Another data file called ./mysite/TBL_FULL_TEXTS.ibd exists with the same s
2022-11-19 13:06:36 0 [Note] InnoDB: Ignoring data file './mysite/#sql-ib17516.ibd' with space ID 17501. Another data file called ./mysite/TBL_FULL_TEXTS.ibd exists with the same s
2022-11-19 13:06:38 0 [Note] InnoDB: Starting final batch to recover 58536 pages from redo log.
2022-11-19 13:06:41 0 [Note] InnoDB: 128 rollback segments are active.
2022-11-19 13:06:41 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2022-11-19 13:06:41 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-11-19 13:06:41 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-11-19 13:06:41 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-11-19 13:06:41 0 [Note] InnoDB: 10.5.17 started; log sequence number 1385794764583; transaction id 262741173
2022-11-19 13:06:41 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-11-19 13:06:41 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-11-19 13:06:41 0 [ERROR] Could not open mysql.plugin table: "Unknown storage engine 'Aria'". Some plugins may be not loaded
2022-11-19 13:06:41 0 [ERROR] Failed to initialize plugins.
2022-11-19 13:06:41 0 [ERROR] Aborting

해당 2022-11-19 13:06줄은 처음 다시 시작을 시도했을 때 작성되었습니다. 잠시 후 Ctrl-C를 누르고 대신 중지를 시도했는데, 이 역시 아무 일도 하지 않는 것처럼 보이며 위의 로그 파일에 아무 것도 쓰지 않은 것 같습니다.

내용은 /var/lib/mysql다음과 같습니다.

-rw-rw---- 1 mysql mysql   32423936 Nov 19 04:59 aria_log.00000001
-rw-rw---- 1 mysql mysql         52 Nov 19 05:00 aria_log_control
-rw-rw---- 1 mysql mysql    5854594 Nov 14 12:12 ib_buffer_pool
-rw-rw---- 1 mysql mysql 1690304512 Nov 19 13:06 ibdata1
-rw-rw---- 1 mysql mysql 8589934592 Nov 19 13:06 ib_logfile0
-rw-rw---- 1 mysql mysql          0 Nov 12  2020 multi-master.info
drwx------ 2 mysql mysql       4096 Nov 12  2020 mysql
-rw-rw---- 1 mysql mysql      23122 Nov 19 13:06 mysql.err
srwxrwxrwx 1 mysql mysql          0 Nov 14 12:12 mysql.sock
-rw-r--r-- 1 root  root          15 Nov 12  2020 mysql_upgrade_info
drwx------ 2 mysql mysql       4096 Nov 12  2020 performance_schema
drwx------ 2 mysql mysql      16384 Nov 19 05:00 mysite
-rw-rw---- 1 mysql mysql 1028366336 Nov 19 04:55 slow_log
-rw-rw---- 1 mysql mysql          8 Nov 14 12:12 web1.pid

systemctl status mysql:

● mariadb.service - MariaDB 10.5.17 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
   Active: deactivating (final-sigterm) (Result: exit-code) since Sat 2022-11-19 05:00:05 GMT; 8h ago
     Docs: man:mariadbd(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 1695715 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 1966403 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 1966249 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_ST>
  Process: 1966248 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 1966403 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"
    Tasks: 8 (limit: 821928)
   Memory: 7.6G
   CGroup: /system.slice/mariadb.service
           ├─1950524 /usr/sbin/mariadbd
           └─1950718 /usr/sbin/mariadbd

Nov 19 13:05:51 web1.mysite.com systemd[1]: Starting MariaDB 10.5.17 database server...
Nov 19 13:05:51 web1.mysite.com systemd[1]: mariadb.service: Found left-over process 1950524 (mariadbd) in control group while starting unit. Ignoring.
Nov 19 13:05:51 web1.mysite.com systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Nov 19 13:05:51 web1.mysite.com systemd[1]: mariadb.service: Found left-over process 1950718 (mariadbd) in control group while starting unit. Ignoring.
Nov 19 13:05:51 web1.mysite.com systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Nov 19 13:05:51 web1.mysite.com mariadbd[1966403]: 2022-11-19 13:05:51 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.17-MariaDB-log) starting as process 1966403 ...
Nov 19 13:05:51 web1.mysite.com mariadbd[1966403]: 2022-11-19 13:05:51 0 [Warning] Could not increase number of max_open_files to more than 32768 (request: 33323)
Nov 19 13:05:51 web1.mysite.com mariadbd[1966403]: /usr/sbin/mariadbd: One can only use the --user switch if running as root
Nov 19 13:06:44 web1.mysite.com systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Nov 19 13:21:44 web1.mysite.com systemd[1]: mariadb.service: State 'stop-sigterm' timed out. Skipping SIGKILL.

내가 취할 수 있는 최선의 조치는 무엇입니까? 감사합니다!

답변1

Unix 기반 서버의 "공간 만들기"에 대한 참고 사항입니다.

  1. 프로그램이 파일을 엽니다(예: 느린 로그)
  2. 당신은 rm파일입니다.
  3. 그것은 어떤 것에서도 사라집니다 ls.
  4. 그러나 해당 프로그램이 종료될 때까지(정상적으로든 아니든) 디스크는 해제되지 않습니다.

느린 로그를 "볼" 수 있기 때문에 거기에 갇혀 있다고 생각하지 않습니다. 그러나 이 문제는 나중에 처리해야 합니다.

에 대한 참고 사항입니다 /tmp.

이는 별도의 "디스크 파티션"에 할당되는 경우가 많습니다. ALTERing큰 테이블5월/tmp를 채우고 비밀스럽게 "테이블이 꽉 찼습니다"라고 주장합니다.

그러나 그것은 문제가 아닌 것 같습니다.

다른 파일을 둘러보세요.

  • 다른 제품의 캐시 지우기
  • 다른 것 제거하기

관련 정보