Closed CVTJNII closed 8 years ago
Hi @CVTJNII you mean that you would like to see data: true
for the data node? We don't do that because it's the default, like we don't do it when master is true as well. This will improve with #16963 where we are separating node roles from attributes, so that nodes info always outputs the roles, but they are not part of attributes anymore. What do you think of that?
Yes, I believe #16963 will help satisfy the spirit of the request as I'm using this output to determine what the cluster type is. However, I'd still prefer the values to be explicitly set, personally I always prefer explicit over implicit as it avoids confusion. I also find 'true' to be an unexpected default, for booleans I assume the default will be 'false', though I suppose if that's documented and I missed it then it's okay.
I'd would also like to point out that the master is returning 'master: true' and not omitting it as a default. As I mentioned above I prefer this behavior and think it would be beneficial if the data node could behave the same as well. Thanks.
If you rely on attributes to determine the node types, you need to take into account default values (in 2.x). All node types default to true
(including node.ingest
). With #16963 you can rely on the returned roles
array instead which will always contain the roles that each node fulfils in the cluster (no matter if you set them explicitly or not). Roles won't be part of attributes anymore though, so you will need to switch to reading from roles
from 5.0 on. I think we can consider this fixed.
While querying the /_nodes/ endpoint to categorize nodes for a test I've noticed my data node does not include the 'data' key in the attributes hash:
The master and client, however, do have this key set. The following shows the attributes hases for all 3 nodes in my test cluster, with data being the first:
Here is the complete output for the data node:
Elasticsearch version: 2.2.1 build d045fc2 JVM version: 1.8.0_72 OS version: elasticsearch:2 Docker container
Steps to reproduce: