Docker 中的 Alpine 初始化数据库
docker exec cmdb3 mysql_install_db --user=root
时报错 :
2018-07-21 14:00:24 140469830294408 [ERROR] InnoDB: preallocating 12582912 bytes for file ./ibdata1 failed with error 95
2018-07-21 14:00:24 140469830294408 [ERROR] InnoDB: Could not set the file size of './ibdata1'. Probably out of disk space
2018-07-21 14:00:24 140469830294408 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2018-07-21 14:00:25 140469830294408 [ERROR] Plugin 'InnoDB' init function returned error.
2018-07-21 14:00:25 140469830294408 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-07-21 14:00:25 140469830294408 [ERROR] Unknown/unsupported storage engine: InnoDB
2018-07-21 14:00:25 140469830294408 [ERROR] Aborting
国外看到解决方案说是和 datadir 所在的分区格式有关
我的 datadir 是 Windows 挂载到 Vmware 再挂载到 Docker 再挂载到 Alpine ,
都是实时挂载, 所以文件格式应该也是 Win 下的 NTFS , 切换为 Docker 内部格式 EXT4 后 , 问题解决。