I'm running a few containers on my environment, using the automated image tagged "latest". However, the server starts with following warnings.
CONTROL [initandlisten]
CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
CONTROL [initandlisten] ** We suggest setting it to 'never'
CONTROL [initandlisten]
CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
CONTROL [initandlisten] ** We suggest setting it to 'never'
CONTROL [initandlisten]
I think you meant to file this on the mongo repo. :wink:
Regardless, setting these in the image can't really work because things in /sys are host-wid settings -- you'll have to do something like one of the following on your host system to enable this:
# echo never > /sys/kernel/mm/transparent_hugepage/enabled
# echo never > /sys/kernel/mm/transparent_hugepage/defrag
or
$ echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
$ echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defrag
Sorry for that and thanks for your help! Problem was solved.
@tianon when go into the mongodb docker container and run the command, show error as below:
root@e8c1626b8c67:/# echo never > /sys/kernel/mm/transparent_hugepage/enabled
bash: /sys/kernel/mm/transparent_hugepage/enabled: Read-only file system
there is no command lsattr and chattr, how to set in docker container?
Please don't necro-post -- you need to set that on your host, not inside the container (it's a global value).
In the future, these sorts of questions/requests would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow.
Most helpful comment
I think you meant to file this on the
mongorepo. :wink:Regardless, setting these in the image can't really work because things in
/sysare host-wid settings -- you'll have to do something like one of the following on your host system to enable this:or