{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"这篇解决什么问题"}]},{"type":"text","value":"：把本地节点跑在 Docker、docker compose 或 Kubernetes 里，按需要开多台放在自己的负载均衡后面。安装、注册令牌和渠道设置的基本概念见 "},{"type":"element","tagName":"a","properties":{"href":"local-nodes"},"children":[{"type":"text","value":"本地节点"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"本文用到的镜像和清单要求节点 0.4.40 或更新的版本。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"选哪种部署"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"方式"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"适合"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"依赖"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"单个容器"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"一台机器、一个节点"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"无"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"docker compose"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"一台机器上几个节点，前面一个 nginx"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"可选 Redis"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Kubernetes"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"集群里任意多个副本"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"可选 Redis"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"节点之间唯一可能共用的组件是 Redis，而且是可选的：一台节点不需要它，多台节点不配它也能工作，区别见下文「负载均衡与共享状态」。节点不需要数据库或消息队列。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"准备镜像"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"镜像从已发布的节点版本构建。构建文件在 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://www.jamerly.ai/tare-local-node/docker/"}]},{"type":"text","value":"："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"text","value":"mkdir tare-node && cd tare-node\nfor f in Dockerfile compose.yaml compose.dlp.yaml nginx.conf kubernetes.yaml Dockerfile.dlp-sidecar; do\n  curl -fsSLO \"https://www.jamerly.ai/tare-local-node/docker/$f\"\ndone\n\nVERSION=0.4.40\ndocker build --build-arg VERSION=$VERSION -t tare-local-node:$VERSION .\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"构建时从 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"s.jamerly.ai"}]},{"type":"text","value":" 下载这个版本的发布包，核对发布清单的 Ed25519 签名和包的 SHA-256，任何一项对不上都构建失败。签名用的是节点自动更新时校验的同一把公钥。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"镜像标签就是节点版本号，升级时换标签。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"要推到自己的仓库、同时出 amd64 和 arm64："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"docker buildx build --platform linux/amd64,linux/arm64 --build-arg VERSION=$VERSION -t <你的仓库>/tare-local-node:$VERSION --push ."}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"进程以非 root 用户（uid 10001）运行，所有要写的东西都在 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/var/lib/tare-local-node"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"镜像里自动更新是关着的（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_AUTO_UPDATE=off"}]},{"type":"text","value":"）。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"镜像里已经设好的变量："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"变量"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"镜像里的值"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_CONTROL_BASE_URL"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://tare.jamerly.ai"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_TUNNEL_ADDR"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"tare-grpc.jamerly.ai:443"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_LISTEN"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"0.0.0.0:8090"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_CREDENTIALS_PATH"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/var/lib/tare-local-node/credentials.json"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_SHUTDOWN_GRACE_SECONDS"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"300"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_AUTO_UPDATE"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"off"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"单个容器"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"text","value":"docker volume create tare-node-1\n\ndocker run -d --name tare-node-1 --restart unless-stopped \\\n  --stop-timeout 330 \\\n  -v tare-node-1:/var/lib/tare-local-node \\\n  -p 127.0.0.1:8090:8090 \\\n  -e TARE_API_KEY=<你账号下的一把推理 key> \\\n  -e TARE_REGISTRATION_TOKEN=<注册令牌> \\\n  tare-local-node:$VERSION\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"第一次启动用注册令牌换到节点身份，写进卷里的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"credentials.json"}]},{"type":"text","value":"。之后重启、换镜像都读这个文件，令牌可以从命令里去掉。日志里出现 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"tunnel connected as node …"}]},{"type":"text","value":"、控制台 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Local Nodes"}]},{"type":"text","value":" 里这台显示 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Online"}]},{"type":"text","value":"，就是注册成功了。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"业务把 base URL 指到 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"http://<这台机器>:8090/v1"}]},{"type":"text","value":"，带自己的 Tare API key。"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"-p 127.0.0.1:8090:8090"}]},{"type":"text","value":" 只让本机访问；要给别的机器用，改成需要的地址。能连上这个端口的调用方仍然要带有效的 API key。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--stop-timeout 330"}]},{"type":"text","value":" 的来由见下文「停机与升级」。Docker 默认只等 10 秒，长的流式调用会被截断。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"需要持久化什么"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/var/lib/tare-local-node"}]},{"type":"text","value":" 必须挂持久卷，每个节点一个，不能共用。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"文件"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"内容"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"丢了会怎样"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"credentials.json"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"节点身份（node id 和密钥）"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"节点起不来，要用新的注册令牌重新注册，成为一台新节点；原来那台在控制台里一直离线，到 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Local Nodes"}]},{"type":"text","value":" 里吊销它"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"usage-wal/"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"还没被 Tare 确认的用量"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"这些调用不会出现在 Call Traces 和账单里，也不计入 key 的额度。正常停机会先把它们发完，突然断电或强杀时才有残留"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"keys.json"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"只放在节点上的 Key"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"用这些 Key 的渠道在这台节点上被跳过"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"peer-identity.pem"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"节点之间直连（P2P）用的证书"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"启动时重新生成；对端拿到新证书之前，经这台节点的直连调用改经 Tare"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"logs/"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"本地请求日志"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"只影响本地排查"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"两个节点进程用同一个状态目录时，后起的那个直接退出，日志写 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"another tare-local-node process is using …"}]},{"type":"text","value":"。两台节点共用一份身份会互相把对方的连接顶掉。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"多台节点"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"每台节点是一个独立的节点身份，有自己的卷，各自注册一次。控制台里每台各占一行。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"注册令牌一次性、24 小时内有效。几台节点共用一份配置时，把几个令牌一起给它们，逗号或换行分开："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"text","value":"TARE_REGISTRATION_TOKEN=\"<令牌 1>,<令牌 2>,<令牌 3>\"\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"每台节点第一次启动时按顺序换，已经被别的节点用掉的跳过，换下一个。令牌也可以放在文件里（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_REGISTRATION_TOKEN_FILE"}]},{"type":"text","value":"，一行一个），Kubernetes 里用 Secret 挂进来就是这样。已经有身份的节点不再读令牌，用掉的令牌留在列表里没有影响。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"加第 N+1 台：生成一个新令牌、加到列表里、起一台新节点（新卷）。不用改别的节点。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"减一台：停掉它，在 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Local Nodes"}]},{"type":"text","value":" 里吊销它，再删它的卷。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"docker compose"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"compose.yaml"}]},{"type":"text","value":" 起三个节点、一个 nginx 和一个 Redis："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"text","value":"export TARE_NODE_VERSION=0.4.40\nexport TARE_API_KEY=<你账号下的一把推理 key>\nexport TARE_REGISTRATION_TOKENS=\"<令牌 1>,<令牌 2>,<令牌 3>\"\ndocker compose up -d --build\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"业务打 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"http://<这台机器>:8090/v1"}]},{"type":"text","value":"，由 nginx 分到三个节点上。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"每个节点一个卷（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"node-1"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"node-2"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"node-3"}]},{"type":"text","value":"）。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"节点经 nginx 的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"X-Forwarded-For"}]},{"type":"text","value":" 认来源地址（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_CLIENT_IP_MODE=proxy"}]},{"type":"text","value":"，只信 compose 网络里的地址），开了 IP 白名单的 key 照常生效。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"stop_grace_period: 330s"}]},{"type":"text","value":"，原因见「停机与升级」。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"加一台：复制一段 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"node-N"}]},{"type":"text","value":" 和它的卷，加进 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"nginx.conf"}]},{"type":"text","value":" 的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"upstream"}]},{"type":"text","value":"，令牌列表里加一个新令牌，再 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"docker compose up -d"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"不用 Redis：删掉 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redis"}]},{"type":"text","value":" 服务、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_REDIS_URL"}]},{"type":"text","value":" 和 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"depends_on"}]},{"type":"text","value":"，把 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"nginx.conf"}]},{"type":"text","value":" 换成按 key 哈希那一行。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Kubernetes"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"kubernetes.yaml"}]},{"type":"text","value":" 是一个 StatefulSet：每个副本一个 PersistentVolumeClaim，所以每个副本有自己的身份和用量记录。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"每个副本生成一个注册令牌，填进 Secret 的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"registration-tokens"}]},{"type":"text","value":"（一行一个）和 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"api-key"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"把 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"image"}]},{"type":"text","value":" 改成你推到自己仓库里的镜像。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"kubectl apply -f kubernetes.yaml"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"清单里已经配好的："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"项"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"值"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"作用"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"readinessProbe"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /readyz"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"没连上过 Tare、正在退出时不接流量"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"livenessProbe"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /healthz"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"进程卡死时重启"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"preStop"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"sleep 10"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"等 Service 和 ingress 把这个 Pod 摘掉再停接新连接"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"terminationGracePeriodSeconds"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"340"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"10 + 300 + 20 + 余量"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"PodDisruptionBudget"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"maxUnavailable: 1"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"节点维护时一次只驱逐一个副本"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"securityContext"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"uid / gid / fsGroup 10001"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"非 root，卷归节点进程所有"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"加副本：Secret 里加一行新令牌，"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"kubectl scale sts/tare-local-node --replicas=<N+1>"}]},{"type":"text","value":"。新 Pod 用没用过的令牌注册。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"减副本：先缩容，再吊销多出来的那台节点，删它的 PVC（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"node-state-tare-local-node-<序号>"}]},{"type":"text","value":"）。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Service 只暴露 8090。对外的 Ingress 或负载均衡按你集群的惯例加，注意给长连接留够超时（流式调用可能持续几分钟），并关掉请求和响应缓冲。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"负载均衡与共享状态"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"几台节点放在一个负载均衡后面时，同一把 key 的调用会落在不同节点上。下面这些各台节点各自一份就是对的："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"状态"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"多台节点时"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"会话粘性（同一会话落到同一条渠道）"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"按会话和渠道算哈希，每台节点算出来的一样，上游的提示词缓存照常命中"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"渠道熔断与健康"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"由 Tare 统一判定、推给每台节点"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"key 的校验结果、余额、额度"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"每台节点向 Tare 核验并缓存，变更由 Tare 推给每台节点"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"provider.sort: latency"}]},{"type":"text","value":" 的延迟统计"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"每台节点按自己测到的延迟排"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"无效 key 的来源限流"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"每台节点各算一份，N 台节点就是 N 倍额度"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"有一项要靠 Redis 或负载均衡的配置才能跨节点生效："},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"客户端断开后的重放"}]},{"type":"text","value":"。客户端在调用中途断开（网络抖动、代理超时），节点不会跟着断掉上游，而是把这次调用收完、完整记账。30 秒内同一把 key 再发一模一样的请求（客户端的重试），节点直接把那次的回包交给它，不再调上游。重放的那次按原调用的 token 数再记一次服务费，上游成本记 0。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"只有一台节点时这在节点内存里完成。几台节点时，重试可能落到另一台上，那台没有原调用，会从头再调一次上游。两种做法："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"配 Redis"}]},{"type":"text","value":"（推荐）。所有节点设同一个 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_REDIS_URL"}]},{"type":"text","value":"。客户端断开的调用把回包写进 Redis，重试落到哪台节点都能重放，负载均衡可以按连接数或轮询分。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"不配 Redis"}]},{"type":"text","value":"，负载均衡按 API key 哈希（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Authorization"}]},{"type":"text","value":" 和 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"x-api-key"}]},{"type":"text","value":" 请求头），同一把 key 永远到同一台节点。代价是一把调用量很大的 key 只用得上一台节点。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"变量"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"默认"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"说明"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_REDIS_URL"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"空"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redis://[用户:密码@]主机:端口/库"}]},{"type":"text","value":"，或用 TLS 的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"rediss://…"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_REDIS_PREFIX"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"tare-node:"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"键前缀，和别的应用共用一个 Redis 时用"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Redis 里存的东西："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"客户端断开的调用的回包，加密存储，调用结束 30 秒后过期。解密用的密钥由租户、调用方的 API key 和原请求推出，Redis 本身不保存它；能读 Redis 的人拿不到回包内容。渠道的上游 Key 不进 Redis。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"有每秒调用上限的上游（目前是阿里云百炼的出图）的每秒计数，2 秒过期。配了 Redis 时几台节点合计不超过上游的限额，没配时每台节点按固定份额限。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Redis 不需要持久化，几百 MB 内存足够，"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"compose.yaml"}]},{"type":"text","value":" 里的配置是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--save \"\" --appendonly no --maxmemory 512mb --maxmemory-policy volatile-ttl"}]},{"type":"text","value":"。Redis 连不上时节点照常服务，这几项退回每台节点各自的行为，日志每分钟最多记一行 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"shared state: …"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"只放在节点上的 Key"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"勾了 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Keep the API key only on my node"}]},{"type":"text","value":" 的渠道，Key 写在节点的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"keys.json"}]},{"type":"text","value":" 里。这样的渠道 Tare 会交给账号下任意一台在线节点执行，所以每台节点的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"keys.json"}]},{"type":"text","value":" 都要有这一项。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"docker compose：把同一份 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"keys.json"}]},{"type":"text","value":" 以只读方式挂进每个节点，设 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_HELD_KEYS"}]},{"type":"text","value":" 指向它。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Kubernetes：建一个 Secret（一个键 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"keys.json"}]},{"type":"text","value":"），按清单里注释掉的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"held-keys"}]},{"type":"text","value":" 那几行挂进去。更新 Secret 后节点自动重读，不用重启。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"指定了持有节点的渠道（"},{"type":"element","tagName":"a","properties":{"href":"subscription-supply"},"children":[{"type":"text","value":"订阅渠道"}]},{"type":"text","value":"、"},{"type":"element","tagName":"a","properties":{"href":"local-models"},"children":[{"type":"text","value":"共享本机模型"}]},{"type":"text","value":"）只由那一台执行，别的节点经 P2P 或经 Tare 把调用转给它。这台节点不在时，这条渠道被跳过。这类渠道放在一台固定的机器上，不要放进会被重建、缩容的副本里。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"节点上的数据保护"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"账户开着数据保护（DLP）时，直连调用由节点旁边的扫描服务扫描，扫描服务连不上时节点拒绝这次调用（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"503"}]},{"type":"text","value":"），不会不扫就转发。账户没开数据保护就不需要扫描服务。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"扫描服务只监听 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"127.0.0.1"}]},{"type":"text","value":"，必须和节点在同一个网络命名空间里，每个节点配一个："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Kubernetes：同一个 Pod 里的第二个容器，清单里有注释掉的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"dlp-sidecar"}]},{"type":"text","value":"。同时打开 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"shareProcessNamespace: true"}]},{"type":"text","value":"，它的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"preStop"}]},{"type":"text","value":" 等节点进程退出后才让自己退出，节点收尾期间的调用照常扫描。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"docker compose："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"compose.dlp.yaml"}]},{"type":"text","value":"。节点用 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"network_mode: service:dlp-N"}]},{"type":"text","value":" 加入扫描服务的网络，并依赖它，所以停机时先停节点、后停扫描服务。端口和网络都在扫描服务那个容器上。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"扫描服务的镜像用 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Dockerfile.dlp-sidecar"}]},{"type":"text","value":" 构建（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"docker build -f Dockerfile.dlp-sidecar -t tare-dlp-sidecar:stable ."}]},{"type":"text","value":"），只有 linux/amd64。每个扫描服务给 1 GB 内存；人名、地名、机构名识别开着时给 2 GB（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_DLP_SIDECAR_HEAP=2g"}]},{"type":"text","value":"），这三类用的模型约 180 MB，第一次用到时下载到 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/tmp"}]},{"type":"text","value":"，给 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/tmp"}]},{"type":"text","value":" 挂个卷可以免得每次重建都重新下载。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"健康检查"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"地址"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"返回"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"用途"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /healthz"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"进程在就是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"200"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"存活探针"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /readyz"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"和 Tare 连上过之后 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"200"}]},{"type":"text","value":"；还没连上过、或者收到退出信号之后 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"503"}]},{"type":"text","value":"，正文写原因"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"就绪探针、负载均衡摘节点"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /metrics"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Prometheus 指标，单独的端口（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_METRICS_LISTEN"}]},{"type":"text","value":"，例如 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"0.0.0.0:9464"}]},{"type":"text","value":"）"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"监控"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"节点和 Tare 连上一次之后，就算连接断了 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/readyz"}]},{"type":"text","value":" 也仍是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"200"}]},{"type":"text","value":"：节点在断线期间用最后一次推送和缓存服务（见 "},{"type":"element","tagName":"a","properties":{"href":"local-nodes"},"children":[{"type":"text","value":"本地节点"}]},{"type":"text","value":" 里「节点还在，但连不上 Tare」）。这时 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"tare_node_tunnel_connected"}]},{"type":"text","value":" 指标是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"0"}]},{"type":"text","value":"，用它告警。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"镜像带 Docker "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"HEALTHCHECK"}]},{"type":"text","value":"，跑的是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"tare-local-node healthcheck"}]},{"type":"text","value":"（问本机的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/readyz"}]},{"type":"text","value":"），"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"docker ps"}]},{"type":"text","value":" 里能看到 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"healthy"}]},{"type":"text","value":"。"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/healthz"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/readyz"}]},{"type":"text","value":" 不需要 API key，"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/metrics"}]},{"type":"text","value":" 不鉴权，都不要暴露到公网。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"停机与升级"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"节点收到 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"SIGTERM"}]},{"type":"text","value":" 后按这个顺序退出："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/readyz"}]},{"type":"text","value":" 立刻回 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"503"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"设了 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_DRAIN_DELAY_SECONDS"}]},{"type":"text","value":" 时，照常接新请求这么多秒，等负载均衡把这台节点摘掉。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"停止接受新连接。已经在跑的调用继续跑完，最多 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_SHUTDOWN_GRACE_SECONDS"}]},{"type":"text","value":" 秒（镜像里是 300），到时还没完的被截断。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"把还没被 Tare 确认的用量发出去，最多 20 秒。没发完的留在 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"usage-wal/"}]},{"type":"text","value":" 里，下次启动再发。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"断开和 Tare 的连接，退出。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"没有调用在跑时，第 3 步立刻结束，节点几秒内就退出。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"平台给的强杀时限要比这几段加起来长："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"平台"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"设置"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"示例里的值"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"docker run"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--stop-timeout"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"330"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"docker compose"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"stop_grace_period"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"330s"}]},{"type":"text","value":"（5 + 300 + 20 + 余量）"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Kubernetes"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"terminationGracePeriodSeconds"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"340"}]},{"type":"text","value":"（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"preStop"}]},{"type":"text","value":" 10 + 300 + 20 + 余量）"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_DRAIN_DELAY_SECONDS"}]},{"type":"text","value":" 给按 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/readyz"}]},{"type":"text","value":" 摘节点的负载均衡用，compose 示例里是 5。Kubernetes 里 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"preStop"}]},{"type":"text","value":" 的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"sleep 10"}]},{"type":"text","value":" 起同样的作用，不用再设它。想等更久的长调用，就把 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_SHUTDOWN_GRACE_SECONDS"}]},{"type":"text","value":" 和平台时限一起调大。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"升级就是换镜像标签："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Kubernetes：改 StatefulSet 的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"image"}]},{"type":"text","value":"，副本一个一个滚动，前一个就绪之后才换下一个。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"docker compose：改 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_VERSION"}]},{"type":"text","value":"，重新构建后一台一台换，免得几台节点同时停："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"docker compose build"}]},{"type":"text","value":"，再依次 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"docker compose up -d --no-deps node-1"}]},{"type":"text","value":"、等它 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"healthy"}]},{"type":"text","value":" 后换 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"node-2"}]},{"type":"text","value":"，以此类推。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"单个容器：用新镜像起一个新容器，挂同一个卷，先停旧的。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"节点身份、用量记录都在卷里，换镜像不需要重新注册。镜像里不要打开自动更新：自动更新换掉的是容器里的文件，容器一重建又回到镜像的版本。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"规格建议"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"节点主要在等上游，CPU 占用低，内存和磁盘主要花在这几处："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"内存"}]},{"type":"text","value":"：客户端断开后等着重放的回包留在内存里，单条最多 32 MB、合计最多 512 MB，平时接近 0。示例给每个节点请求 256 MB、上限 1 GB。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"磁盘"}]},{"type":"text","value":"：本地请求日志默认最多 2048 MB，示例里调成 1024 MB（"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_LOG_MAX_TOTAL_MB"}]},{"type":"text","value":"），卷给 2 GB。日志和用量记录在同一个卷上，日志上限要给用量记录留出空间。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"扫描服务"}]},{"type":"text","value":"：每个 1 到 2 GB 内存，见上文。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Redis"}]},{"type":"text","value":"：512 MB 足够。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"排错"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"现象"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"原因和处理"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"启动即退出："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"no credentials at … and TARE_REGISTRATION_TOKEN is not set"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"卷里没有身份，也没给令牌。给一个令牌；已经注册过的节点，检查卷有没有挂对"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"启动即退出："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"none of the N registration token(s) was accepted"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"令牌都被用掉或过期了（24 小时）。生成新令牌加进列表"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"启动即退出："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"another tare-local-node process is using …"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"两个节点挂了同一个卷。给每个节点单独的卷"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"启动即退出："},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"cannot store credentials at …"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"卷对 uid 10001 不可写。Kubernetes 里设 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"fsGroup: 10001"}]},{"type":"text","value":"；Docker 里用命名卷，或把宿主机目录 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"chown 10001:10001"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/readyz"}]},{"type":"text","value":" 一直是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"503 waiting for the first connection to Tare"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"节点连不上 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"tare-grpc.jamerly.ai:443"}]},{"type":"text","value":"。检查出站防火墙和代理，看日志里的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"tunnel connection ended: …"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"控制台里同一台节点在线、离线来回跳"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"两个进程用了同一份 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"credentials.json"}]},{"type":"text","value":"（比如从同一个卷复制出来的）。每台节点要有自己的身份"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"重试后上游被调用了两次、上游账单多一笔"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"几台节点之间没共享重放。配 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_REDIS_URL"}]},{"type":"text","value":"，或让负载均衡按 API key 哈希"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"日志里 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"shared state: …"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Redis 连不上或超时。节点照常服务，重放和限流暂时按每台节点各自的行为"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"只放在节点上的 Key 的渠道偶尔 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"503"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"有的节点的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"keys.json"}]},{"type":"text","value":" 里没有这一项，日志里有 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"channel N skipped"}]},{"type":"text","value":"。每台节点挂同一份 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"keys.json"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"开了数据保护后调用都是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"503"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"扫描服务不在、或者不在节点的网络命名空间里。见「节点上的数据保护」"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"滚动升级时流式调用被截断"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"平台的强杀时限比 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TARE_NODE_SHUTDOWN_GRACE_SECONDS"}]},{"type":"text","value":" 加 20 秒短，或者 Docker 用了默认的 10 秒。按「停机与升级」的表调"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]}]}