Installing x-pack with nonstandard CONF_DIR

Hi Folks,

My 5.2 elasticsearch.yml is in a non standard folder on my ubuntu system. The doc for x-pack package install,, indicates that you should be able to set the CONF_DIR or JAVA_OPTS to work around this for the install.

I had assumed this meant setting the system variable and exporting it before running: sudo -E bin/elasticsearch-plugin install x-pack. Unfortunately that doesn't seem to be the case. I've tried several permutations of this and I always get:

Unable to source environment file: //etc/default/elasticsearch

What am I not interpreting correctly here? Should I be setting other system variables?

Thanks, Mark


can you verify that the environment variables you are setting are available in the sudo call?
Also, can you provide full commands, that you tried, so we can see what happens?



This is what I have attempted:

export CONF_DIR=/etc/elasticsearch/node1
cd /usr/share/elasticsearch
sudo bin/elasticsearch-plugin install x-pack

bin/elasticsearch-plugin: line: 48 //etc/default/elasticsearch: Nos such file or directory
Unable to source environment file: //etc/defaul/elasticserach

setting the CONF_DIR and then executing sudo echo $CONF_DIR returns the value I set

Hi Alex,

OK, figured this out by looking at the /usr/share/elasticsearch/bin/elasticsearch-plugin script. The error was pointing to the default environmental file that is usually called: /etc/default/elasticsearch. The CONF_DIR or JAVA_OPTS did not work out for me but after viewing the plugin script, I found that I could export ES_INCLUDE with the correct value for my environment /etc/default/node1_elasticsearch (ansible created) and the subsequent command:

sudo -E bin/elasticsearch-plugin install x-pack succeeds!.

Thanks again for the help!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.