Thanks,
This is what I have attempted:
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