Install Elasticsearch 2.4 using yum/dnf

Hi,

I have no problems downloading the tar.gz file and running elastic search manually. However, when I use dnf to install elasticsearch to run it as a service I cant get it to start.

I'm using the oracle jdk 1.8.0_102 and installed elasticsearch using dnf like here:
https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html

When I try to start the service, the systemctl status gives me this back:

elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2016-09-13 09:35:43 CEST; 2s ago
Docs: http://www.elastic.co
Process: 11211 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.pidfile=${PID_DIR}/elasticsearch.pid -Des.default.path.home=${ES_HOME} -Des.default.path.logs=${LOG_DIR} -Des.default.path.data=${DATA_DIR} -Des.default.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE)
Process: 11203 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 11211 (code=exited, status=1/FAILURE)

Sep 13 09:35:43 localhost.localdomain elasticsearch[11211]: at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:87)
Sep 13 09:35:43 localhost.localdomain elasticsearch[11211]: at org.elasticsearch.plugins.PluginsService.getModuleBundles(PluginsService.java:335)
Sep 13 09:35:43 localhost.localdomain elasticsearch[11211]: at org.elasticsearch.plugins.PluginsService.(PluginsService.java:114)
Sep 13 09:35:43 localhost.localdomain elasticsearch[11211]: at org.elasticsearch.node.Node.(Node.java:158)
Sep 13 09:35:43 localhost.localdomain elasticsearch[11211]: at org.elasticsearch.node.Node.(Node.java:140)
Sep 13 09:35:43 localhost.localdomain elasticsearch[11211]: at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143)
Sep 13 09:35:43 localhost.localdomain elasticsearch[11211]: at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:194)
Sep 13 09:35:43 localhost.localdomain systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Sep 13 09:35:43 localhost.localdomain systemd[1]: elasticsearch.service: Unit entered failed state.
Sep 13 09:35:43 localhost.localdomain systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

In /var/log/elasticsearch/elasticsearch.log, I can see this message:

[2016-09-13 09:35:43,950][INFO ][node ] [Adam X] version[2.4.0], pid[11211], build[ce9f0c7/2016-08-29T09:14:17Z]
[2016-09-13 09:35:43,950][INFO ][node ] [Adam X] initializing ...
[2016-09-13 09:35:43,954][ERROR][bootstrap ] Exception
java.lang.IllegalStateException: Unable to initialize modules
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:121)
at org.elasticsearch.node.Node.(Node.java:158)
at org.elasticsearch.node.Node.(Node.java:140)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:194)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/modules/ingest-common/plugin-descriptor.properties
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:87)
at org.elasticsearch.plugins.PluginsService.getModuleBundles(PluginsService.java:335)
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:114)
... 6 more

Installing the alpha 5 using dnf seems to work without problems, but I seem to just cant get the 2.4 release to run as a service.

Does anyone have an idea what's wrong here?

I played around a bit. I found that the modules folder had several empty plugin folders:

  • ingest-common
  • lang-mustache
  • lang-painless
  • perlocator
  • transport-netty3
  • transport-netty4
  • aggs-matrix-stats

After removing them I got a permission denied on

/var/lib/elasticsearch/nodes

So I did a

chown -R elasticsearch:elasticsearch /var/lib/elasticsearch

Now I can start elasticsearch as a service. Still have to find out what's with the empty module folders happening though.

edit
forgot to mention aggs-matrix-stats

edit2
Played around a bit more. When I tried to install the kopf Plugin, I got the following error message:

bin/plugin: line 20: dirname: command not found
bin/plugin: line 110: cut: command not found
bin/plugin: line 110: hostname: command not found

And the last line was something like

elasticsearch could not find any executable java binary

Executing the plugin install not as sudo but with my own user with a previous chown on /usr/share/elasticsearch/plugins worked however. The kopf plugin is now working.