From d1374bda8285a3210621e15ad062b5711b7d4a9d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 18 Aug 2026 17:19:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(worker):=20start.sh=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=A4=9A=20worker=20=E5=AE=9E=E4=BE=8B(bash=20start.sh=20worke?= =?UTF-8?q?r=20=EF=BC=8C=E7=AB=AF=E5=8F=A3=209090+id=EF=BC=8C=E7=8B=AC?= =?UTF-8?q?=E7=AB=8B=20pid)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/start.sh b/start.sh index db74f0c..fc9f41a 100755 --- a/start.sh +++ b/start.sh @@ -7,12 +7,17 @@ cd "$WORKDIR" [ -f .smssend ] && source .smssend # 运行模式:all(默认,HTTP+poller) / web(仅HTTP,无poller) / worker(仅poller,分布式worker节点) +# 多 worker 本机/跨机测试:bash start.sh worker (id=1,2,3...,端口 9090+id,pid 独立) MODE="${1:-all}" case "$MODE" in - web) PORT=9090; PIDFILE="pipeline-web.pid"; PIPELINE_MODE=web ;; - worker) PORT=9091; PIDFILE="pipeline-worker.pid"; PIPELINE_MODE=worker ;; - all) PORT=9090; PIDFILE="pipeline.pid"; PIPELINE_MODE=all ;; - *) echo "用法: $0 [web|worker|all]"; exit 1 ;; + web) PORT=9090; PIDFILE="pipeline-web.pid"; PIPELINE_MODE=web ;; + worker) + WID="${2:-1}" + PORT=$((9090 + WID)) + PIDFILE="pipeline-worker-${WID}.pid" + PIPELINE_MODE=worker ;; + all) PORT=9090; PIDFILE="pipeline.pid"; PIPELINE_MODE=all ;; + *) echo "用法: $0 [web|worker |all]"; exit 1 ;; esac export PIPELINE_MODE