Oh, running with doas -u won't set the login class to 'opensearch', you need to use rcctl or /etc/rc.d/opensearch (or su with -c opensearch)

--
 Sent from a phone, apologies for poor formatting.

On 15 June 2022 01:54:54 Yifei Zhan <openbsd@zhan.science> wrote:

On 22/06/14 09:49AM, Omar Polo wrote:
Yifei Zhan <openbsd@zhan.science> wrote:
> On 22/05/26 11:20AM, Omar Polo wrote:
> > Hello ports,
> >
> > now that we have an updated jna, here's the port that I was working on:
> >
> > % pkg_info opensearch
> > Information for inst:opensearch-1.3.2
> >
>
> I tested this on my amd64 box, the package can be built, but I'm unable to start it:
>
> # doas -u _opensearch /usr/local/opensearch/bin/opensearch
>
> # There is insufficient memory for the Java Runtime Environment to continue.

this is interesting.  Just for curiosity, could you test with
elasticsearch too?


Sure, elasticsearch seems to work fine with the same login.conf tweaks:

 PID USERNAME PRI NICE  SIZE   RES STATE     WAIT      TIME    CPU COMMAND
38531 _elastic  10    0 1337M 1314M idle      fsleep    2:15  0.00% java

it complains about maxfiles but otherwise looks good to me.


it's a shot in the dark, but if you change the flags for the jvm so it
uses higher limits does it work then?  you could try running opensearch
from the command line and setting OPENSEARCH_JAVA_OPTS, for example (with
very large values just to test)

doas -u _opensearch env OPENSEARCH_JAVA_OPTS='-Xms8g -Xmx8G' \
        /usr/local/opensearch/bin/opensearch


still getting the same error :(

# Native memory allocation (mmap) failed to map 8589934592 bytes for
# Failed to commit area from 0x00000005c0000000 to 0x00000007c0000000
# of length 8589934592.

I experimented a few different values between 1G - 15G, but errors stay the same.

As Stuart Henderson mentioned I also tried lower the flag value, and
it returns a different error:

# doas -u _opensearch env OPENSEARCH_JAVA_OPTS='-Xms512M -Xmx512M' /usr/local/opensearch/bin/opensearch

java.lang.IllegalStateException: failed to load plugin class [org.opensearch.security.OpenSearchSecurityPlugin] Likely root cause: OpenSearchException[plugins.security.ssl.transport.keystore_filepath or plugins.security.ssl.transport.se rver.pemcert_filepath and plugins.security.ssl.transport.client.pemcert_filepath must be set if transport ssl is requested.] at org.opensearch.security.ssl.DefaultSecurityKeyStore.initTransportSSLConfig(DefaultSecurityKeyStore.java:422) at org.opensearch.security.ssl.DefaultSecurityKeyStore.initSSLConfig(DefaultSecurityKeyStore.java:258) at org.opensearch.security.ssl.DefaultSecurityKeyStore.<init>(DefaultSecurityKeyStore.java:179) at org.opensearch.security.ssl.OpenSearchSecuritySSLPlugin.<init>(OpenSearchSecuritySSLPlugin.java:218) at org.opensearch.security.OpenSearchSecurityPlugin.<init>(OpenSearchSecurityPlugin.java:252) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

(full log of this crash is attached, although it might be simply due
to not having enough memory to load plugins)

Reply via email to