You are not logged in.

#1 2013-12-13 10:04:27

andrej
Member
Registered: 2012-03-31
Posts: 21

Elasticsearch fails since moving to community repo

I noticed elasticsearch moving from aur to community during the latest upgrade. Ever since that upgrade I couldn't get elasticsearch to start with systemd.

$ systemctl status elasticsearch -l

Dec 13 10:50:56 devbox systemd[1]: Failed to start ElasticSearch.
Dec 13 10:50:56 devbox systemd[1]: Unit elasticsearch.service entered failed state.
Dec 13 10:50:56 devbox systemd[1]: elasticsearch.service holdoff time over, scheduling restart.
Dec 13 10:50:56 devbox systemd[1]: Stopping ElasticSearch...
Dec 13 10:50:56 devbox systemd[1]: Starting ElasticSearch...
Dec 13 10:50:56 devbox systemd[1]: elasticsearch.service start request repeated too quickly, refusing to start.
Dec 13 10:50:56 devbox systemd[1]: Failed to start ElasticSearch.
Dec 13 10:50:56 devbox systemd[1]: Unit elasticsearch.service entered failed state.

I tried removing and reinstalling es and jre and it didn't help. Did I miss something?

Any help would be greatly appreciated.

Thanks

Offline

#2 2013-12-16 08:08:56

ryosaeba83
Package Maintainer (PM)
From: Como (Italy)
Registered: 2008-07-21
Posts: 34
Website

Re: Elasticsearch fails since moving to community repo

Hi,
I'm the maintainer of elasticsearch.

Can you post here the output of the following commands?

ls /etc/profile.d
grep -rn JAVA /etc/profile.d
journalctl -au elasticsearch

TU id: mtorromeo
My packages: Community, AUR

Offline

#3 2013-12-16 09:47:06

andrej
Member
Registered: 2012-03-31
Posts: 21

Re: Elasticsearch fails since moving to community repo

[dev@devbox ~]$ ls /etc/profile.d
jre.csh*  jre.sh*  locale.sh*  perlbin.csh*  perlbin.sh*

[dev@devbox ~]$ grep -rn JAVA /etc/profile.d
/etc/profile.d/jre.sh:1:export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk/jre}
/etc/profile.d/jre.sh:4:#export _JAVA_AWT_WM_NONREPARENTING=1
/etc/profile.d/jre.csh:1:setenv JAVA_HOME "/usr/lib/jvm/java-7-openjdk/jre"
/etc/profile.d/jre.csh:4:#setenv _JAVA_AWT_WM_NONREPARENTING 1

[dev@devbox ~]$ sudo journalctl -aeu elasticsearch
Dec 16 00:27:10 devbox elasticsearch[755]: You must set the ES_CLASSPATH var
Dec 16 00:27:10 devbox systemd[1]: elasticsearch.service: control process exited, code=exited status=1
Dec 16 00:27:10 devbox systemd[1]: Failed to start ElasticSearch.
Dec 16 00:27:10 devbox systemd[1]: Unit elasticsearch.service entered failed state.
Dec 16 00:27:10 devbox systemd[1]: elasticsearch.service holdoff time over, scheduling restart.
Dec 16 00:27:10 devbox systemd[1]: Stopping ElasticSearch...
Dec 16 00:27:10 devbox systemd[1]: Starting ElasticSearch...
Dec 16 00:27:10 devbox systemd[1]: elasticsearch.service start request repeated too quickly, refusing t
Dec 16 00:27:10 devbox systemd[1]: Failed to start ElasticSearch.
Dec 16 00:27:10 devbox systemd[1]: Unit elasticsearch.service entered failed state.

Hmm, where do i set the ES_CLASSPATH?

Offline

#4 2013-12-16 10:24:53

ryosaeba83
Package Maintainer (PM)
From: Como (Italy)
Registered: 2008-07-21
Posts: 34
Website

Re: Elasticsearch fails since moving to community repo

You shouldn't have to.

/usr/bin/elasticsearch should source /usr/share/elasticsearch/elasticsearch.in.sh where the ES_CLASSPATH is already set for you.

Everything should be working correctly if you have not modified the systemd service file providing environment variables such as ES_INCLUDE or modified /usr/bin/elasticsearch or /usr/share/elasticsearch/elasticsearch.in.sh and /usr/share/elasticsearch/elasticsearch.in.sh is readable by the elasticsearch user (it should be world-readable).

What output do you get if you try starting it manually?

sudo -u elasticsearch elasticsearch -f

TU id: mtorromeo
My packages: Community, AUR

Offline

#5 2013-12-16 11:26:12

andrej
Member
Registered: 2012-03-31
Posts: 21

Re: Elasticsearch fails since moving to community repo

Running manually seems to be working.

Looking at /etc/systemd/system/elasticsearch.service.d/env.conf the ES_INCLUDE path is wrong:

[Service]
Environment=PATH=/opt/java/bin:/usr/local/sbin:/usr/local/bin:/usr/bin
Environment=ES_HOME=/usr/share/elasticsearch
Environment=ES_INCLUDE=/usr/share/elasticsearch/bin/elasticsearch.in.sh

After fixing that I can start the service normally with systemd.

Was that a leftover from the AUR package I had installed before?

Thanks for the help!

Offline

#6 2013-12-16 12:48:16

ryosaeba83
Package Maintainer (PM)
From: Como (Italy)
Registered: 2008-07-21
Posts: 34
Website

Re: Elasticsearch fails since moving to community repo

Yes, the env.conf is not part of the package and given its content you should be fine by removing it altogether.


TU id: mtorromeo
My packages: Community, AUR

Offline

Board footer

Powered by FluxBB