I just had a weird thing, might be a bug or a feature, I'm not sure.
My elasticsearch.yml was like this:
cluster.name: blah
transport.tcp.port: 9308
http.port: 9208
The leading space on the line with cluster.name caused the transport.tcp
and http.port to be ignored. I guess it has to do with yml nesting.
In the logs nothing showed up about the ignored lines, I don't know exactly
how this works, but I feel this should be at least a warning.
Of course we removed the leading space which made it work again.
You got it right, it's because of the role of indentation in YAML, which is
similar to the way you'd indent code in Python (an indented property
"belongs" to the previous one). You can play with an online parser like
this one: http://yaml-online-parser.appspot.com/
And see how it would output your config in JSON.
Best regards,
Radu
On Mon, Jul 8, 2013 at 2:20 PM, Jaap Taal jaap@q42.nl wrote:
I just had a weird thing, might be a bug or a feature, I'm not sure.
My elasticsearch.yml was like this:
cluster.name: blah
transport.tcp.port: 9308
http.port: 9208
The leading space on the line with cluster.name caused the transport.tcp
and http.port to be ignored. I guess it has to do with yml nesting.
In the logs nothing showed up about the ignored lines, I don't know
exactly how this works, but I feel this should be at least a warning.
Of course we removed the leading space which made it work again.
Just like I said, I already figured that out, the point was that this could
be a mistake more people may make. Because the file already has a space
after every hash, deleting only the hash and not the space leads to this
unexpected result.
Suggestion:
All describing comments should have the space, all examples just waiting to
be uncommented => no spacing after the hash.
You got it right, it's because of the role of indentation in YAML, which
is similar to the way you'd indent code in Python (an indented property
"belongs" to the previous one). You can play with an online parser like
this one: http://yaml-online-parser.appspot.com/
And see how it would output your config in JSON.
Best regards,
Radu
On Mon, Jul 8, 2013 at 2:20 PM, Jaap Taal jaap@q42.nl wrote:
I just had a weird thing, might be a bug or a feature, I'm not sure.
My elasticsearch.yml was like this:
cluster.name: blah
transport.tcp.port: 9308
http.port: 9208
The leading space on the line with cluster.name caused the transport.tcp
and http.port to be ignored. I guess it has to do with yml nesting.
In the logs nothing showed up about the ignored lines, I don't know
exactly how this works, but I feel this should be at least a warning.
Of course we removed the leading space which made it work again.
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.