Merge commit 'd803bfe2b1fe7f5e219e50ac20d6801a0a58ac75' as 'vendor/ruvector'
This commit is contained in:
42
vendor/ruvector/tests/integration/distributed/node_runner.sh
vendored
Normal file
42
vendor/ruvector/tests/integration/distributed/node_runner.sh
vendored
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