Installation on ubuntu 22.04 fails with result exit-code

issues getting opensearch to start for the first time on ubuntu server 22.04, 8 GB ram

Package Version: is 2.11.2

I thought I had successfully installed opensearch, but when I go to start it, with:
sudo systemctl start opensearch.service
I get back:
Jan 04 16:17:58 linuxserver systemd-entrypoint[16042]: at com.fasterxml.brown.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:482)
Jan 04 16:17:58 linuxserver systemd-entrypoint[16042]: at org.opensearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:66)
Jan 04 16:17:58 linuxserver systemd-entrypoint[16042]: at org.opensearch.common.settings.Settings.fromXContent(Settings.java:660)
Jan 04 16:17:58 linuxserver systemd-entrypoint[16042]: at org.opensearch.common.settings.Settings.fromXContent(Settings.java:629)
Jan 04 16:17:58 linuxserver systemd-entrypoint[16042]: at org.opensearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1142)
Jan 04 16:17:58 linuxserver systemd-entrypoint[16042]: … 9 more
Jan 04 16:17:58 linuxserver systemd[1]: opensearch.service: Main process exited, code=exited, status=1/FAILURE
Jan 04 16:17:58 linuxserver systemd[1]: opensearch.service: Failed with result ‘exit-code’.
Jan 04 16:17:58 linuxserver systemd[1]: Failed to start OpenSearch.
Jan 04 16:17:58 linuxserver systemd[1]: opensearch.service: Consumed 3.465s CPU time.

when I run systemctl status opesearch.service it returns:

opensearch.service: Main process exited, code=exited, status=1/FAILURE
opensearch.service: Failed with result ‘exit-code’.

what can I do to drill down further and find the issue?

Hi @captainoutrageous,
is the first log the output from “journalctl -xeu opensearch”?
If so, could you please share the OpenSearch log file under /var/log/opensearch?
This File is sometimes a bit more helpful as it logs the starup from the OpenSearch Service.
Also, could you please share your OpenSearch config so we can have a look at that?

config is below
####### End OpenSearch Security Demo Configuration ########
cluster.name: graylog1
node.name: ${HOSTNAME}
path.data: /var/lib/opensearch
path.logs: /var/log/opensearch
discovery.type: single-node
network.host: 0.0.0.0
action.auto_create_index: false
plugins.security.disabled: true

gc.log has this:
[2024-01-04T20:57:50.689+0000][17121][gc] Using G1
[2024-01-04T20:57:50.707+0000][17121][gc,init] Version: 17.0.8+7 (release)
[2024-01-04T20:57:50.707+0000][17121][gc,init] CPUs: 2 total, 2 available
[2024-01-04T20:57:50.707+0000][17121][gc,init] Memory: 7938M
[2024-01-04T20:57:50.707+0000][17121][gc,init] Large Page Support: Disabled
[2024-01-04T20:57:50.707+0000][17121][gc,init] NUMA Support: Disabled
[2024-01-04T20:57:50.707+0000][17121][gc,init] Compressed Oops: Enabled (Zero based)
[2024-01-04T20:57:50.707+0000][17121][gc,init] Heap Region Size: 2M
[2024-01-04T20:57:50.707+0000][17121][gc,init] Heap Min Capacity: 4G
[2024-01-04T20:57:50.707+0000][17121][gc,init] Heap Initial Capacity: 4G
[2024-01-04T20:57:50.707+0000][17121][gc,init] Heap Max Capacity: 4G
[2024-01-04T20:57:50.707+0000][17121][gc,init] Pre-touch: Disabled
[2024-01-04T20:57:50.707+0000][17121][gc,init] Parallel Workers: 2
[2024-01-04T20:57:50.707+0000][17121][gc,init] Concurrent Workers: 1
[2024-01-04T20:57:50.707+0000][17121][gc,init] Concurrent Refinement Workers: 2
[2024-01-04T20:57:50.707+0000][17121][gc,init] Periodic GC: Disabled
[2024-01-04T20:57:50.707+0000][17121][gc,metaspace] CDS archive(s) not mapped
[2024-01-04T20:57:50.707+0000][17121][gc,metaspace] Compressed class space mapped at: 0x00000007c0000000-0x0000000800000000, reserved size: 1073741824
[2024-01-04T20:57:50.707+0000][17121][gc,metaspace] Narrow klass base: 0x0000000000000000, Narrow klass shift: 3, Narrow klass range: 0x800000000
[2024-01-04T20:57:50.815+0000][17121][gc,heap,exit] Heap
[2024-01-04T20:57:50.815+0000][17121][gc,heap,exit] garbage-first heap total 4194304K, used 2050K [0x00000006c0000000, 0x00000007c0000000)
[2024-01-04T20:57:50.815+0000][17121][gc,heap,exit] region size 2048K, 2 young (4096K), 0 survivors (0K)
[2024-01-04T20:57:50.815+0000][17121][gc,heap,exit] Metaspace used 4521K, committed 4736K, reserved 1114112K
[2024-01-04T20:57:50.815+0000][17121][gc,heap,exit] class space used 351K, committed 448K, reserved 1048576K

Hey @captainoutrageous,
i just tested your config on my Test Machine and it seems to work fine.
In the Directory /var/log/opensearch should be a file called graylog1.log, there are the interesting log lines.
Could you please share these Lines and also have to set the Kernel Parameter vm.max_map_count=262144?

yeah, the weird thing is, I can start opensearch successfully before I add those config changes.
I dont see a graylog1.log, but there is a gc.loc.01, I can attach that.

ok, so how do I add an attachment to this post? I am just not seeing it.

ok, so update, I had been putting my entire config settings beneath the demo settings, but this time, I removed the # from some of those demo lines and put in my settings there, and opensearch is now running.
maybe I had a space there I couldnt see?

Hey @captainoutrageous,
i am glad that OpenSearch is now working for you.
Have you more lines configured than you pasted into this thread? I am just asking because you say that you pasted some lines after the Demo Part.
Can you share what you exactly changed if someone has the same Issue and we can analyze what caused the Issue.
Also could you please tell us how you installed OpenSearch? Ansible or Deb Package?