NETWAYS / ansible-collection-elasticstack

A collection to install and manage the Elastic Stack
GNU General Public License v3.0
9 stars 8 forks source link

Remove redundant restart #279

Closed widhalmt closed 8 months ago

widhalmt commented 9 months ago

Restarting Elasticsearch takes quite a while and may lead to connection issues as well as sync issues. So keeping restarts to a minimum is important. These changes will make sure that, even when the Restart Elasticsearch handler is notified, it will only restart if Elasticsearch was running before. If there's a fresh start (after reconfiguration) we don't need to restart again.

Same goes for Logstash and Kibana. Some restarts of these tools happen fairly fast. But others (like after fresh installs or updates) will trigger internal jobs that should not be intercepted by another restart.

Beats restart very fast and as far as I know there's not a big downside to restarting them right after the first start so I didn't include them in the change.

Additionally, this PR will make sure some tasks in verify.yml of the full stack are only run when the service to be checked is actually running on this node. This helps with spreading services over nodes to save ressources.

Since GitHub hosted runners are quite low on ressources we can't run every service on every node in a cluster setup anymore. So this PR will make sure that only Elasticsearch runs everywhere and the others are spread out.

Caches get cleared after every role in during a Molecule test. This helps with saving ressources, too.

Elasticsearch still won't sync all shards due to full volumes, the watermarks for Elasticseach are set to extremely high volumes so that the cluster can at least get into sync.

fixes #278 fixes #141 fixes #194

widhalmt commented 9 months ago

Seems like the Elasticsearch cluster still has problems syncing. I'll withdraw the request for review and get back to Draft.