简体   繁体   English

由于 Innodb 错误,MariaDB docker 未启动

[英]MariaDB docker not starting due to Innodb error

I have a local docker environment (MAC) for my Laravel set-up.我的 Laravel 设置有一个本地 docker 环境 (MAC)。 The mariadb container in docker-compose.yml is defined as docker docker-compose.yml中的 mariadb 容器定义为

    image: mariadb:10.6
    container_name: ct-mariadb
    restart: unless-stopped
    ports:
      - "3306:3306"
    volumes:
      - ./docker/storage/mysql:/var/lib/mysql
    environment:
      MYSQL_DATABASE: ....
      MYSQL_USER: ....
      MYSQL_PASSWORD: ....
      MYSQL_ROOT_PASSWORD: ....
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    networks:
      - laravel

The set-up used to work fine, but after testing some manual DB changes it corrupted.该设置过去可以正常工作,但在测试了一些手动数据库更改后,它已损坏。 When (re-)starting the containers via docker-compose up -d --build the mariadb container fails to start.当通过 docker docker-compose up -d --build (重新)启动容器时,mariadb 容器无法启动。 In the container logs the following can be found:在容器日志中可以找到以下内容:

2022-05-05 23:13:17+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2022-05-05 23:13:18+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:18+00:00 [Note] [Entrypoint]: MariaDB upgrade not required

2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:19+00:00 [Note] [Entrypoint]: MariaDB upgrade not required

2022-05-05 23:13:20+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:20+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2022-05-05 23:13:20+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.7+maria~focal started.

2022-05-05 23:13:21+00:00 [Note] [Entrypoint]: MariaDB upgrade not required

2022-05-05 23:13:18 0 [Note] mariadbd (server 10.6.7-MariaDB-1:10.6.7+maria~focal) starting as process 1 ...

2022-05-05 23:13:18 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive

2022-05-05 23:13:18 0 [Note] InnoDB: Compressed tables use zlib 1.2.11

2022-05-05 23:13:18 0 [Note] InnoDB: Number of pools: 1

2022-05-05 23:13:18 0 [Note] InnoDB: Using ARMv8 crc32 + pmull instructions

2022-05-05 23:13:18 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)

2022-05-05 23:13:18 0 [Note] InnoDB: Using Linux native AIO

2022-05-05 23:13:18 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728

2022-05-05 23:13:18 0 [Note] InnoDB: Completed initialization of buffer pool

2022-05-05 23:13:18 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=507568654,515471506

2022-05-05 23:13:18 0 [ERROR] InnoDB: Missing FILE_CREATE, FILE_DELETE or FILE_MODIFY before FILE_CHECKPOINT for tablespace 230

2022-05-05 23:13:18 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption

2022-05-05 23:13:18 0 [Note] InnoDB: Starting shutdown...

2022-05-05 23:13:19 0 [ERROR] Plugin 'InnoDB' init function returned error.

2022-05-05 23:13:19 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2022-05-05 23:13:19 0 [Note] Plugin 'FEEDBACK' is disabled.

2022-05-05 23:13:19 0 [ERROR] Unknown/unsupported storage engine: InnoDB

2022-05-05 23:13:19 0 [ERROR] Aborting

I've tried to delete all containers, images and volumes several times via the Docker Desktop UI and with docker rm -f $(docker ps -a -q) docker rmi -f $(docker images -q) but after starting up the containers I get the exact same error again.我尝试通过 Docker 桌面 UI 和docker rm -f $(docker ps -a -q) docker rmi -f $(docker images -q)多次删除所有容器、图像和卷,但在启动容器我再次得到完全相同的错误。

I fail to understand why/how after completely deleting all containers, images and volumes this error can still come back.我不明白为什么/如何在完全删除所有容器、图像和卷之后,这个错误仍然会再次出现。

Any help is much appreciated.任何帮助深表感谢。

For who it might help.....对谁有帮助......

Although I cleaned the docker containers, images and volumes with the below commands.尽管我使用以下命令清理了 docker 容器、图像和卷。

docker rm -f $(docker ps -a -q)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)
docker system prune

My mariadb definition referred to a local volume located in ./docker/storage/mysql我的 mariadb 定义引用了位于 ./docker/storage/mysql 中的本地卷

  mariadb:
image: mariadb:10.6
container_name: ct-mariadb
restart: unless-stopped
ports:
  - "3306:3306"
volumes:
  - ./docker/storage/mysql:/var/lib/mysql
environment:
  MYSQL_DATABASE: homestead
  MYSQL_USER: homestead
  MYSQL_PASSWORD: secret
  MYSQL_ROOT_PASSWORD: secret
  SERVICE_TAGS: dev
  SERVICE_NAME: mysql
networks:
  - laravel

After cleaning my project docker >> storage folder (basically getting a fresh pull of my project. I could start the docker again without the above errors.清理我的项目 docker >> storage 文件夹后(基本上是重新提取我的项目。我可以再次启动 docker 而不会出现上述错误。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM