Elasticsearch version: 5.0.0-rc1 (5.0.0-alpha1/2/beta1
Plugins installed: [] none
JVM version: Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
OS version: Ubuntu 14.04 x64
Description of the problem including expected versus actual behavior:
Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/config
Likely root cause: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/config
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.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:225)
at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322)
at java.nio.file.Files.walkFileTree(Files.java:2662)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:100)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:83)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:249)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:112)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:103)
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96)
at org.elasticsearch.cli.Command.main(Command.java:62)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73)
Steps to reproduce:
Did you install with deb, tar, or zip? We test all of those on every build so I'm surprised it isn't working for you.
deb apt-get
sudo apt-get install -y logstash
sudo apt-get install -y elasticsearch
sudo apt-get install -y kibana
Version: 5.0.0-rc1, Build: 13e62e1/2016-10-07T16:52:58.798Z, JVM: 1.8.0_112
I think that you installed via a package but are attempting to run from the command line instead of the service.
Indeed, I just tested with Ubuntu 14.04 and it started with sudo service elasticsearch start
.
yes but how can i run it without service start or systemctl or /etc/init.d ? i need to run it on production mode
@DimitrisFilippou The packages are meant to be run as a service. If you do not want to run as a service, you can install from the archive distributions. It is possible to run the package distributions standalone, but you have to add a bunch of command line flags for specifying various directory locations and we do not support this configuration. If you have additional questions please ask them on our forum; this issue is closed and we reserve GitHub for verified bug reports and feature requests.
I faced same thing while upgrading from 2.4.2 --> 2.4.3.
Couldn't find real reason but this workaround fixed (WILL ERASE ALL YOUR ES CONFIGS):
apt-get purge elasticsearch
apt-get install elasticsearch
systemctl restart elasticsearch
I get the same error, fresh install of deb package today, missing config dir
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.1.deb
dpkg -c elasticsearch-5.1.1.deb | grep config
<nothing>
If I compare with all my other elastic servers they all have a config directory, is it just to copy across?
(they are 5.0.0)
@fenchu You're not reading the information here carefully enough. This problem arises if you install the package but attempt to run it outside the service. If you have installed via a package manager, you should run via the service. If you want to run outside a service, you should install from an archive distribution. The config files are indeed present in the distribution though:
ubuntu-1604:~$ dpkg -c elasticsearch-5.1.1.deb | grep etc
drwxr-xr-x root/elasticsearch 0 2016-12-06 12:39 ./etc/
drwxr-xr-x root/elasticsearch 0 2016-12-06 12:39 ./etc/elasticsearch/
-rw-rw---- root/elasticsearch 3069 2016-12-06 12:39 ./etc/elasticsearch/elasticsearch.yml
-rw-rw---- root/elasticsearch 2862 2016-12-06 12:39 ./etc/elasticsearch/jvm.options
-rw-rw---- root/elasticsearch 3992 2016-12-06 12:39 ./etc/elasticsearch/log4j2.properties
drwxr-xr-x root/root 0 2016-12-06 12:39 ./etc/init.d/
-rwxr-x--- root/root 4473 2016-12-06 12:39 ./etc/init.d/elasticsearch
drwxr-xr-x root/root 0 2016-12-06 12:39 ./etc/default/
-rw-rw---- root/root 2217 2016-12-06 12:39 ./etc/default/elasticsearch
drwxr-x--- root/elasticsearch 0 2016-12-06 12:39 ./etc/elasticsearch/scripts/
ubuntu-1604:~$
@jasontedor do thanks for the clarification, will switch to this config. Never used the init.d found an elasticsearch.service that never worked well.
I added my console user to the elasticsearch group, changed config and logs to g+rws for elasticsearch group and run as this user with proper shell and logging. Then it worked as a charm. Now it works both as my user and as systemd service.
@fenchu You're welcome. I'm glad to hear that it's working for you now.
@jasontedor Thanks for the detailed explanation. Is there a way , i can set some ENV variable so that command line also works with .deb ? This would easily resolve everyone's concern in here.
If you want to run as command-line you're best off using the archive distributions.
I solved this problem using _sudo service elasticsearch start_ in Ubuntu 16.04. Thanks!
I am getting similar exception with elasticsearch-5.6.4-1.noarch. Let me explain my situation clearly. I am using CentOS7 64 bit.
I installed elasticsearch 5.6.3-1 and then removed folders in /usr/share/elasticsearch manually and uninstalled the rpm again. I try to install again elasticsearch-5.6.4-1 rpm again got below errors.
rpm -ivh elasticsearch-5.6.4.rpm
warning: elasticsearch-5.6.4.rpm: Header V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY
Preparing... ################################# [100%]
file /usr/lib/systemd/system/elasticsearch.service from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/aggs-matrix-stats/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/ingest-common/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/lang-expression/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/lang-groovy/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/lang-mustache/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/lang-painless/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/parent-join/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/percolator/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/reindex/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/transport-netty3/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
file /usr/share/elasticsearch/modules/transport-netty4/plugin-descriptor.properties from install of elasticsearch-0:5.6.4-1.noarch conflicts with file from package elasticsearch-0:5.6.3-1.noarch
Then, i understand the conflicts and removed completely with yum.
`yum remove elasticsearch
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package elasticsearch.noarch 0:5.6.4-1 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================================
Removing:
elasticsearch noarch 5.6.4-1 installed 36 M
Remove 1 Package
Installed size: 36 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 4 pre-existing rpmdb problem(s), 'yum check' output follows:
ipa-client-4.4.0-14.el7.centos.7.x86_64 has installed conflicts freeipa-client: ipa-client-4.4.0-14.el7.centos.7.x86_64
ipa-client-common-4.4.0-14.el7.centos.7.noarch has installed conflicts freeipa-client-common: ipa-client-common-4.4.0-14.el7.centos.7.noarch
ipa-common-4.4.0-14.el7.centos.7.noarch has installed conflicts freeipa-common: ipa-common-4.4.0-14.el7.centos.7.noarch
ipa-python-compat-4.4.0-14.el7.centos.7.noarch has installed conflicts freeipa-python-compat: ipa-python-compat-4.4.0-14.el7.centos.7.noarch
Stopping elasticsearch service... OK
Erasing : elasticsearch-5.6.4-1.noarch 1/1
Verifying : elasticsearch-5.6.4-1.noarch 1/1
Removed:
elasticsearch.noarch 0:5.6.4-1
Complete!`
Then i installed the 5.6.4-1 rpm again which has no config folder in /usr/share/elasticsearch causing failed to start elasticsearch.
@manrajesh Please read the contents of this issue, the cause of the problem that you're experiencing is already explained above.
Most helpful comment
Indeed, I just tested with Ubuntu 14.04 and it started with
sudo service elasticsearch start
.