Python functions as REST objects, with clustering, load balancing and state replication; no containers or orchestration.

0 downloads

dbbasic-object-primitive/restart_cluster.sh
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-object-primitive.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-object-primitive.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-object-primitive.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

Dan Q Consolidate duplicate QUICKSTARTs on the top-level file 503f830 7 months ago History
restart_cluster.sh · 1.4 KB · 40 lines
1#!/bin/bash
2# Restart heartbeat daemons on worker stations
3# Run this from the master station after deploying new code
4# Reads configuration from cluster.tsv
5
6# Load cluster configuration
7eval "$(python cluster_shell_helper.py)"
8
9echo "=== Restarting Cluster Heartbeat Daemons ==="
10echo
11
12# Restart worker 1
13if [ -n "$WORKER1_SSH" ]; then
14 echo "Restarting $WORKER1_ID ($WORKER1_HOST)..."
15 ssh "$WORKER1_SSH" "pkill -f cluster_heartbeat_daemon.py; sleep 1; cd ~/multiplexing && source .venv/bin/activate && nohup python cluster_heartbeat_daemon.py $MASTER_HOST --station-id $WORKER1_ID > heartbeat.log 2>&1 &"
16 echo "✓ $WORKER1_ID heartbeat restarted"
17 sleep 2
18 echo
19fi
20
21# Restart worker 2
22if [ -n "$WORKER2_SSH" ]; then
23 echo "Restarting $WORKER2_ID ($WORKER2_HOST)..."
24 ssh "$WORKER2_SSH" "pkill -f cluster_heartbeat_daemon.py; sleep 1; cd ~/multiplexing && source .venv/bin/activate && nohup python cluster_heartbeat_daemon.py $MASTER_HOST --station-id $WORKER2_ID > heartbeat.log 2>&1 &"
25 echo "✓ $WORKER2_ID heartbeat restarted"
26 sleep 2
27 echo
28fi
29
30echo "=== Heartbeat Daemons Restarted ==="
31echo
32
33echo "Waiting 5 seconds for heartbeats to register..."
34sleep 5
35echo
36
37echo "Cluster status:"
38curl -s http://localhost:${MASTER_PORT}/cluster/stations | python3 -m json.tool | grep -E "station_id|version|is_active" | head -20
39echo
40echo "✓ Check dashboard: http://localhost:${MASTER_PORT}/dashboard"