IN THIS ARTICLE
Outlines how to shutdown a cluster using the Qumulo API with curl
- A computer with the curl and jq commands installed
- Admin privileges to your Qumulo cluster
For monitoring system based automatic shutdown, please refer to the documentation of your monitoring system on triggering script execution on specific events or alerts.
How to trigger a safe shutdown of a Qumulo cluster with automation or bash scripting is possible using the Qumulo API. We hope you never experience an HVAC failure in your data center or any other reason you may need to safely shut down your cluster due to an emergency. Should the need arise, this article will show you how you can use curl or a bash script to do so.
The sample bash shell script or example commands can be used to safely power down your Qumulo cluster. Most modern network monitoring systems can handle event triggers or can execute a script based or shell commands based on alert criteria. You can use the attached sample bash script with your monitoring system to perform an emergency shutdown.
It is important to know that shutting down a cluster while clients are writing to the cluster may lead to the loss or corruption of data. Whenever possible, stop you clients write activity before shutting down your cluster.
- First, you will need a bearer token to place further API calls at the Bash prompt or in your script. Replace the bold text with the correct cluster name and admin password.
$> TOKEN=$(curl -k -X "POST" "https://qumulo.company.tld:8000/v1/session/login"
- Send the command to shutdown the cluster safely with the token that was just generated. Again, replace all bold text with the correct values for your cluster.
$> PROMPT$ curl -k -X "GET" "https://qumulo.company.tld:8000/v1/node/state" \n
- To shut down the command as a "one-liner" use the example below and replace the bold text. Send the command to shutdown the cluster safely with the token that was just generated. Again, replace all bold text with the correct values for your cluster.
$> curl -k -X "POST" "https://qumulo.company.tld:8000/v1/cluster/halt" -H "Authorization:
Note that you can also use the sample bash script "HaltCluster.sh" to achieve the same goal or as a starting point to customize the script for your needs.
You should now be able to successfully shutdown a Qumulo Cluster using API with curl
Like what you see? Share this article with your network!