elastic / ansible-elasticsearch

Ansible playbook for Elasticsearch
Other
1.58k stars 854 forks source link

Use node.roles instead of deprecated setting for Elasticsearch 7.9+ #731

Open jmlrt opened 4 years ago

jmlrt commented 4 years ago

This role use node.master and node.data settings to define node roles. However these settings have beed deprecated in favor of node.roles setting in 7.9 (https://github.com/elastic/elasticsearch/pull/54998).

jmlrt commented 3 years ago

related to elastic/elasticsearch#66409

Bernhard-Fluehmann commented 3 years ago

@jmlrt It seems that up to now node role settings are done in es_conf and node. is only mentioned in README.md The easiest way would be to just update the readme files to use node.roles, but this would then not work on older versions. Another, more sophisticated solution would be to create a new variable called node_roles. This would allow to properly implement version specific configuration in template and use the variable to build legacy config for older versions. readme could easily be adopted to the new var. What do you think about?

abraxxa commented 3 years ago

I prefer the flexibility of es_conf and would just remove the now incorrect parts in README.md.

Bernhard-Fluehmann commented 3 years ago

Makes sense

bndabbs commented 3 years ago

I've also handled role assignments with inventory groups, which is useful for doing lookups to populate things like the seed hosts.

Something like this:

[elasticsearch:children]
es_master
es_data
es_ingest

[es_master]
elasticsearch0[1:3]

[es_data]
elasticsearch0[1:4]

[es_ingest]
elasticsearch0[1:4]

[elasticsearch:vars]
# Disable all node roles by default
node_master=false
node_data=false
node_ingest=false

[es_master:vars]
node_master=true

[es_data:vars]
node_data=true

[es_ingest:vars]
node_ingest=true
Bernhard-Fluehmann commented 3 years ago

I am doing it in a similar way. But instead of node_... I am using a variable which reflects the new config method.

es_node_roles:
- master
- data
- ingest

The benefits of the new method is that it is clearly visible what is enabled or not and therefore no disabling needed anymore.

botelastic[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jmlrt commented 3 years ago

still valid

botelastic[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jmlrt commented 3 years ago

still valid

botelastic[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

abraxxa commented 2 years ago

Still waiting for a fix.

botelastic[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.