MariaDB / mariadb-docker

Docker Official Image packaging for MariaDB
https://mariadb.org
GNU General Public License v2.0
759 stars 438 forks source link

Hangs on Initializing #487

Closed BrodyStone21 closed 1 year ago

BrodyStone21 commented 1 year ago

Hello, I'm trying to use mariadb with freshrss and bookstack. I can get mariadb:10.5 to work fine, but when stopping and removing the containers, deleting the old database files, and attempting to recreate everything, the database containers hang on initializing. Here is my compose for bookstack and bookstack_db.

services:
  bookstack:
    container_name: bookstack
    restart: unless-stopped
    image: linuxserver/bookstack
    environment:
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASSWORD=bookstackpass
      - DB_DATABASE=bookstackapp
      - APP_URL="bookstackurl.com"
      - PUID=1000
      - PGID=1000
    volumes:
      - /home/ubuntu/.config/bookstack:/config
    ports:
      - 6875:80
      - 3306:3306
    networks:
      proxy:
    depends_on:
      - bookstack_db
  bookstack_db:
    container_name: bookstack_db
    restart: unless-stopped
    image: mariadb:10.5
    environment:
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=bookstackpass
      - MYSQL_ROOT_PASSWORD=bookstackpass
      - TZ=America/Indianapolis
    volumes:
      - /mnt/WD_White/Server_Stuff/Databases/bookstack_db:/var/lib/mysql
    networks:
      proxy:

ouput of docker logs bookstack_db -f

2023-02-10 20:40:37-05:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.10.3+maria~ubu2204 started.
2023-02-10 20:40:41-05:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-02-10 20:40:41-05:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.10.3+maria~ubu2204 started.
2023-02-10 20:40:42-05:00 [Note] [Entrypoint]: Initializing database files

The exact same issue occurs when attempting to use the latest version of mariadb instead of 10.5. Both containers are just waiting for the database to be available. Happy to provide any additional information if you think it would be helpful.

EDIT: Can someone tell me if changing all the environmental variables from MYSQL_* to MARIADB_* does anything? Which is better? MySQL or MariaDB?

EDIT 2: It finally initialized! Any reason it takes so much longer than version 10.5 to get up and going?

grooverdan commented 1 year ago

EDIT: Can someone tell me if changing all the environmental variables from MYSQL* to MARIADB* does anything?

The effect should be exactly the same.

Which is better? MySQL or MariaDB?

MARIADB_* was added because MariaDB is the product name and not MySQL. Eventually MYSQL will be deprecated out.

It finally initialized! Any reason it takes so much longer than version 10.5 to get up and going?

There's a bit more IO as Aria became the crash safe alternative to MyISAM for the system file. The IO to gain the crash safety is lightly more. O_DIRECT is used as an innodb access mechanism rather than buffered IO, though I assume the initialization involved little reaccess of data.

Just confirming the last log entry before it finally initializes the "Initializing database files" followed by "Database files initialized" several minutes(?) later? Do you have a full log? Where is the freshrss/bookstack initialization?

I'd suspect your external USB storage is connected to a low speed USB port rather than a higher USB3 port as the main reason you are noticing an impact.