OpenSearch RHEL9 Installation challenges

Been running Elasticsearch for a while but decided to try OpenSearch 2.6 on a RHEL9 VM.
Ran into a couple of observations and an issue with JNA.

OBSERVATION: The GPG signature OpenSearch Uses is signed with SHA1 and Redhat doesnt like that.

root@test ~]# sudo rpm --import https://artifacts.opensearch.org/publickeys/opensearch.pgp
warning: Signature not supported. Hash algorithm SHA1 not available.
error: https://artifacts.opensearch.org/publickeys/opensearch.pgp: key 1 import failed.

Ignoring GPG using SHA1 for now (just a test server), I skipped the verification and forced the installation. Run into some issues:

My /usr/share/opensearch/config/opensearch.yml config:

        node.name: "test.local"
        path.data: /var/lib/opensearch
        path.logs: /var/log/opensearch
        action.auto_create_index: false
        plugins.security.disabled: true
        network.host: 0.0.0.0
        http.port: 9200
        discovery.type: single-node
        bootstrap.memory_lock: true

opensearch LOG:

root@test ~]# cat /var/log/opensearch/opensearch.log

[2023-04-28T11:50:02,506][WARN ][o.o.b.Natives            ] [test.local] unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: /tmp/opensearch-11425941651389470086/jna17202178635701513230.tmp: /tmp/opensearch-11425941651389470086/jna17202178635701513230.tmp: failed to map segment from shared object
	at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]
	at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388) ~[?:?]
	at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232) ~[?:?]
	at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174) ~[?:?]
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389) ~[?:?]
	at java.lang.Runtime.load0(Runtime.java:755) ~[?:?]
	at java.lang.System.load(System.java:1953) ~[?:?]
	at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018) ~[jna-5.5.0.jar:5.5.0 (b0)]
	at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988) ~[jna-5.5.0.jar:5.5.0 (b0)]
	at com.sun.jna.Native.<clinit>(Native.java:195) ~[jna-5.5.0.jar:5.5.0 (b0)]
	at java.lang.Class.forName0(Native Method) ~[?:?]
	at java.lang.Class.forName(Class.java:375) ~[?:?]
	at org.opensearch.bootstrap.Natives.<clinit>(Natives.java:60) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:123) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.bootstrap.Bootstrap.setup(Bootstrap.java:191) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.bootstrap.Bootstrap.init(Bootstrap.java:404) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:180) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.java:171) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:104) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138) [opensearch-cli-2.6.0.jar:2.6.0]
	at org.opensearch.cli.Command.main(Command.java:101) [opensearch-cli-2.6.0.jar:2.6.0]
	at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:137) [opensearch-2.6.0.jar:2.6.0]
	at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:103) [opensearch-2.6.0.jar:2.6.0]
[2023-04-28T11:50:02,512][WARN ][o.o.b.Natives            ] [test.local] cannot check if running as root because JNA is not available
...

I thought maybe running a yum install jna would get me past those JNA errors but alas it did not. Should I just give up on trying to get this to run with RHEL9 or am I missing something stupid here?

Yep, my mistake! RHEL9’s fapolicyd doesn’t allow /tmp exec. Since OpenSearch requires this by default during initial setup, I needed to stop fapolicy, start/stop opensearch, and then start fapolicy and opensearch…

1 Like