vagrant共享存储-docker容器mysql-持久卷-无法启动
我试了很多次都没有成功,结果一无所获 我的设置如下:vagrant共享存储-docker容器mysql-持久卷-无法启动,mysql,docker,containers,vagrant,shared-directory,Mysql,Docker,Containers,Vagrant,Shared Directory,我试了很多次都没有成功,结果一无所获 我的设置如下: windows 10主机 虚拟盒最新版本 来宾虚拟机是ubuntu最新的最小版本(命令行) 使用vagrant创建虚拟机并在主机和来宾虚拟机之间共享文件夹 我的代码、Dockerfile和Docker compose文件保存在共享文件夹中,比如(/vagrant/test),因此我可以从Windows主机轻松访问它们 来自来宾虚拟机:(文件权限) vagrant@dev-环境测试:/vagrant/test$ll drwxrwxrwx 1
- windows 10主机
- 虚拟盒最新版本
- 来宾虚拟机是ubuntu最新的最小版本(命令行)
- 使用vagrant创建虚拟机并在主机和来宾虚拟机之间共享文件夹
vagrant@dev-环境测试:/vagrant/test$ll
drwxrwxrwx 1流浪者流浪者流浪者4096年4月19日12:33./
drwxr-xr-x 23根根目录4096年4月14日12:50../
drwxrwxrwx 1流浪者流浪者流浪者4月14日10:30。流浪者/
-RWXRWX 1流浪流浪者流浪者1072年4月14日13:36流浪者档案*
-rwxrwxrwx 1流浪者流浪者流浪者4月19日11:23 a*
DRWXRWX 1流浪者流浪者流浪者0 Apr 19 12:33代码/
DRWXRWX 1流浪流浪者流浪者4096年4月19日12:28 mysql数据/
-rwxrwxrwx 1流浪者流浪者流浪者0 Apr 19 12:29 mysqlcontainer\u bug\u sharefolder.txt*
我还在组中添加了用户“vagrant:999(systemd coredump)
vagrant@dev-环境测试:/vagrant$id
uid=1000(流浪者)gid=1000(流浪者)组=1000(流浪者)、4(adm)、24(cdrom)、27(sudo)、30(dip)、46(plugdev)、116(lxd)、997(docker)、999(systemd coredump)
对于测试,我使用以下命令创建容器:
docker run-d--name=test-mysql4-e MYSQL\u ROOT\u PASSWORD=mypassword-p 6604:3306-v/vagrant/MYSQL data:/var/lib/MYSQL
这里,我试图为我的sql容器创建一个持久卷(装载在主机共享文件夹/vagrant/mysql data
),但容器创建失败
情景1:
/vagrant/mysql数据:此文件夹中没有数据
docker日志测试-mysql4
2021-04-19 12:28:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-04-19 12:28:37+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-04-19 12:28:37+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-04-19 12:28:37+00:00 [Note] [Entrypoint]: Initializing database files
2021-04-19T12:28:37.465722Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.23) initializing of server in progress as process 43
2021-04-19T12:28:37.472616Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2021-04-19T12:28:37.478227Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-04-19T12:28:41.252791Z 0 [ERROR] [MY-012592] [InnoDB] Operating system error number 95 in a file operation.
2021-04-19T12:28:41.252961Z 0 [ERROR] [MY-012596] [InnoDB] Error number 95 means 'Operation not supported'
2021-04-19T12:28:41.253274Z 0 [ERROR] [MY-012646] [InnoDB] File ./undo_001: 'Linux aio' returned OS error 195. Cannot continue operation
2021-04-19T12:28:41.253413Z 0 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
或者我得到了这个错误
情景2:
/vagrant/mysql数据:包含以下文件
/vagrant/mysql数据$ls
“#ib_16384_0.dblwr”#ib_16384_1.dblwr”ib_logfile1 ib_logfile101
ibdata1 undo_001 undo_002 undo_1_trunc.log undo_2_trunc.log
非常感谢您的帮助
提前感谢这篇文章质量不高,请编辑你的文章并应用适当的格式这与你的文章有什么关系吗?
2021-04-19 12:25:20+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-04-19 12:25:20+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-04-19 12:25:20+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.
2021-04-19 12:25:20+00:00 [Note] [Entrypoint]: Initializing database files
2021-04-19T12:25:20.641591Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.23) initializing of server in progress as process 43
2021-04-19T12:25:20.645008Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2021-04-19T12:25:20.645019Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2021-04-19T12:25:20.645069Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-04-19T12:25:20.645195Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23) MySQL Community Server - GPL.
vagrant@rma-dev-env-testing:/vagrant/mysql-data$ ls