I have installed NuoDB but cannot startup the storage manager and this error message is displayed:
Failed to start process [ProcessSpec[test, SM, peer=[Peer null:48004 (local)]]]: [NuoDB will not run with transparent hugepages enabled.
What is the problem?
The use of transparent huge pages causes problems for the management of memory by NuoDB and must be disabled.
Here is a brief overview of the workflow:
* When NuoDB is first started, a check is made to see if THP is set to [never]. If so it starts up normally.
* If THP is enabled [always] then this message is returned ``` NuoDB will not run with transparent hugepages enabled, please disable or set to [madvise] ``` and NuoDB nodes will not start.
* Next a check is made to see if the setting is [madvise]. If [madvise] is set then the second check is made to see if the kernel madvise() allocation call supports the MADV_NOHUGEPAGE flag which allows the program to control the use of huge pages. If the kernel does, then the node starts. If it does not support MADV_NOHUGEPAGE flag then NuoDB still will still start but the message ```Linux kernel does not appear to support MADV_NOHUGEPAGE, please make sure transparent hugepage support is disabled ``` is logged. This may be an OK case for some kernels so we start. (This is why I prefer [never]so that there is no reliance on this check.)
* If we are unable to determine the setting for some other reason we log this message ```Cannot determine if Linux kernel transparent hugepage support is enabled, please make sure transparent huge page support is disabled. ``` and continues to start as some OS's do not use THP at all.
You can resolve the error by executing the following commands:
$ sudo su
sudo echo never > /sys/kernel/mm/transparent_hugepage/enabled
sudo echo never > /sys/kernel/mm/transparent_hugepage/defrag
We recommend that the "never" setting is used to insure that THP's are never used rather than relying on flags in the madvise() call to determine if hugepages are used or not. NuoDB does, however, work with the setting [madvise] as well so either is appropriate. We actually recommend that you permanently disable THP altogether.