Elastic search will not start - Java may be the cause.

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
isaacl86
Posts: 9
Joined: Fri Dec 04, 2020 3:23 pm

Re: Elastic search will not start - Java may be the cause.

Post by isaacl86 »

Hi Perry,
My log server has been offline for too long, so I just reverted back to the older JDK.
I did change those options but I was still getting some errors, you can see them below. But switching back to the old java is working.

[root@PGE-NAGIOSLOG ~]# alternatives --config java

There are 2 programs which provide 'java'.

Selection Command
-----------------------------------------------
*+ 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-1.el7_9.x86_64/jre/bin/java)
2 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.el7_9.x86_64/bin/java)

Enter to keep the current selection[+], or type selection number:


systemctl logs below.


[root@PGE-NAGIOSLOG ~]# systemctl status elasticsearch -l
● elasticsearch.service - LSB: This service manages the elasticsearch daemon
Loaded: loaded (/etc/rc.d/init.d/elasticsearch; bad; vendor preset: disabled)
Active: active (exited) since Wed 2022-02-16 09:23:00 EST; 24s ago
Docs: man:systemd-sysv-generator(8)
Process: 85753 ExecStop=/etc/rc.d/init.d/elasticsearch stop (code=exited, status=0/SUCCESS)
Process: 85764 ExecStart=/etc/rc.d/init.d/elasticsearch start (code=exited, status=0/SUCCESS)

Feb 16 09:23:00 PGE-NAGIOSLOG.powergrid.lcl runuser[85781]: pam_unix(runuser:session): session opened for user nagios by (uid=0)
Feb 16 09:23:00 PGE-NAGIOSLOG.powergrid.lcl elasticsearch[85764]: Starting elasticsearch: [ OK ]
Feb 16 09:23:00 PGE-NAGIOSLOG.powergrid.lcl systemd[1]: Started LSB: This service manages the elasticsearch daemon.
Feb 16 09:23:01 PGE-NAGIOSLOG.powergrid.lcl elasticsearch[85764]: Exception in thread "main" java.lang.ExceptionInInitializerError
Feb 16 09:23:01 PGE-NAGIOSLOG.powergrid.lcl elasticsearch[85764]: at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:184)
Feb 16 09:23:01 PGE-NAGIOSLOG.powergrid.lcl elasticsearch[85764]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
Feb 16 09:23:01 PGE-NAGIOSLOG.powergrid.lcl elasticsearch[85764]: Caused by: java.lang.UnsupportedOperationException: Boot class path mechanism is not supported
Feb 16 09:23:01 PGE-NAGIOSLOG.powergrid.lcl elasticsearch[85764]: at java.management/sun.management.RuntimeImpl.getBootClassPath(RuntimeImpl.java:99)
Feb 16 09:23:01 PGE-NAGIOSLOG.powergrid.lcl elasticsearch[85764]: at org.elasticsearch.monitor.jvm.JvmInfo.<clinit>(JvmInfo.java:77)
Feb 16 09:23:01 PGE-NAGIOSLOG.powergrid.lcl elasticsearch[85764]: ... 2 more
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Elastic search will not start - Java may be the cause.

Post by pbroste »

Hello @isaacl86

When you set it back to OpenJDK 1.8.x make sure that you set these back to default:


Code: Select all

vi /usr/local/nagioslogserver/logstash/bin/logstash.lib.sh
# There are no JAVA_OPTS set from the client, we set a predefined
# set of options that think are good in general
JAVA_OPTS="-XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC"
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC"
And:

Code: Select all

vi /usr/local/nagioslogserver/elasticsearch/bin/elasticsearch.in.sh
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC"
JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC"


Thanks,
Perry
Locked