第 3 / 13 节所属整篇文档:配置参考

推导默认值与键间约束

部分配置键未显式填写时,框架会根据关联配置自动推导合理默认值;若手动填写,则必须满足下表约束,违反时拒绝启动并指明冲突键名:

配置键自动推导的默认值手动配置时的约束
tasks.control_timeoutmin(1s, tasks.storage.lease_duration / 3)不得超过 lease_duration 的 1/3
tasks.storage.poll_intervalmin(100ms, tasks.storage.lease_duration / 3)不得超过 lease_duration 的 1/3
residents.deactivate_timeoutmin(2s, residents.call_timeout, 停机窗口的 80% 减 call_timeout)不大于 call_timeout,且 call_timeout + deactivate_timeout 不超过 9s 600ms
fabric.placement.quorum未组网时取 1,配置了 seeds 或开启 discovery.mode("seeds" / "multicast" / "storage")时取 expected_nodes / 2 + 1必须是 expected_nodes 的严格多数派
fabric.gossip.bind与 fabric.cluster.bind 同 IP,端口号加 1当 cluster 端口为 65535 时必须手动指定
server.connections.max_per_sourcemin(256, server.connections.max)不得超过 server.connections.max
server.http.max_in_flight_body_bytesmax(64MiB, server.http.max_body_bytes, server.http.grpc.max_message_bytes)不得小于 max_body_bytes 与 grpc.max_message_bytes
server.tcp.listeners.<name>.bind沿用 server.tcp.bind代码里必须有同名 App::tcp 注册(UDP 同理)

其他跨配置段的联动要求:

  • Resident 托管依赖后台任务执行面:二进制包含 #[resident] 声明且 residents.hosting.enabled = true(默认)时,必须保持 tasks.execution.enabled = true;否则预检与启动均失败,错误信息以 residents.hosting.enabled requires tasks.execution.enabled 开头。纯网关转发节点若不托管实体,请显式设 residents.hosting.enabled = false。
  • 请求体与上传体积、HTTP/2 流式 gRPC:server.http.max_body_bytes 与 security.max_body_bytes 都不能小于 Livecell 的 max_upload_bytes;开启 server.http.grpc.streaming = true 时必须同时开启 server.http.h2.enabled = true。
  • 任务并发、接管超时与 Redis 地址:tasks.map.per_root_in_flight 不能超过 tasks.concurrency;residents.placement.release_timeout 必须小于 call_timeout 与接管窗口;Session、Cache 或限流任一后端设为 redis 时必须配置非空的 redis.url。