Skip to content

Instantly share code, notes, and snippets.

@rbranson
Created May 4, 2020 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbranson/c75a72d0d9bad1c0a9a536682ba2c210 to your computer and use it in GitHub Desktop.
Save rbranson/c75a72d0d9bad1c0a9a536682ba2c210 to your computer and use it in GitHub Desktop.
Bash script to kill FoundationDB FDB master process
#!/bin/bash
status_json=$(fdbcli --exec 'status json')
master_addr=$(echo $status_json | jq -r '.cluster.processes[] | select(.roles[].role == "master") | .address')
# extra status json stuff workaround to bug in 6.0 where an immediate exit causes the command to not be sent
fdbcli --exec "status json; kill; kill $master_addr; status json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment