1
votes

Maybe I am thick, but I can't seem to find a way to pass ES a config file path from the command line. I have been searching and reading for 45 mins now (including several posts on Stack Overflow), and none of the proposed solutions works.

Here are the ones I tried:

elasticsearch -Des.config=/path/to/my/elasticsearch.yml ==> ERROR: D is not a recognized option

elasticsearch -Ees.config=/path/to/my/elasticsearch.yml ==> org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [es.config] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

elasticsearch -Econfig=/path/to/my/config.yml ==> org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [config] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

elasticsearch -Epath.conf=/path/to/config/dir/with/elasticsearch.yml ==> No exception, but the program terminates without any output whatsoever (no error message). Since I didn't specify the -d option, I am assuming that it's not running as a daemon and that therefore, the ES server is not running by the end of that.

Can anyone pull me out of the mud here?

Thx.

1
Were you able to figure this out ?Prashanth
> Were you able to figure this out ? – Prashanth yesterdayAlain Désilets

1 Answers

0
votes

I too struggled with the same issue and tried the same sort of commands as you did. The problem here is caused due to the version of elastic search.

If your version is above 5.0.0 and as per this none of the above commands will work. Also it looks like they have limited the types of parameters that can be passed from the command line.

The easiest way is to just cd to the directory you installed elasticsearch and then just ./bin/elasticsearch (Make sure you don't execute it as root, it doesn't allow you to run as root.)

The issue here is that after every new version of ES, some older functionality gets removed/updated which is frustrating. I'm currently working with Elasticsearch v6.4.0 and as for now this works.