IT

(도커에 있는) 매리아드데이터베이스 수정 또는 재설정?

itgroup 2023. 10. 20. 13:35
반응형

(도커에 있는) 매리아드데이터베이스 수정 또는 재설정?

공식 mariadb docker 이미지를 사용하고 있으며 최신 버전(10.5.8)으로 업데이트한 후 손상에 대한 오류가 발생하기 시작했습니다(아래 로그 참조).이전 mariadb 버전으로 다운그레이드 할 때도 이런 현상이 지속되니 데이터베이스 손상이 아닐까요?

수정할 방법이 있습니까? 만약 없다면 데이터베이스를 재설정하는 방법은 무엇입니까? (데이터베이스에서 데이터가 손실되는 것은 세상의 끝이 아니라 mariadb 컨테이너가 작동하지 않는 경우입니다.)

로그(반복):

2020-11-18 15:45:35+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.8+maria~focal started.
2020-11-18 15:45:35+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-11-18 15:45:35+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.8+maria~focal started.
2020-11-18 15:45:36 0 [Note] mysqld (mysqld 10.5.8-MariaDB-1:10.5.8+maria~focal) starting as process 1 ...
2020-11-18 15:45:36 0 [Note] InnoDB: Using Linux native AIO
2020-11-18 15:45:36 0 [Note] InnoDB: Uses event mutexes
2020-11-18 15:45:36 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-11-18 15:45:36 0 [Note] InnoDB: Number of pools: 1
2020-11-18 15:45:36 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
2020-11-18 15:45:36 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2020-11-18 15:45:36 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2020-11-18 15:45:36 0 [Note] InnoDB: Completed initialization of buffer pool
2020-11-18 15:45:36 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-11-18 15:45:36 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=20174219501,20174219501
2020-11-18 15:45:36 0 [Note] InnoDB: Starting final batch to recover 3205 pages from redo log.
2020-11-18 15:45:36 0 [ERROR] InnoDB: Not applying INSERT_REUSE_REDUNDANT due to corruption on [page id: space=0, page number=2062]
2020-11-18 15:45:36 0 [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore corruption.
2020-11-18 15:45:36 0 [ERROR] InnoDB: Not applying INSERT_REUSE_REDUNDANT due to corruption on [page id: space=0, page number=2062]
2020-11-18 15:45:36 0 [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore corruption.
2020-11-18 15:45:36 0 [ERROR] InnoDB: Not applying INSERT_REUSE_REDUNDANT due to corruption on [page id: space=0, page number=2062]
2020-11-18 15:45:36 0 [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore corruption.
2020-11-18 15:45:36 0 [ERROR] InnoDB: Not applying INSERT_REUSE_REDUNDANT due to corruption on [page id: space=0, page number=2062]
2020-11-18 15:45:36 0 [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore corruption.
2020-11-18 15:45:36 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2020-11-18 15:45:36 0 [Note] InnoDB: Starting shutdown...
2020-11-18 15:45:37 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-11-18 15:45:37 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-11-18 15:45:37 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-11-18 15:45:37 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-11-18 15:45:37 0 [ERROR] Aborting

그리고 이 도커 컴포지트를 사용합니다.yaml:

  hass_db:
    image: mariadb:latest
    # image: mariadb:10.5.4
    # image: mariadb:10.4.14
    container_name: hass_db
    environment:
      MYSQL_ROOT_PASSWORD: Maria4sud0
      MYSQL_DATABASE: homeassistant
      MYSQL_USER: homeassistant
      MYSQL_PASSWORD: Maria4HAss
    restart: on-failure
    volumes:
      - /mnt/data/docker/hass_db:/var/lib/mysql
    networks:
      mynet:
        ipv4_address: 172.11.0.7

언급URL : https://stackoverflow.com/questions/64896543/mariadb-in-docker-corruption-fix-or-reset-database

반응형