“透明大页面"问题在Windows 10上使用Docker时 [英] Problem with "Transparent Huge Pages" on Windows 10 when using Docker
问题描述
运行percona/percona-server:5.7映像并启用TokuDB时,它抱怨启用了透明大页面(THP).但是我在以下情况下将其关闭:计算机配置\ Windows设置\安全设置\本地策略\用户权限分配"
When running percona/percona-server:5.7 image and enable TokuDB it complained about transparent huge pages (THP) is enabled. However I have turned it off under: "Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment"
当我运行以下行时:
docker run --name ps -e MYSQL_ROOT_PASSWORD=root -e INIT_TOKUDB=yes percona/percona-server:5.7
我收到此错误消息:
Disabling transparent huge pages for the current session...
/usr/bin/ps-admin: line 708: /sys/kernel/mm/transparent_hugepage/defrag: Read-only file system
/usr/bin/ps-admin: line 711: /sys/kernel/mm/transparent_hugepage/enabled: Read-only file system
ERROR: Failed to disable transparent huge pages for this session.
有什么想法在启动docker镜像之前将其关闭吗?
Any idea how to turn it off before starting the docker image?
我可以在以下位置看到它已启用:
I can see it is enabled in the:
bash-4.2$ cat /sys/kernel/mm/transparent_hugepage/enabled
always [madvise] never
推荐答案
您正在使用哪个docker引擎?在Docker Desktop中转到设置.然后,在常规部分下,它将显示使用基于WSL2的引擎
.如果选中此选项,则使用WSL2的可能性更大.
Which docker engine are you using? Within Docker Desktop go to settings. Then under the general section it will show Use the WSL2 based engine
. If this is checked then more than likely the issue is with using WSL2.
此外,请查看您的my.cnf文件.如果cnf文件中包含 thp-setting
,则mysql将在启动时尝试将存在的设置写入这些位置.如果您注释掉或删除了my.cnf中的该行,它应该可以正常工作.
Additionally, look at your my.cnf file. If the cnf file has the thp-setting
in it, mysql will try to write the setting that exists into those locations when it starts. If you comment out or remove that line in my.cnf, it should work fine.
这篇关于“透明大页面"问题在Windows 10上使用Docker时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!