Closed jerrac closed 8 years ago
Hi @jerrac Could you please list the contents of the /etc/elasticsearch/node1 directory. If this contains a configuration file also please copy its contents here.
The /etc/elasticsearch/elasticsearch.yml should be deleted. I will raise a ticket for this and cleanup in the next release - which will be shortly.
The only required var is the es_instance_name. Will try to reproduce.
The directory:
root@node1:/etc/elasticsearch# ls
elasticsearch.yml node1 logging.yml scripts
root@node1:/etc/elasticsearch# cd node1/
root@node1:/etc/elasticsearch/node1# ls
elasticsearch.yml logging.yml scripts
root@node1:/etc/elasticsearch/node1# ll
total 20
drwxr-xr-x 3 elasticsearch elasticsearch 4096 Jan 21 12:53 ./
drwxr-x--- 4 root elasticsearch 4096 Jan 21 12:53 ../
-rw-r--r-- 1 elasticsearch elasticsearch 1062 Jan 21 12:53 elasticsearch.yml
-rw-r--r-- 1 elasticsearch elasticsearch 2052 Jan 21 12:53 logging.yml
drwxr-xr-x 2 elasticsearch elasticsearch 4096 Jan 21 12:53 scripts/
The logging.yml file:
root@node1:/etc/elasticsearch/node1# cat logging.yml
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: INFO
rootLogger: ${es.logger.level}, console, file
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN
org.apache.http: INFO
# gateway
#gateway: DEBUG
#index.gateway: DEBUG
# peer shard recovery
#indices.recovery: DEBUG
# discovery
#discovery: TRACE
index.search.slowlog: TRACE, index_search_slow_log_file
index.indexing.slowlog: TRACE, index_indexing_slow_log_file
additivity:
index.search.slowlog: false
index.indexing.slowlog: false
appender:
console:
type: console
layout:
type: consolePattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
file:
type: dailyRollingFile
file: ${path.logs}/${cluster.name}.log
datePattern: "'.'yyyy-MM-dd"
layout:
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
# Use the following log4j-extras RollingFileAppender to enable gzip compression of log files.
# For more information see https://logging.apache.org/log4j/extras/apidocs/org/apache/log4j/rolling/RollingFileAppender.html
#file:
#type: extrasRollingFile
#file: ${path.logs}/${cluster.name}.log
#rollingPolicy: timeBased
#rollingPolicy.FileNamePattern: ${path.logs}/${cluster.name}.log.%d{yyyy-MM-dd}.gz
#layout:
#type: pattern
#conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
index_search_slow_log_file:
type: dailyRollingFile
file: ${path.logs}/${cluster.name}_index_search_slowlog.log
datePattern: "'.'yyyy-MM-dd"
layout:
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
index_indexing_slow_log_file:
type: dailyRollingFile
file: ${path.logs}/${cluster.name}_index_indexing_slowlog.log
datePattern: "'.'yyyy-MM-dd"
layout:
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
Could:
Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/config
Be a key? That directory or file does not exist on my node.
When googling, I remember seeing something about service elasticsearch start
being different from /usr/share/elasticsearch/bin/elasticsearch
. Maybe something about the config they load being different?
Is /etc/init.d/node1_elasticsearch
loading config from /etc/elasticsearch/node1
, and /usr/share/elasticsearch/bin/elasticsearch
defaulting to /usr/share/elasticsearch/config
?
I managed to get the cluster started. Once I figured out that logs were in /opt/elasticsearch/logs, I was able to use them to diagnose my problems.
So, there wasn't anything wrong with the elasticsearch ansible role. :) Well, unless the role is the reason logs are not in /var/logs... In which case, why?
I also think that the initial error I reported was caused by the fact that /etc/init.d/node1_elasticsearch
loads config from /etc/elasticsearch/node1
, and /usr/share/elasticsearch/bin/elasticsearch
loads from /usr/share/elasticsearch/config
.
Now to figure out why it's complaining about there being no known master. But that's different is.
Thanks for the help. What you asked about provided the clues I needed.
:)
I'm getting the same problem. I've just installed from the deb package and I ran it them I got this Exception.
Exception in thread "main" ElasticsearchException[Failed to load logging configuration]; nested: 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.resolveConfig(LogConfigurator.java:146)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:110)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:242)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:111)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:106)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:91)
at org.elasticsearch.cli.Command.main(Command.java:53)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:74)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:67)
Refer to the log for complete error details.
Hi @johnnywell please attach your playbook configuration. I'll see if we can reproduce with a test.
Actually , I've removed the package already . But using the zip or tar.gz packages this problem does not occurs.
Basically the deb version doesn't has the config dir.
edit the config file ,set the conf.path
/etc/elasticsearch/
this is my path ,it must contains the logging.yml
it will be ok
Any update on this? I'm having the same issue
any update also on this? stuck on this..
@robcaw @vvavepacket can you please share your playbook?
I too getting this error.. How can i solve this.?
I ran into the same error as well after a new install of elasticsearch-2.3.3.rpm. For some reason it's looking for the config file in /usr/share/elasticsearch/config instead of /etc/elasticsearch.
As a quick fix I simply created a symbolic link to solve the issue. ln -s /etc/elasticsearch/ /usr/share/elasticsearch/config
Apart from all these issues.. ElasticSearch also failed to start On Ubuntu 16.04 with OpenJDK 9
Reopen this issue please, i have the same problem:
~ elasticsearch ✓ 1874 00:23:42
Exception in thread "main" ElasticsearchException[Failed to load logging configuration]; nested: 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.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:142)
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:103)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:243)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
I tried to solve using this: ln -s /etc/elasticsearch/ /usr/share/elasticsearch/config
.
But now i have other problem:
elasticsearch ✓ 1884 00:34:43
Exception in thread "main" ElasticsearchException[Failed to load logging configuration]; nested: AccessDeniedException[/usr/share/elasticsearch/config/scripts];
Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/config/scripts
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:427)
at java.nio.file.Files.newDirectoryStream(Files.java:457)
at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:300)
at java.nio.file.FileTreeWalker.next(FileTreeWalker.java:372)
at java.nio.file.Files.walkFileTree(Files.java:2706)
at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:142)
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:103)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:243)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
I haven't this problem in Ubuntu, but Antergos. I installed elasticsearch from community, so, i don't know why doesn't work.
+1 reopen this issue..
@SalahAdDin can you please post your playbook? Do you get this error when starting via init script or manually by running bin/elasticsearch
?
@shivarajnaidu OpenJDK9 is not yet GA (see http://openjdk.java.net/projects/jdk9/) and elasticsearch is not yet tested against OpenJDK9. Does it work for you with OpenJDK8? If not, please open a new issue as this seems to be another problem then.
Thanks for your information @jakommo . Works fine with openjdk 8
@jakommo This is the traceback:
which elasticsearch ✓ 1937 12:36:55
/usr/bin/elasticsearch
salahaddin@TulipanROG ~ elasticsearch ✓ 1938 12:37:20
Exception in thread "main" ElasticsearchException[Failed to load logging configuration]; nested: 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.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:142)
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:103)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:243)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
@SalahAdDin if you install via deb/rpm package, ES is meant to run via the initscript (e.g. service node1_elasticsearch start
) and not manually. This is not only true for the install via ansible, but in general.
If you run it manually, you need to pass -Des.path.conf=/path/to/config/
and do this as elasticsearch
user, otherwise permissions can get screwed up.
Example:
es_instance_name: "node1"
used in playbooksu - elasticsearch --shell /bin/bash
cd /usr/share/elasticsearch/
bin/elasticsearch -Des.path.conf=/etc/elasticsearch/node1
[2016-08-10 19:13:41,179][INFO ][node ] [node1] version[2.2.0], pid[2428], build[8ff36d1/2016-01-27T13:32:39Z]
[2016-08-10 19:13:41,179][INFO ][node ] [node1] initializing ...
[2016-08-10 19:13:41,787][INFO ][plugins ] [node1] modules [lang-groovy, lang-expression], plugins [], sites []
[2016-08-10 19:13:41,818][INFO ][env ] [node1] using [1] data paths, mounts [[/ (LXD/containers/sdf-20160810-210439trusty-64-jre-1)]], net usable_space [30.3gb], net total_space [31gb], spins? [possibly], types [zfs]
[2016-08-10 19:13:41,818][INFO ][env ] [node1] heap size [990.7mb], compressed ordinary object pointers [true]
Can you elaborate why you want to run it manually?
For further help, please provide your playbook
and which distro/version you are deploying to.
I was trying to test why i haven't access to elasticsearch
api with curl
command.
But it was solve, in addition, i think that will be very useful put this aclarations in elasticsearch
documentation.
I'd installed elasticsearch
in Antergos form AUR
packages.
@jakommo "Can you elaborate why you want to run it manually?"
Because the intro video starts elasticsearch with ./bin/elasticsearch....
Thanks for the answer.
Binary installation(.deb) is waste of time. .. they even not starting on Ubuntu.. waste.. if you're not tested well then don't make them available through official channels. .. don't waste all people's time.. 😬
I'm having the same problem regardless of what operation I try to do. How can I change the reference to the non-existent config file to the real one?
I had, I think the same problem after installing on debian. I solved it by
1) Creating a the directories
$ mkdir -p /usr/share/elasticsearch/config/scripts
2) Copying over log and config files
$ cp /etc/elasticsearch/elasticsearch.yml /user/share/elasticshare/config
$ cp /etc/elasticsearch/logging.yml /user/share/elasticshare/config
3) Changing permissions or changing ownership on these files to. On my development i just
$ sudo chmod g+rwx /usr/share/elasticsearch/config/elasticsearch.yml /usr/share/elasticsearch/config/logging.yml
$ sudo chmod o+rwx /usr/share/elasticsearch/config/elasticsearch.yml /usr/share/elasticsearch/config/logging.yml
Which i'm ok with on my dev machine, but hopefully points the way for folks.
I too solved @olendorf .. But why we have to go through that mess(iee) packages.. This is shame to for this kind of big project not working properly .. Please I am requesting this community members.. If possible please provide binaries that would work properly or remove them.. Just provide compressed archive.. Don't make users to face this kind of nasty issues.. Even Not Getting Proper Response for Issues.. So sad :disappointed:
This should of been picked up so apologies to @shivarajnaidu @stylerOD @olendorf. It seems the isssue was closed and we didn't track. Reopening and addressing.
@shaunmackey @olendorf Please confirm the ES version and OS this issue arises on. Also please provide a simple playbook which reproduces. Currently i can't reproduce this issue but am keen to assist.
Hi @gingerwizard I believe I may have been tagged by mistake.
Apologies @shaunmackey meant to tag @shivarajnaidu
Hi @gingerwizard .. Thanks for your kind response...
Simply Do Fresh Installation Of Ubuntu 16.04
ES version : : "2.3.5", "lucene_version" : "5.5.0"
Then Download ES .deb
from es official website .. Then Do Installation with dpkg -i package_name
Now Try to access ES Fron Your Browser or simply try to start elastic search from /usr/elasticsearch/bin/elasticsearch ..
The above will fail to start elasticsearch
(playback means video playback ? Sorry Now I am using ES Zipped Archive.. And It's My Production System .. So I can't Experiment Again with That Now To Produce Video PlayBack.. But I am Sure The Above Will Reproduce The Issue.. Because I Have Tested Well This Bug exists.. Please Try To Reproduce it from Fresh Ubuntu 16.04 Installation)
@shivarajnaidu Your usecase appears to be an issue with the debian package and not the Ansible role itself. Are you able to produce this issue with 2.3.5 and an Ansible playbook? I will move the tests to 2.3.5 to verify but the Ansible role copies a logging.yml.
Additionally, you are starting the service from binary (WHY?) and NOT the service script - which will set the CONF_DIR and thus allow the logging.yml to be located. If there is still an issue, this should be raised in the main product repo.
IMHO this is not an issue. The deb/rpm package install is meant to be run by the init script, and this is working fine. If one wants to run the binary from a shell the zip/tar file is the way to go.
Agreed this is simply not an issue. @shivarajnaidu The debian package assumes you will use the service scripts which configure the appropriate paths.
This is an issue if you want to start a second node on the same machine and you are running elasticsearch as a service.
For example, the instruction in the guide says: " you can start a new node in exactly the same way as you started the first one" and then the user is pointed to ./bin/elasticsearch
, which doesn't work.
@SuzanaK the docs you are pointing to are for Elasticsearch in general, but not related to this ansible role. If you want to have multiple nodes with the ansible role, you should follow the Multi Node Server Installations.
If you just want to play with ES, then you should download the tgz/zip, which most of the instructions of The Definitive Guide are based on. This role is meant for more advanced setups, but not necessarily for the first steps with ES.
@jakommo Yes, that's what I had done afterwards. The tar works just fine.
same issue while installing X-Pack with ubuntu 16.10 but it is ok while runnig elasticsearch with command service elasticsearch start. May be documentation (4 of https://www.elastic.co/guide/en/x-pack/5.0/installing-xpack.html#xpack-package-installation ) should be updated with If you are using a DEB/RPM distribution of Elasticsearch, start elasticsearch with command service elasticsearch start
Guys, just to make this clear. If you use the role, then everything should be handled by the role, not by manually configuring/installing things. The whole point of a config managements in general is that everything is handled by it, without manual interaction. As this role is not yet ready for 5.0, you would need to manually set up, if you want to use 5.0.
Hi... I want to mention here one thing.. Please don't concentrate anisible things alone... elasticsearch also used by different kind of developers on day by day (All may not know about anisible things).... So it should play nicely for every one... (Just for example I am a node js developer.. using elasticsearch with nodejs .... But i don't need know about anisible or any installation... because i only concentrating on my work.. not installation stuf... it should be take care by package manager itself... if standard package not working properly as expected like all packages works.. Then what it means... ??? is't an issue...? and I am using elasticsearch doesn't mean i have to know/use anisible on my system... If i am installing through .deb/.rpm i should able to up and running elastic search like any other package on system.. That is normal behaviour... other than that definitely.. that would be package issue )
Any new?
Not sure what news you are looking for. See my comments above.
If you install via ansible (or deb/rpm), use the provided init/systemd scripts to start the process.
If you just want to play with Elasticsearch. Download the .zip, extract, run bin/elasticsearch
.
I just installed elastic 5.1.1 on a fresh ubuntu box following the official deb / apt-get instructions with Java8 and I'm hitting this exact same error. This should just work with systemd. It's looking for the config file in the wrong directory..
any updates on this issue? i'm hitting same issue.
Its was resolved in master.
I got this issue when I installed elasticsearch 5.2, using deb file on ubuntu 14.04. First time in elasticsearch.yml file, setting values to network.host and http.port, I tried to run sudo service elasticsearch start. It throws error saying like
[2017-02-13T19:37:49,270][WARN ][o.e.c.l.LogConfigurator ] ignoring unsupported logging configuration file [/etc/elasticsearch/logging.yml], logging is configured via [/etc/elasticsearch/log4j2.properties
After getting the above error, I went to elasticsearch.yml file and uncommented cluster.name and node.name properites without changing default values. Again, I tried running sudo service elasticsearch start.
Now it is starts without error. Hope it helps someone. :)
The problem still persists installed through the Debian package for elasticsearch 5.2 on ubuntu 16.04.
It also exists on the docker container when mapping the volumes for the config as the instructions suggest:
docker run -d -v "$PWD/config":/usr/share/elasticsearch/config
4/7/2017 4:55:31 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:55:35 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:55:38 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:55:42 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:56:01 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:56:05 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:56:08 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:56:12 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:56:31 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:56:35 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:56:38 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:56:46 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
4/7/2017 4:57:01 PMERROR: no log4j2.properties found; tried [/usr/share/elasticsearch/config] and its subdirectories
It's still not solved..
Ubuntu 16.04, elasticsearch 5.4.0 deb package
Not solved...
I just did an initial test install with this role. I configured three nodes and ran the play. When I tried checking the health of the cluster, it became apparent that elasticsearch was not started.
So I tried starting it manually, and I got this:
Here are the ansible vars, just replace node1 with node2 or node3 to get the other nodes config:
Did I miss some required var?
I did try
/etc/init.d/node1_elasticsearch start
and it did not work, nor did it output any errors. JustStarting ... [OK]
./var/logs/elasticsearch
is empty so I can't figure anything out from there.So, what obvious step am I missing?
Should this kind of question be posted on discuss.elastic.co somewhere instead of here? If so, what forum?