askrobots / dbbasic-object-primitive
Public
Python functions as REST objects, with clustering, load balancing and state replication; no containers or orchestration.
stop_cluster.sh · 766 bytes · 30 lines
| 1 | #!/bin/bash |
| 2 | # Stop the entire cluster |
| 3 | # Run this from the master station |
| 4 | # Reads configuration from cluster.tsv |
| 5 | |
| 6 | # Load cluster configuration |
| 7 | eval "$(python cluster_shell_helper.py)" |
| 8 | |
| 9 | echo "=== Stopping ${WORKER_COUNT}-Station Cluster ===" |
| 10 | echo |
| 11 | |
| 12 | echo "Stopping workers..." |
| 13 | |
| 14 | # Stop worker 1 |
| 15 | if [ -n "$WORKER1_SSH" ]; then |
| 16 | ssh "$WORKER1_SSH" 'killall python3' && echo "✓ $WORKER1_ID stopped" || echo "⚠ $WORKER1_ID not running" |
| 17 | fi |
| 18 | |
| 19 | # Stop worker 2 |
| 20 | if [ -n "$WORKER2_SSH" ]; then |
| 21 | ssh "$WORKER2_SSH" 'killall python3' && echo "✓ $WORKER2_ID stopped" || echo "⚠ $WORKER2_ID not running" |
| 22 | fi |
| 23 | |
| 24 | echo |
| 25 | |
| 26 | echo "Master ($MASTER_ID) still running on this machine" |
| 27 | echo "Stop manually with Ctrl+C in terminal or: killall python" |
| 28 | echo |
| 29 | |
| 30 | echo "=== Cluster Stopped ===" |