Squashed 'vendor/ruvector/' content from commit b64c2172
git-subtree-dir: vendor/ruvector git-subtree-split: b64c21726f2bb37286d9ee36a7869fef60cc6900
This commit is contained in:
42
tests/integration/distributed/node_runner.sh
Normal file
42
tests/integration/distributed/node_runner.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# Ruvector Distributed Node Runner Script
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== Ruvector Distributed Node ==="
|
||||
echo "Node ID: ${NODE_ID}"
|
||||
echo "Role: ${NODE_ROLE}"
|
||||
echo "Raft Port: ${RAFT_PORT}"
|
||||
echo "Cluster Port: ${CLUSTER_PORT}"
|
||||
echo "Replication Port: ${REPLICATION_PORT}"
|
||||
echo "Cluster Members: ${CLUSTER_MEMBERS}"
|
||||
echo "Shard Count: ${SHARD_COUNT}"
|
||||
echo "Replication Factor: ${REPLICATION_FACTOR}"
|
||||
echo "================================="
|
||||
|
||||
# Health check endpoint (simple HTTP server)
|
||||
start_health_server() {
|
||||
while true; do
|
||||
echo -e "HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nOK" | nc -l -p ${CLUSTER_PORT} -q 1 2>/dev/null || true
|
||||
done
|
||||
}
|
||||
|
||||
# Start health server in background
|
||||
start_health_server &
|
||||
HEALTH_PID=$!
|
||||
|
||||
# Trap to cleanup on exit
|
||||
cleanup() {
|
||||
echo "Shutting down node ${NODE_ID}..."
|
||||
kill $HEALTH_PID 2>/dev/null || true
|
||||
exit 0
|
||||
}
|
||||
trap cleanup SIGTERM SIGINT
|
||||
|
||||
echo "Node ${NODE_ID} is running..."
|
||||
|
||||
# Keep container running
|
||||
while true; do
|
||||
sleep 5
|
||||
echo "[${NODE_ID}] Heartbeat - Role: ${NODE_ROLE}"
|
||||
done
|
||||
Reference in New Issue
Block a user