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?
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?
export CONF_DIR=/etc/elasticsearch/node1
cd /usr/share/elasticsearch
sudo bin/elasticsearch-plugin install x-pack
returns:
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
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:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.