Error in installing elasticsearch 6.7 and above

While installing elaticsearch 6.7 and above I am getting this error:
sudo systemctl start elasticsearch.service
could not find java in JAVA_HOME or bundled at /usr/lib/jvm/java-1.8.0-openjdk-
chown: cannot access ‘/etc/elasticsearch/elasticsearch.keystore’: No such file or directory
chmod: cannot access ‘/etc/elasticsearch/elasticsearch.keystore’: No such file or directory
md5sum: /etc/elasticsearch/elasticsearch.keystore: No such file or directory
warning: %posttrans(elasticsearch-0:7.0.1-1.x86_64) scriptlet failed, exit status 1
Also When I try to start elasticsearch it gives an error

I also have this error on one of my nodes when upgrading from 6.6 to 6.8 looks like something goes wrong during the upgrade

Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Installing : elasticsearch-6.8.0-1.noarch > 1/1
NOT starting on installation, please execute the following statements to configure
elasticsearch service to start automatically using systemd
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
You can start elasticsearch service by executing
sudo systemctl start elasticsearch.service
A tool for managing settings stored in the elasticsearch keystore
create - Creates a new elasticsearch keystore
list - List entries in the keystore
add - Add a string setting to the keystore
add-file - Add a file setting to the keystore
remove - Remove a setting from the keystore
Non-option arguments:
Option Description

-h, --help show help
-s, --silent show minimal output
-v, --verbose show verbose output
ERROR: Unknown command [upgrade]
warning: %posttrans(elasticsearch-0:6.8.0-1.noarch) scriptlet failed, exit status 64
Non-fatal POSTTRANS scriptlet failure in rpm package elasticsearch-6.8.0-1.noarch
Verifying : elasticsearch-6.8.0-1.noarch > 1/1

elasticsearch.noarch 0:6.8.0-1


then I get this when I try to start the service
elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2019-05-30 20:51:47 BST; 11h ago
Main PID: 21319 (code=exited, status=1/FAILURE)

May 30 20:51:36 node3 systemd[1]: Started Elasticsearch.
May 30 20:51:47 node3 elasticsearch[21319]: Exception in thread "main" java.lang.AssertionError: Lucene version mismatch this version of Elasticsearch requires lucene version [7.6.0] but the current lucene version is [7.7.0]
May 30 20:51:47 node3 systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
May 30 20:51:47 node3 systemd[1]: Unit elasticsearch.service entered failed state.
May 30 20:51:47 node3 systemd[1]: elasticsearch.service failed.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

As of Elasticsearch 7, we include a bundled JDK. You can specify your own JDK via JAVA_HOME, but that doesn't seem to work. Try unsetting the JAVA_HOME environment variable - in my CentOS system it was found in /etc/environment aside from the usual culprits.