Hi, I'm learning elasticsearch and trying to run multiple nodes or 2 services of elasticsearch. the both work smoothly but the both use the same config file even I already point the another one to use different config file.
this is the output of node info:
node info.json
{
"cluster_name": "elasticsearch",
"nodes": {
"kpSUqEDETiq_bIzpheJ6LA": {
"name": "Node client balancer",
"transport_address": "inet[/127.0.0.1:9300]",
"host": "mockie-notebook",
"ip": "127.0.1.1",
"version": "1.6.0",
"build": "cdd3ac4",
This file has been truncated. show original
as you can see above (the gist link) :
"config.ignore_system_properties": "true",
"config": "/etc/elasticsearch/elasticsearch1.yml",
but it seems the node ignores /etc/elasticsearch/elasticsearch1.yml file and keep using /etc/elasticsearch/elasticsearch.yml.
/etc/init.d/elasticsearch1
and please take a look for these code/output:
elasticsearch
#!/bin/sh
#
# /etc/init.d/elasticsearch -- startup script for Elasticsearch
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Tomcat by Stefan Gybas <sgybas@debian.org>.
# Modified for Tomcat6 by Thierry Carrez <thierry.carrez@ubuntu.com>.
# Additional improvements by Jason Brittain <jason.brittain@mulesoft.com>.
# Modified by Nicolas Huray for Elasticsearch <nicolas.huray@gmail.com>.
This file has been truncated. show original
elasticsearch.yml
##################### Elasticsearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# Elasticsearch comes with reasonable defaults for most settings,
This file has been truncated. show original
elasticsearch1.yml
##################### Elasticsearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# Elasticsearch comes with reasonable defaults for most settings,
This file has been truncated. show original
I'm using ubuntu 14.04 LTS
warkolm
(Mark Walkom)
August 16, 2015, 11:59pm
2
Try adding set -x
to the top of the script and it'll provide some level of debugging, then you can see if your $NODE
variable is being correctly set.
ooh i forgot to tell you I already debug it and this is the output
start-stop-daemon --start -b --user "elasticsearch" -c "elasticsearch" --pidfile "/var/run/elasticsearch1.pid" --exec
/usr/share/elasticsearch/bin/elasticsearch -- -d -p /var/run/elasticsearch1.pid --
default.config=/etc/elasticsearch/elasticsearch1.yml
--default.path.home=/usr/share/elasticsearch
--default.path.logs=/var/log/elasticsearch1
--default.path.data=/var/lib/elasticsearch1
--default.path.work=/tmp/elasticsearch
--default.path.conf=/etc/elasticsearch
warkolm
(Mark Walkom)
August 17, 2015, 1:31am
4
Looking at the _nodes
output;
"config.ignore_system_properties": "true",
"config": "/etc/elasticsearch/elasticsearch.yml",
And;
"config.ignore_system_properties": "true",
"config": "/etc/elasticsearch/elasticsearch1.yml",
They appear to be different?
is it because I run two instance of elasticsearch?
sudo service elasticsearch start which is use /etc/elasticsearch/elasticsearch.yml config
sudo service elasticsearch1 start which is use /etc/elasticsearch/elasticsearch1.yml config
they appear different but when I open localhost:9200/plugin/_head it tell me the both have the same name "Node client balancer" (read from /etc/elasticsearch/elasticsearch.yml and ignore /etc/elasticsearch/elasticsearch1.yml).
but when I click the second node info, it show up like this https://gist.github.com/mockiemockiz/738f7b81ec5099b3d8f6
Hello I edited my question and I added some links to the files
so sad this forum is a bit quiet. I solved my proble by setting up ES_JAVA_OPTS variable in init.d file script like this:
ES_JAVA_OPTS="-Des.config=/etc/elasticsearch/elasticsearch1.yml"
I have no idea why setting up CONF_FILE=$CONF_DIR/elasticsearch1.yml doesn't work even if the node info says
"config": "/etc/elasticsearch/elasticsearch1.yml".
hope that helps I was struggling one week to solve this.
json
(Jason Bryan)
August 18, 2015, 7:49pm
7
mockiemockiz:
show original
Thank you for posting the solution. Configuring '-Des.config=/path/to/es/config' is the way.