How to install/upgrade elasticsearch cluster via ansible?
First, we have a playbook:
1 | - hosts: es |
serial: "50%"
means ansbile will run tasks in 50% of hosts (or less).
And, we should add a rule elasticsearch
:
1 |
|
- we try to disable allocation for cluster upgrade
- download elasticsearch’s deb package to local cache
- install and configure, restart elasticsearch
- wait 9200 port is available, enable allocation, wait for cluster become green.
some vars:
1 |
|