A YAML syntax error in elasticsearch.yml causes Elasticsearch to fail without logging.
Leaving out the space between the colon and the value in an entry causes Elasticsearch to fail to start without logging the failure.
Example:
index.number_of_shards:6
instead of
index.number_of_shards: 6
Attempting to start the service shows that it fails.
[FAIL] Starting Elasticsearch Server: failed!
But there is no information in the logs.
Elasticsearch version: 1.7.1
The same issue exists if you leave a space BEFORE the cluster name. By default, it is commented out with a #, then a space, then cluster.name. If you remove the # but not the space when you name your cluster, a silent exception (unlogged) occurs but the instance won't start.
Good catch !!
This has been fixed in 2.0, which would now throw an exception like the following:
Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: ElasticsearchParseException[malformed, expected settings to start with 'object', instead was [VALUE_STRING]];
Likely root cause: ElasticsearchParseException[malformed, expected settings to start with 'object', instead was [VALUE_STRING]]
I found that adding a space after the colon (:) in your configurations was necessary. Visual Studio also smiled when I gave a space after : example configuration:
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: http://localhost:1358,http://127.0.0.1:1358
http.cors.allow-headers: X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
http.cors.allow-credentials: true
Note the space after : :)
Most helpful comment
I found that adding a space after the colon (:) in your configurations was necessary. Visual Studio also smiled when I gave a space after : example configuration:
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: http://localhost:1358,http://127.0.0.1:1358
http.cors.allow-headers: X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
http.cors.allow-credentials: true
Note the space after
::)