Today i received some alarms that my data-node servers have 100% usage of the tmp directory.
Looking inside it i found that the datanode process had created some files (gc logs and tmp opensearch-xxx directories).
But i have a separated disk this stuff, i even changed the /etc/graylog/datanode/jvm.options but it did not work.
Looking around i found that i can change some parameters it in the /etc/graylog/datanode/datanode.conf (Data Node Configuration)
But nothing says about changing the JVM tmp directory and GC files.
I’m using Graylog and Datanode in version 6.1.7 with RHEL9.
Any help to change is appreciated because i cannot run this stuff in the /tmp/.
Hi @tadeu.alves
Those opensearch-xxx directories hold configuration of the currently running opensearch process. They should be automatically deleted in the moment the process terminates. Generally, there are only several text/configuration files with negligible size. If you see suspiciously many opensearch-xxx directories, then there is some problem with the cleanup and I’d be interested to debug it further.
You can relocate these opensearch-xxx to a different partition by configuring opensearch_config_location in your datanode.conf.
You can also relocate all the logs by configuring opensearch_logs_location path.
You can also define OPENSEARCH_TMPDIR env property, telling the datanode-managed opensearch where to put temp files.
Finally, you can adapt the jvm.options file. Look for the JDK 9+ GC logging section and adapt the file path and/or verbosity.
1 - opensearch_logs_location - This configuration is fine i have a dedicated partition to the /var/log so no problem here.
2 - Where do i change the OPENSEARCH_TMPDIR because in the Documentation of the conf file doesn’t show where i can change it.
3 - I changed the JDK 9+ GC logging in the /etc/graylog/datanode/jvm.options but the configuration was ignored.. even tried different file locations like /etc/graylog/datanode/opensearch-conf/opensearch/jvm.options or /usr/share/graylog-datanode/dist/opensearch-2.15.0-linux-x64/config/jvm.options but in all of them the configuration was ignored.
4 - This is my ps -ef | grep java in the datanode machine:
Thanks for your tests! You are right, there is no simple and straightforward way how to adapt the jvm.options. The version that opensearch is starting with is distributed in datanode jar and can’t be easily modified.
You can, however, configure at least the opensearch temp dir. Depending how you start your datanode, you should be able to configure env properties there. This is not datanode configuration option, just generic env property OPENSEARCH_TMPDIR.
Running datanode manually from a downloaded tarball, I verified that this command is working:
In your system, you probably have some descriptor file or configuration for running system services. There you can configure env for your datanode. Datanode will then forward OPENSEARCH_TMPDIR to the opensearch. This will solve the /tmp/opensearch-xxx directories you see.
For the gc.log I have no easy option but I’ll try to ask colleagues if they have some tips.
yeah, the gc.log location is hardcoded and there is currently no way to configure it. Please follow/subscribe the github issue if you want to be informed as soon as there is any progress in this.