Почему MariaDB загружает настройки в течение 5-8 минут? - PullRequest
0 голосов
/ 01 октября 2019

Я хочу создать с помощью docker-compose два изображения: 1. My Spring Boot app 2. MariaDB в качестве базы данных для приложения

dockerfile для MariaDB:

FROM mariadb:latest

ADD my.cnf /etc/mysql/my.cnf
ENV MYSQL_USER test
ENV MYSQL_PASSWORD Test123456
ENV MYSQL_ROOT_PASSWORD lsagvcbjkz<kcnz
EXPOSE 3306

и docker.compose:

version: '2.1'

services:
  db:
    image: mariadb
    container_name: mariaDB
    environment:
      MYSQL_DATABASE: testdb
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
    networks:
      - backend

  app:
    image: app
    container_name: APP
    restart: on-failure
    ports:
      - 8080:8080
    depends_on:
       db:
        condition: service_healthy
    networks:
      - backend

networks:
  backend:
    driver: bridge

Журналы MariaDB:

Initializing database


PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h  password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

Database initialized
MySQL init process in progress...
2019-10-01  9:08:58 0 [Note] mysqld (mysqld 10.4.8-MariaDB-1:10.4.8+maria~bionic) starting as process 108 ...
2019-10-01  9:08:58 0 [Note] InnoDB: Using Linux native AIO
2019-10-01  9:08:59 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-10-01  9:08:59 0 [Note] InnoDB: Uses event mutexes
2019-10-01  9:08:59 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-10-01  9:08:59 0 [Note] InnoDB: Number of pools: 1
2019-10-01  9:08:59 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-10-01  9:08:59 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2019-10-01  9:08:59 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2019-10-01  9:08:59 0 [Note] InnoDB: Completed initialization of buffer pool
2019-10-01  9:08:59 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-10-01  9:08:59 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-10-01  9:08:59 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-10-01  9:08:59 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-10-01  9:08:59 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-10-01  9:08:59 0 [Note] InnoDB: 10.4.8 started; log sequence number 139836; transaction id 21
2019-10-01  9:08:59 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2019-10-01  9:08:59 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-10-01  9:08:59 0 [Warning] 'user' entry 'root@c147913c7f5c' ignored in --skip-name-resolve mode.
2019-10-01  9:08:59 0 [Warning] 'user' entry '@c147913c7f5c' ignored in --skip-name-resolve mode.
2019-10-01  9:08:59 0 [Warning] 'proxies_priv' entry '@% root@c147913c7f5c' ignored in --skip-name-resolve mode.
2019-10-01  9:08:59 0 [Note] InnoDB: Buffer pool(s) load completed at 191001  9:08:59
2019-10-01  9:08:59 0 [Note] Reading of all Master_info entries succeeded
2019-10-01  9:08:59 0 [Note] Added new Master_info '' to hash table
2019-10-01  9:08:59 0 [Note] mysqld: ready for connections.
Version: '10.4.8-MariaDB-1:10.4.8+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
2019-10-01  9:16:52 25 [Warning] 'proxies_priv' entry '@% root@c147913c7f5c' ignored in --skip-name-resolve mode.

Как видите, MariaDB не загружает файл my.cnf: "port: 0" Через несколько минут MariaDB сбрасывает:

2019-10-01  9:16:52 0 [Note] mysqld (initiated by: unknown): Normal shutdown
2019-10-01  9:16:52 0 [Note] Event Scheduler: Purging the queue. 0 events
2019-10-01  9:16:52 0 [Note] InnoDB: FTS optimize thread exiting.
2019-10-01  9:16:52 0 [Note] InnoDB: Starting shutdown...
2019-10-01  9:16:52 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2019-10-01  9:16:52 0 [Note] InnoDB: Buffer pool(s) dump completed at 191001  9:16:52
2019-10-01  9:16:54 0 [Note] InnoDB: Shutdown completed; log sequence number 20431569; transaction id 14896
2019-10-01  9:16:54 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2019-10-01  9:16:54 0 [Note] mysqld: Shutdown complete


MySQL init process done. Ready for start up.

2019-10-01  9:16:54 0 [Note] mysqld (mysqld 10.4.8-MariaDB-1:10.4.8+maria~bionic) starting as process 1 ...
2019-10-01  9:16:54 0 [Note] InnoDB: Using Linux native AIO
2019-10-01  9:16:54 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-10-01  9:16:54 0 [Note] InnoDB: Uses event mutexes
2019-10-01  9:16:54 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-10-01  9:16:54 0 [Note] InnoDB: Number of pools: 1
2019-10-01  9:16:54 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-10-01  9:16:54 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2019-10-01  9:16:54 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2019-10-01  9:16:54 0 [Note] InnoDB: Completed initialization of buffer pool
2019-10-01  9:16:54 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-10-01  9:16:54 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-10-01  9:16:54 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-10-01  9:16:54 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-10-01  9:16:54 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-10-01  9:16:54 0 [Note] InnoDB: Waiting for purge to start
2019-10-01  9:16:54 0 [Note] InnoDB: 10.4.8 started; log sequence number 20431569; transaction id 14896
2019-10-01  9:16:54 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2019-10-01  9:16:54 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-10-01  9:16:54 0 [Note] Server socket created on IP: '0.0.0.0'.
2019-10-01  9:16:54 0 [Warning] 'proxies_priv' entry '@% root@c147913c7f5c' ignored in --skip-name-resolve mode.
2019-10-01  9:16:54 0 [Note] Reading of all Master_info entries succeeded
2019-10-01  9:16:54 0 [Note] Added new Master_info '' to hash table
2019-10-01  9:16:54 0 [Note] mysqld: ready for connections.
Version: '10.4.8-MariaDB-1:10.4.8+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2019-10-01  9:16:54 0 [Note] InnoDB: Buffer pool(s) load completed at 191001  9:16:54

И с этого момента мое приложение может окончательно подключиться к БД. "port: 3306"

Мой вопрос: должен ли MariaDB загружаться так долго? Должен ли MariaDB восстановиться через несколько минут с загруженными настройками my.cnf?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...