To remove an instance from a Nagios Log Server cluster is as simple as updating the cluster_hosts configuration file and restarting the Elasticsearch database service on each node.
As part of our Server Management Services, we assist our customers with Nagios queries.
Today, let us see how to remove an instance from a Nagios Log Server cluster.
Remove Instance From Nagios Log Server Cluster
In order to remove an instance from a cluster, our Support Techs suggest the following steps:
Stop Elasticsearch On All Instances
Initially, we establish terminal sessions to every instance in the cluster and execute:
RHEL 7+|CentOS 7+|CentOS Stream|Debian|Ubuntu 16/18/20
# systemctl stop elasticsearch.service
Update Configuration File
On all instances, we will update the /usr/local/nagioslogserver/var/cluster_hosts configuration file.
To do so, we open the file cluster_hosts in any text editor:
# vi /usr/local/nagioslogserver/var/cluster_hosts
Then we delete the line that has the address of the instance we remove. If we isolate an instance, then on that server we delete all the addresses of the other instances.
Once done, we save and close the file.
Start Elasticsearch On All Instances
Eventually, on every instance in the cluster, we execute:
RHEL 7+|CentOS 7+|CentOS Stream|Debian|Ubuntu 16/18/20
# systemctl start elasticsearch.service
If we isolate an instance, then we make sure to start the service on that server.
Verify Instances In Cluster
Once we make the changes and restart the service, we verify that everything is OK.
For that we execute the following commands on one of the instances:
# curl -XGET ‘http://localhost:9200/_cat/nodes?v’ # curl -XGET ‘http://localhost:9200/_cat/health?v’
To check the cluster status, open the Nagios Log Server web interface and navigate to Admin > System > Cluster Status.
If the instance is not able to have a copy of all the required shards, then it will be in the red state.
Delete Removed Instance
Finally, we delete the removed instance from the production cluster.
To do so, open the Nagios Log Server web interface and navigate to Admin > System > Instance Status.
In the Instances table, click the trashcan icon to delete the removed instance.
This removes an instance from a Nagios Log Server cluster.
Disable Snapshots & Maintenance
In addition, we need to disable snapshots & maintenance on the isolated instance.
Open the Nagios Log Server web interface and navigate to Admin > System > Snapshots & Maintenance.
In the Enable Maintenance and Snapshots option, select No and click Save Settings.
This ensures the isolated instance will not use the snapshot repository and will not cause issues with production.
[Need help with the removal? We’d be happy to assist]
Conclusion
In short, today we saw how our Support Techs go about removing an instance from a Nagios Log Server cluster.
0 Comments