start_indexer.sh
1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Start dedicated Indexer API Service
set -euo pipefail
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}"
INDEXER_HOST="${INDEXER_HOST:-0.0.0.0}"
INDEXER_PORT="${INDEXER_PORT:-6004}"
ES_HOST="${ES_HOST:-http://localhost:9200}"
ES_USERNAME="${ES_USERNAME:-}"
ES_PASSWORD="${ES_PASSWORD:-}"
echo -e "\n${YELLOW}Configuration:${NC}"
echo " INDEXER Host: ${INDEXER_HOST}"
echo " INDEXER Port: ${INDEXER_PORT}"
echo " ES Host: ${ES_HOST}"
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_PORT ES_HOST ES_USERNAME ES_PASSWORD
exec python main.py serve-indexer \
--host "${INDEXER_HOST}" \
--port "${INDEXER_PORT}" \
--es-host "${ES_HOST}"