docker-library / mysql

Docker Official Image packaging for MySQL Community Server
https://dev.mysql.com/
GNU General Public License v2.0
2.47k stars 2.2k forks source link

MySQL Immediately Shuts Down Due To Storage Engine Problem #37

Closed rpalmite closed 9 years ago

rpalmite commented 9 years ago

I've having difficulty starting a docker image for this dockerfile. Everything I do seems to produce a similar result: mysql starts, has trouble with the innodb engine, and immediately shutsdown. Here's the steps to reproduce:

uname --all Linux magento2 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

docker --version Docker version 1.4.1, build 5bc2ff8

docker run --name mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql e6876c7a3e12729b1201334acd0f590245a21f5a4ca0582645059c0c3006c9a9

docker logs mysql

Running mysql_install_db ... 2015-01-08 04:03:04 12 [Note] InnoDB: Using atomics to ref count buffer pool pages 2015-01-08 04:03:04 12 [Note] InnoDB: The InnoDB memory heap is disabled 2015-01-08 04:03:04 12 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2015-01-08 04:03:04 12 [Note] InnoDB: Memory barrier is not used 2015-01-08 04:03:04 12 [Note] InnoDB: Compressed tables use zlib 1.2.7 2015-01-08 04:03:04 12 [Note] InnoDB: Using Linux native AIO 2015-01-08 04:03:04 12 [Note] InnoDB: Using CPU crc32 instructions 2015-01-08 04:03:04 12 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2015-01-08 04:03:04 12 [Note] InnoDB: Completed initialization of buffer pool 2015-01-08 04:03:04 12 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created! 2015-01-08 04:03:04 12 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB 2015-01-08 04:03:04 12 [Note] InnoDB: Database physically writes the file full: wait... 2015-01-08 04:03:04 12 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB 2015-01-08 04:03:04 12 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB 2015-01-08 04:03:04 12 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 2015-01-08 04:03:04 12 [Warning] InnoDB: New log files created, LSN=45781 2015-01-08 04:03:04 12 [Note] InnoDB: Doublewrite buffer not found: creating new 2015-01-08 04:03:04 12 [Note] InnoDB: Doublewrite buffer created 2015-01-08 04:03:04 12 [Note] InnoDB: 128 rollback segment(s) are active. 2015-01-08 04:03:04 12 [Warning] InnoDB: Creating foreign key constraint system tables. 2015-01-08 04:03:04 12 [Note] InnoDB: Foreign key constraint system tables created 2015-01-08 04:03:04 12 [Note] InnoDB: Creating tablespace and datafile system tables. 2015-01-08 04:03:04 12 [Note] InnoDB: Tablespace and datafile system tables created. 2015-01-08 04:03:04 12 [Note] InnoDB: Waiting for purge to start 2015-01-08 04:03:04 12 [Note] InnoDB: 5.6.22 started; log sequence number 0 2015-01-08 04:03:04 12 [Note] Binlog end 2015-01-08 04:03:04 12 [Note] InnoDB: FTS optimize thread exiting. 2015-01-08 04:03:04 12 [Note] InnoDB: Starting shutdown... 2015-01-08 04:03:06 12 [Note] InnoDB: Shutdown completed; log sequence number 1625977 Installing MySQL system tables...OK

2015-01-08 04:03:06 35 [Note] InnoDB: Using atomics to ref count buffer pool pages 2015-01-08 04:03:06 35 [Note] InnoDB: The InnoDB memory heap is disabled 2015-01-08 04:03:06 35 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2015-01-08 04:03:06 35 [Note] InnoDB: Memory barrier is not used 2015-01-08 04:03:06 35 [Note] InnoDB: Compressed tables use zlib 1.2.7 2015-01-08 04:03:06 35 [Note] InnoDB: Using Linux native AIO 2015-01-08 04:03:06 35 [Note] InnoDB: Using CPU crc32 instructions 2015-01-08 04:03:06 35 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2015-01-08 04:03:06 35 [Note] InnoDB: Completed initialization of buffer pool 2015-01-08 04:03:06 35 [Note] InnoDB: Highest supported file format is Barracuda. 2015-01-08 04:03:06 35 [Note] InnoDB: 128 rollback segment(s) are active. 2015-01-08 04:03:06 35 [Note] InnoDB: Waiting for purge to start 2015-01-08 04:03:06 35 [Note] InnoDB: 5.6.22 started; log sequence number 1625977 2015-01-08 04:03:06 35 [Note] Binlog end 2015-01-08 04:03:06 35 [Note] InnoDB: FTS optimize thread exiting. 2015-01-08 04:03:06 35 [Note] InnoDB: Starting shutdown... 2015-01-08 04:03:08 35 [Note] InnoDB: Shutdown completed; log sequence number 1625987 Filling help tables...OK

To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL 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 e6876c7a3e12 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 manual for more instructions.

You can start the MySQL daemon with:

cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Found existing config file /usr/my.cnf on the system. Because this file might be in use, it was not replaced, but was used in bootstrap (unless you used --defaults-file) and when you later start the server. The new default config file was created as /usr/my-new.cnf, please compare it with your file and take the changes you need.

WARNING: Default config file /etc/mysql/my.cnf exists on the system This file will be read by default by the MySQL server If you do not want to use this, either remove it, or use the --defaults-file argument to mysqld_safe when starting the server

Finished mysql_install_db 2015-01-08 04:03:09 1 [Note] Plugin 'FEDERATED' is disabled. 2015-01-08 04:03:09 1 [Note] InnoDB: Using atomics to ref count buffer pool pages 2015-01-08 04:03:09 1 [Note] InnoDB: The InnoDB memory heap is disabled 2015-01-08 04:03:09 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2015-01-08 04:03:09 1 [Note] InnoDB: Memory barrier is not used 2015-01-08 04:03:09 1 [Note] InnoDB: Compressed tables use zlib 1.2.7 2015-01-08 04:03:09 1 [Note] InnoDB: Using Linux native AIO 2015-01-08 04:03:09 1 [Note] InnoDB: Using CPU crc32 instructions 2015-01-08 04:03:09 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 2015-01-08 04:03:09 1 [ERROR] InnoDB: Cannot allocate memory for the buffer pool 2015-01-08 04:03:09 1 [ERROR] Plugin 'InnoDB' init function returned error. 2015-01-08 04:03:09 1 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2015-01-08 04:03:09 1 [ERROR] Unknown/unsupported storage engine: InnoDB 2015-01-08 04:03:09 1 [ERROR] Aborting

2015-01-08 04:03:09 1 [Note] Binlog end 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'partition' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'BLACKHOLE' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'ARCHIVE' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_DELETED' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_METRICS' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMPMEM' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMP_RESET' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_CMP' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_LOCKS' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'INNODB_TRX' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'MEMORY' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'CSV' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'MRG_MYISAM' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'MyISAM' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'sha256_password' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'mysql_old_password' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'mysql_native_password' 2015-01-08 04:03:09 1 [Note] Shutting down plugin 'binlog' 2015-01-08 04:03:09 1 [Note] mysqld: Shutdown complete

yosifkit commented 9 years ago

This seems related to #3. It looks like you are running out of memory:

2015-01-08 04:03:09 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 2015-01-08 04:03:09 1 [ERROR] InnoDB: Cannot allocate memory for the buffer pool 2015-01-08 04:03:09 1 [ERROR] Plugin 'InnoDB' init function returned error. 2015-01-08 04:03:09 1 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

rpalmite commented 9 years ago

Thanks

Vingtoft commented 8 years ago

I had the same problem, but memory was not the problem. Everything worked after I removed all containers and images and rebuild everything from scratch.

Remove all (also running) containers: docker rm -f $(docker ps -a -q) Remove all images: docker rmi -f $(docker images -q)

bitwombat commented 7 years ago

@Vingtoft's answer worked for me too. Make sure you remove the associated volumes, else they'll be left 'dangling'.

docker rm -v -f $(docker ps -a -q)

And while you're at it, kill all volumes too.

docker volume rm $(docker volume ls -q)
yaitskov commented 7 years ago

I face this and purging containers with volumes doesn't help

SpaceNet commented 7 years ago

I faced this too and purging containers with volumes didn't help. After I increased memory size, the InnoDB error was gone.