start_indexer.sh 995 Bytes
#!/bin/bash

# Start dedicated Indexer API Service

set -e

cd "$(dirname "$0")/.."
source ./activate.sh

GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'

echo -e "${GREEN}========================================${NC}"
echo -e "${GREEN}Starting Indexer API Service${NC}"
echo -e "${GREEN}========================================${NC}"

echo -e "\n${YELLOW}Configuration:${NC}"
echo "  INDEXER Host: ${INDEXER_HOST:-0.0.0.0}"
echo "  INDEXER Port: ${INDEXER_PORT:-6004}"
echo "  ES Host: ${ES_HOST:-http://localhost:9200}"
echo "  ES Username: ${ES_USERNAME:-not set}"

echo -e "\n${YELLOW}Starting indexer service...${NC}"

# Export environment variables for the Python process
export INDEXER_HOST=${INDEXER_HOST:-0.0.0.0}
export INDEXER_PORT=${INDEXER_PORT:-6004}
export ES_HOST=${ES_HOST:-http://localhost:9200}
export ES_USERNAME=${ES_USERNAME:-}
export ES_PASSWORD=${ES_PASSWORD:-}

python main.py serve-indexer \
  --host $INDEXER_HOST \
  --port $INDEXER_PORT \
  --es-host $ES_HOST