Question

ElasticSearch Not Starting on Ubuntu 20.04 with 4GB RAM and OpenJDK 11

ElasticSearch Not Starting on Ubuntu 20.04 with 4GB RAM and OpenJDK 11

by following https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-20-04 by this doc


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi I can see the error log like this

sammy@cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01:~$ sudo systemctl start elasticsearch
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
sammy@cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01:~$ sudo tail -100 /var/log/elasticsearch/elasticsearch.log
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178) [elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) [elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) [elasticsearch-cli-7.8.0.jar:7.8.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.8.0.jar:7.8.0]
[2020-07-11T16:10:05,925][WARN ][o.e.b.Natives            ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] cannot check if running as root because JNA is not available
[2020-07-11T16:10:05,926][WARN ][o.e.b.Natives            ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] cannot install system call filter because JNA is not available
[2020-07-11T16:10:05,926][WARN ][o.e.b.Natives            ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] cannot register console handler because JNA is not available
[2020-07-11T16:10:05,931][WARN ][o.e.b.Natives            ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] cannot getrlimit RLIMIT_NPROC because JNA is not available
[2020-07-11T16:10:05,931][WARN ][o.e.b.Natives            ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] cannot getrlimit RLIMIT_AS because JNA is not available
[2020-07-11T16:10:05,932][WARN ][o.e.b.Natives            ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] cannot getrlimit RLIMIT_FSIZE because JNA is not available
[2020-07-11T16:10:06,321][INFO ][o.e.n.Node               ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] version[7.8.0], pid[124014], build[default/deb/757314695644ea9a1dc2fecd26d1a43856725e65/2020-06-14T19:35:50.234439Z], OS[Linux/5.4.0-37-generic/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/14.0.1/14.0.1+7]
[2020-07-11T16:10:06,323][INFO ][o.e.n.Node               ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] JVM home [/usr/share/elasticsearch/jdk]
[2020-07-11T16:10:06,324][INFO ][o.e.n.Node               ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] JVM arguments [-Xshare:auto, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -XX:+ShowCodeDetailsInExceptionMessages, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,COMPAT, -Xms1g, -Xmx1g, -XX:+UseG1GC, -XX:G1ReservePercent=25, -XX:InitiatingHeapOccupancyPercent=30, -Djava.io.tmpdir=/tmp/elasticsearch-16716871485915090185, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch, -Des.distribution.flavor=default, -Des.distribution.type=deb, -Des.bundled_jdk=true]
[2020-07-11T16:10:09,655][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [aggs-matrix-stats]
[2020-07-11T16:10:09,655][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [analysis-common]
[2020-07-11T16:10:09,656][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [constant-keyword]
[2020-07-11T16:10:09,656][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [flattened]
[2020-07-11T16:10:09,656][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [frozen-indices]
[2020-07-11T16:10:09,656][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [ingest-common]
[2020-07-11T16:10:09,657][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [ingest-geoip]
[2020-07-11T16:10:09,657][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [ingest-user-agent]
[2020-07-11T16:10:09,657][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [kibana]
[2020-07-11T16:10:09,658][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [lang-expression]
[2020-07-11T16:10:09,658][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [lang-mustache]
[2020-07-11T16:10:09,658][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [lang-painless]
[2020-07-11T16:10:09,658][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [mapper-extras]
[2020-07-11T16:10:09,659][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [parent-join]
[2020-07-11T16:10:09,659][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [percolator]
[2020-07-11T16:10:09,659][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [rank-eval]
[2020-07-11T16:10:09,659][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [reindex]
[2020-07-11T16:10:09,660][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [repository-url]
[2020-07-11T16:10:09,660][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [search-business-rules]
[2020-07-11T16:10:09,660][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [searchable-snapshots]
[2020-07-11T16:10:09,660][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [spatial]
[2020-07-11T16:10:09,661][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [systemd]
[2020-07-11T16:10:09,661][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [tasks]
[2020-07-11T16:10:09,661][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [transform]
[2020-07-11T16:10:09,661][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [transport-netty4]
[2020-07-11T16:10:09,662][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [vectors]
[2020-07-11T16:10:09,662][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-analytics]
[2020-07-11T16:10:09,662][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-async-search]
[2020-07-11T16:10:09,662][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-autoscaling]
[2020-07-11T16:10:09,663][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-ccr]
[2020-07-11T16:10:09,663][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-core]
[2020-07-11T16:10:09,663][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-deprecation]
[2020-07-11T16:10:09,664][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-enrich]
[2020-07-11T16:10:09,664][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-eql]
[2020-07-11T16:10:09,664][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-graph]
[2020-07-11T16:10:09,664][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-identity-provider]
[2020-07-11T16:10:09,664][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-ilm]
[2020-07-11T16:10:09,665][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-logstash]
[2020-07-11T16:10:09,665][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-ml]
[2020-07-11T16:10:09,665][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-monitoring]
[2020-07-11T16:10:09,665][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-ql]
[2020-07-11T16:10:09,666][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-rollup]
[2020-07-11T16:10:09,666][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-security]
[2020-07-11T16:10:09,666][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-sql]
[2020-07-11T16:10:09,666][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-voting-only-node]
[2020-07-11T16:10:09,667][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] loaded module [x-pack-watcher]
[2020-07-11T16:10:09,667][INFO ][o.e.p.PluginsService     ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] no plugins loaded
[2020-07-11T16:10:09,744][INFO ][o.e.e.NodeEnvironment    ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [67.8gb], net total_space [77.3gb], types [ext4]
[2020-07-11T16:10:09,745][INFO ][o.e.e.NodeEnvironment    ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] heap size [1gb], compressed ordinary object pointers [true]
[2020-07-11T16:10:09,872][INFO ][o.e.n.Node               ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] node name [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01], node ID [VIIMclatT62b7Hfg5Nl-TA], cluster name [elasticsearch]
[2020-07-11T16:10:16,388][INFO ][o.e.x.s.a.s.FileRolesStore] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] parsed [0] roles from file [/etc/elasticsearch/roles.yml]
[2020-07-11T16:10:17,153][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] [controller/124205] [Main.cc@110] controller (64 bit): Version 7.8.0 (Build 58ff6912e20047) Copyright (c) 2020 Elasticsearch BV
[2020-07-11T16:10:18,541][INFO ][o.e.d.DiscoveryModule    ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] using discovery type [zen] and seed hosts providers [settings]
[2020-07-11T16:10:20,141][INFO ][o.e.n.Node               ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] initialized
[2020-07-11T16:10:20,147][INFO ][o.e.n.Node               ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] starting ...
[2020-07-11T16:10:20,337][INFO ][o.e.t.TransportService   ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] publish_address {localhost/127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
[2020-07-11T16:10:20,641][WARN ][o.e.b.BootstrapChecks    ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[2020-07-11T16:10:20,642][WARN ][o.e.b.BootstrapChecks    ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
[2020-07-11T16:10:20,644][INFO ][o.e.c.c.Coordinator      ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] cluster UUID [Yt2MWu65TN2nbaMyiCmlGg]
[2020-07-11T16:10:20,665][INFO ][o.e.c.c.ClusterBootstrapService] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered
[2020-07-11T16:10:20,848][INFO ][o.e.c.s.MasterService    ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] elected-as-master ([1] nodes joined)[{cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01}{VIIMclatT62b7Hfg5Nl-TA}{mTpu48uiSfOkS1J79tVQnw}{localhost}{127.0.0.1:9300}{dilmrt}{ml.machine_memory=4127444992, xpack.installed=true, transform.node=true, ml.max_open_jobs=20} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 19, version: 33, delta: master node changed {previous [], current [{cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01}{VIIMclatT62b7Hfg5Nl-TA}{mTpu48uiSfOkS1J79tVQnw}{localhost}{127.0.0.1:9300}{dilmrt}{ml.machine_memory=4127444992, xpack.installed=true, transform.node=true, ml.max_open_jobs=20}]}
[2020-07-11T16:10:20,953][INFO ][o.e.c.s.ClusterApplierService] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] master node changed {previous [], current [{cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01}{VIIMclatT62b7Hfg5Nl-TA}{mTpu48uiSfOkS1J79tVQnw}{localhost}{127.0.0.1:9300}{dilmrt}{ml.machine_memory=4127444992, xpack.installed=true, transform.node=true, ml.max_open_jobs=20}]}, term: 19, version: 33, reason: Publication{term=19, version=33}
[2020-07-11T16:10:21,049][INFO ][o.e.h.AbstractHttpServerTransport] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] publish_address {localhost/127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
[2020-07-11T16:10:21,050][INFO ][o.e.n.Node               ] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] started
[2020-07-11T16:10:21,052][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01] fatal error in thread [main], exiting
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
	at org.elasticsearch.systemd.Libsystemd.lambda$static$0(Libsystemd.java:34) ~[?:?]
	at java.security.AccessController.doPrivileged(AccessController.java:312) ~[?:?]
	at org.elasticsearch.systemd.Libsystemd.<clinit>(Libsystemd.java:33) ~[?:?]
	at org.elasticsearch.systemd.SystemdPlugin.sd_notify(SystemdPlugin.java:126) ~[?:?]
	at org.elasticsearch.systemd.SystemdPlugin.onNodeStarted(SystemdPlugin.java:137) ~[?:?]
	at java.util.ArrayList.forEach(ArrayList.java:1510) ~[?:?]
	at org.elasticsearch.node.Node.start(Node.java:823) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:317) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:402) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.8.0.jar:7.8.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.8.0.jar:7.8.0]
sammy@cyberpanel-ubuntu-s-2vcpu-4gb-blr1-01:~$ 

Hi there @technewwings,

What is the exact error that you get?

What I could suggest is following this tutorial here on how to install ElasticSearch on Ubuntu 20.04:

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-20-04

Regards, Bobby