SIP3 2026.2.1 配置参数详解

SIP3 2026.2.1 配置参数详解:四层配置模型、Salto/Captain/Twig 逐段参数、MongoDB 集合分片索引、InfluxDB 指标与 Grafana 预置实测。

SIP3SIPVoIPSIP32026/10/27

SIP3 2026.2.1 配置参数详解

目标:系统梳理 SIP3 社区版 2026.2.1(deb 路线)四组件的全部配置文件与参数项——JVM 启动层、应用配置层、日志层、运行时层逐层拆解,并给出 MongoDB 集合分片模型、InfluxDB 指标、Grafana 数据源三项存储对接的实测验证。所有参数默认值取自 repo.sip3.io 的 2026.2.1-1 软件包内置配置原文,全部回显在本机实测栈(主机名 sip3-server,IP 10.89.59.10)采集(实测日期 2026-10-27)。

一、配置体系总览

1.1 四层配置模型

SIP3 每个 Java 组件(Captain/Salto/Twig)的配置分四层,各管一件事:

层文件生效方式管什么
JVM 启动层/etc/sip3-*/environment.confsystemd 启动时读取Java 堆内存、GC 器、附加启动参数
应用配置层/etc/sip3-*/application.yml组件启动时加载业务参数:端口、存储连接、聚合规则
日志层/etc/sip3-*/logback.xml启动加载,支持热扫描(60 秒)日志文件、滚动策略、级别
运行时层/etc/sip3-*/vertx-options.json、codecs.yml启动加载Vert.x 指标开关、RTP 编解码目录

Hoof 是静态前端,自身无 application.yml,其行为由 nginx 站点配置决定(见第六节)。

1.2 配置文件清单

三组件在 /etc 下的文件实测清单(含尺寸):

root@sip3-server:~# ls -la /etc/sip3-salto/ /etc/sip3-captain/ /etc/sip3-twig/ | grep -v '^total\|^d'
/etc/sip3-captain/:
-rw-r--r-- 1 root root  395 Oct 27 01:52 application.yml
-rw-r--r-- 1 root root   82 Oct 27 00:17 environment.conf
-rw-r--r-- 1 root root 1504 Oct 27 01:53 logback.xml
-rw-r--r-- 1 root root  414 Sep  7 14:24 vertx-options.json

/etc/sip3-salto/:
-rw-r--r-- 1 root root 1035 Oct 27 01:52 application.yml
-rw-r--r-- 1 root root 1240 Sep  7 14:24 codecs.yml
-rw-r--r-- 1 root root   82 Oct 27 00:17 environment.conf
-rw-r--r-- 1 root root 1496 Sep  7 14:24 logback.xml
-rw-r--r-- 1 root root  414 Sep  7 14:24 vertx-options.json

/etc/sip3-twig/:
-rw-r--r-- 1 root root 1271 Oct 27 01:53 application.yml
-rw-r--r-- 1 root root  430 Sep  7 14:24 banner.txt
-rw-r--r-- 1 root root   82 Oct 27 00:17 environment.conf
-rw-r--r-- 1 root root  827 Sep  7 14:24 logback.xml

带日期的文件是本环境改写过的(application.yml、environment.conf、captain 的 logback.xml),带 Sep 7 时间戳的是软件包原生文件。Twig 多一个 banner.txt(启动横幅),Salto 多一个 codecs.yml(RTP 编解码目录),Captain 无 codecs.yml(它只抓包不评 MOS)。

1.3 段注释语法 #!

application.yml 用 #! 标注段名(如 #! Server),纯注释行用 #。deb 包内置的默认配置是全注释形态——只有 name/version 两行生效,其余段全部处于 # 注释状态,这是《SIP3 2026.2.1 Ubuntu 22.04 安装指南》6.2 节必须手工「激活」配置的原因。修改任何 application.yml 后重启对应服务生效:

root@sip3-server:~# systemctl restart sip3-salto

logback.xml 例外:scan="true" scanPeriod="60 seconds",改日志配置 60 秒内自动生效,无需重启。

二、JVM 启动层(environment.conf)

2.1 systemd 启动模板

以 Salto 的服务单元为例(Captain/Twig 同构,仅路径不同):

[Service]
User=sip3
Group=sip3
EnvironmentFile=-/etc/sip3-salto/environment.conf
ExecStart=/bin/sh -c '\
$JAVA_HOME/bin/java \
  $JAVA_XMS $JAVA_XMX $JAVA_GC $JAVA_OTHER \
 -Dlogback.configurationFile=/etc/sip3-salto/logback.xml \
 -jar /opt/sip3-salto/sip3-salto.jar \
 -Dconfig.location=/etc/sip3-salto/application.yml \
 -Dcodecs.location=/etc/sip3-salto/codecs.yml \
  $UDF_OPTS \
 -Dvertx.cacheDirBase=/tmp/sip3-salto \
 $APP_OPTS \
 $VERTX_OPTS \
 & echo $! > /run/sip3-salto/sip3-salto.pid'
Restart=on-failure
RestartSec=10

要点:EnvironmentFile=- 前缀表示文件可缺失(缺失不报错,但 JVM 走默认堆);$JAVA_OTHER、$UDF_OPTS、$APP_OPTS、$VERTX_OPTS 是四个预留口——JAVA_OTHER 追加 JVM 参数(如 -Duser.timezone=Asia/Shanghai),后三个分别向 UDF 脚本、应用、Vert.x 传参,environment.conf 里不写即为空。

2.2 变量表与生效验证

变量本环境取值说明
JAVA_HOME/opt/sip3-javaSIP3 自带 JRE 目录,勿指向系统 Java
JAVA_XMS-Xms256m初始堆
JAVA_XMX-Xmx512m最大堆,按话务量调
JAVA_GC-XX:+UseG1GCGC 器

三组件内容一致(实测):

root@sip3-server:~# for comp in captain salto twig; do echo "-- $comp:"; cat /etc/sip3-$comp/environment.conf; done
-- captain:
JAVA_HOME=/opt/sip3-java
JAVA_XMS=-Xms256m
JAVA_XMX=-Xmx512m
JAVA_GC=-XX:+UseG1GC
-- salto:
JAVA_HOME=/opt/sip3-java
JAVA_XMS=-Xms256m
JAVA_XMX=-Xmx512m
JAVA_GC=-XX:+UseG1GC
-- twig:
JAVA_HOME=/opt/sip3-java
JAVA_XMS=-Xms256m
JAVA_XMX=-Xmx512m
JAVA_GC=-XX:+UseG1GC

运行中进程复核(回显与《安装指南》6.1 一致):

root@sip3-server:~# ps aux | grep "[j]ava" | grep -oE "^\S+\s+\S+.*-Xms\S+\s+-Xmx\S+" | head -3
sip3     /opt/sip3-java/bin/java -Xms256m -Xmx512m
sip3     /opt/sip3-java/bin/java -Xms256m -Xmx512m
sip3     /opt/sip3-java/bin/java -Xms256m -Xmx512m

三、Salto 参数详解(/etc/sip3-salto/application.yml)

Salto 是数据聚合核心,参数最多。以下逐段给出 2026.2.1-1 包内默认值(未标注的均为包内默认)与本环境的激活写法。

3.1 server(数据接收)

键默认说明
server.uriudp://0.0.0.0:15060Captain 数据投递目标,0.0.0.0 监听全部网卡
server.buffer_size65535UDP 收包缓冲,高话务可加大
server.ssl.key_store / key_store_password(注释)数据面 TLS,需与 Captain sender.ssl 成对开启

3.2 management(管理通道)

键默认说明
management.uriudp://0.0.0.0:15091组件注册/心跳端口。2026.2.1 默认 15091,旧版本是 15090,必须与 Captain 的 management.uri 一致(见 10.2 FAQ)
management.expiration_delay60000组件过期判定延迟(ms)
management.expiration_timeout120000组件过期超时(ms)
management.cleanup_timeout300000过期组件清理周期(ms)
management.publish_media_control_mode0媒体控制发布模式

3.3 mongo(呼叫数据落库)

本环境激活写法(《安装指南》6.2)与包内默认的对照:

键包内默认本环境说明
mongo.urimongodb://127.0.0.1:27017同默认连接串,远程库改 IP 即可
mongo.dbsip3同默认库名
mongo.bulk_size1同默认批量写条数,1 为逐条写(最稳)
mongo.update_period300000同默认集合滚动检查周期(ms)
mongo.management.uri / db同 uri/db(未启用)集合管理专用连接,可分库时使用
mongo.collections13 个前缀(见下表)激活 4 个集合分片定义

集合分片模型是 Salto 配置的重头。包内默认定义了 13 个前缀,按天分片(time_suffix: yyyyMMdd 拼接在集合名后):

前缀内容默认 ascending 索引字段(节选)hashed 索引
attributesSIP 属性字典[name]—
sip_call_index呼叫索引(检索入口)created_at, terminated_at, src_addr, src_host, dst_addr, dst_host, caller, callee, state, error_code, error_type, duration, trying_delay, setup_time, establish_time, disconnect_time, transactions, retransmits, terminated_by, debugcall_id, x_call_id
sip_call_raw呼叫原始报文[created_at]call_id
sip_register_index / sip_register_raw注册会话created_at, terminated_at, src_addr, … caller, callee, state …call_id
sip_message_index / sip_message_rawMESSAGE 方法created_at, …, retransmits, debugcall_id
sip_options_index / sip_options_rawOPTIONS 方法同上call_id
rtpr_rtp_index / rtpr_rtp_rawRTP 流指标(MOS/R 因子)created_at, …, mos, r_factor, codec, one_way, duration, bad_report_fractioncall_id
rtpr_rtcp_index / rtpr_rtcp_rawRTCP 报告同上call_id
rec_raw录音原始数据created_at, src_addr, src_host, dst_addr, dst_hostcall_id

每个前缀还带 max_collections: 30(保留 30 天分片,滚动删除最旧)与可选 hint(call_id: hashed 指定查询提示)。索引字段表意味着:检索条件里能用的字段就是 ascending 列表里的这些,自定义扩展需同步改配置重建索引。本环境按最小可用原则只激活了 attributes/sip_call_index/sip_call_raw/unknown_raw 四个(unknown_raw 承接未归类报文),生产环境按需照包内默认抄全。

3.4 metrics(服务指标)

键默认说明
metrics.logging.step1000日志指标输出步长(ms)
metrics.influxdb.urihttp://127.0.0.1:8086InfluxDB v1 HTTP 地址(必须 1.x,v2+ API 不兼容)
metrics.influxdb.dbsip3指标库
metrics.influxdb.step1000写入步长(ms)
metrics.influxdb.retention_duration7d保留策略时长
metrics.statsd.host/port/step/flavour127.0.0.1 / 8125 / 1000 / datadog备选 StatsD 通道
metrics.elastic.host/index/step127.0.0.1:9200 / sip3 / 1000备选 Elasticsearch 通道

三个指标后端可并存,至少启用一个。本环境走 influxdb(实测验证见 8.2)。

3.5 sip(SIP 聚合规则)

键默认说明
sip.message.exclusions[MESSAGE, SUBSCRIBE, NOTIFY, OPTIONS]不聚会的 SIP 方法列表。本环境改为仅 REGISTER,让测试用的 MESSAGE/INVITE 全部入库
sip.message.x_correlation_headerX-Call-ID跨呼叫关联头
sip.message.parser.mode1解析模式
sip.message.parser.extension_headers[User-Agent, Reason, Diversion]额外提取进索引的头
sip.transaction.expiration_delay / response_timeout1000 / 3000事务过期/响应超时(ms)
sip.transaction.aggregation_timeout60000事务聚合窗口(ms)
sip.transaction.termination_timeout4500事务终止超时(ms)
sip.transaction.save_sip_message_payload_mode0原始报文保存模式
sip.call.expiration_delay1000呼叫过期延迟(ms)
sip.call.aggregation_timeout60000呼叫聚合窗口(ms),多腿等待时长
sip.call.termination_timeout2000呼叫终止超时(ms)
sip.call.duration_timeout3600000呼叫时长上限(ms),防悬挂
sip.call.duration_distributions[10s, 30s, 1m, 5m, 1h]时长分布直方图桶
sip.call.correlation.rolereporter|aggregator多 Salto 部署时的角色分工
sip.register.expiration_delay / aggregation_timeout1000 / 10000注册会话参数
sip.register.update_period60000注册状态刷新周期(ms)
sip.register.duration_timeout900000注册有效期上限(ms)

3.6 media / udf / attributes / 杂项

键默认说明
media.rtcp.expiration_delay / aggregation_timeout1000 / 30000RTCP 聚合参数
media.rtp_r.expiration_delay / aggregation_timeout1000 / 30000RTP 流聚合参数
media.rtp_r.min_expected_packets100低于此包数不计质量分
media.rtp_r.r_factor_distributions[30, 50, 75, 95]R 因子分布桶
media.rtp_r.duration_distributions[10s, 30s, 1m, 5m, 1h]RTP 时长分布桶
udf.check_period / execution_timeout10000 / 100用户自定义脚本检查周期/执行超时
attributes.record_ip_addressestrue属性库记录 IP
attributes.record_call_userstrue属性库记录主被叫用户
attributes.check_period5000属性扫描周期(ms)
time_suffixyyyyMMdd集合分片后缀格式

3.7 查看生效配置

启动日志第一屏会打印渲染后的完整生效配置(JSON 形态),排障时先看它:

root@sip3-server:~# journalctl -u sip3-salto -b --no-pager | grep -A5 '"name"'

四、Captain 参数详解(/etc/sip3-captain/application.yml)

Captain 只做抓包与转发,参数围绕 pcap 与出口。

4.1 pcap(抓包)

键包内默认本环境说明
pcap.deveth0eth0抓包网卡
pcap.dltEN10MB(未设)链路层类型,EN10MB=以太网
pcap.sllfalsefalsetrue 时按 Linux Cooked(SLL)解析
pcap.bpf_filterip and udpudp and port 5060BPF 过滤器。默认放行全部 IP/UDP,生产建议收窄到 SIP 端口省 CPU
pcap.bulk_size256(未设)抓包批大小
pcap.snaplen6553565535每包截取长度
pcap.buffer_size20971522097152抓包缓冲(2 MiB)
pcap.timeout_millis11抓包超时(ms),1 保证低延迟

4.2 数据出口与协议开关

键默认说明
sender.uriudp://127.0.0.1:15060指向 Salto 的 server.uri
sender.reconnection_timeout1000断线重连间隔(ms)
sender.reuse_porttrueUDP 端口复用,多线程发送
sender.ssl.key-store / key-store-password(注释)与 Salto server.ssl 成对开启
tcp.expiration_delay / aggregation_timeout / idle_connection_timeout100 / 100 / 300000SIP over TCP 重组参数
rtp.enabledfalseRTP 抓取总开关,开启后 Captain 上报 RTP 流
rtp.payload-types[0..10, 100]参与统计的 RTP payload 类型
rtp.collector.enabledtrueRTP 收集器
rtcp.enabledfalseRTCP 抓取开关
rtcp.bulk_size1RTCP 批大小
recording.expiration_delay / aggregation_timeout / duration_timeout1000 / 30000 / 60000录音流参数
encoder.mtu_size1450发往 Salto 的报文分片大小
vertx.instances1Vert.x 事件循环数,多核可加大

4.3 host(本机身份声明)与 management

键默认说明
management.uriudp://127.0.0.1:15090注意:Captain 包内默认 15090,而 Salto 2026.2.1 默认 15091,两端必须一致(见 10.2)
management.register_delay60000启动后注册延迟(ms)
host.namesbc.sip3.io本机在界面中显示的名称
host.addr[10.10.10.10, 10.10.10.20:5060]本机地址清单,界面按此标注流量归属
host.feature["role:proxy"]本机角色标签
host.mappingsource→target地址映射,NAT 环境把外网地址映射到内网地址
dpdk.port / rx_queue_size / bulk_size0 / 1 / 256DPDK 高性能抓包(需 DPDK 环境,默认不用)
metrics.logging.step1000Captain 自身指标步长

五、Twig 参数详解(/etc/sip3-twig/application.yml)

Twig 的默认配置开箱即生效(不像 Salto/Captain 全注释),是 Spring Boot 多文档 YAML(段间用 --- 分隔)。包内默认全文即为运行配置:

段键默认说明
Spring Jacksonspring.jackson.property_naming_strategySNAKE_CASEAPI 返回 JSON 用下划线命名
Spring Cachespring.cache.cache_nameslistAttributes, listCollectionNames, listCollectionNamesByPrefix缓存的查询方法名
Spring Cachespring.cache.caffeine.specexpireAfterWrite=1mCaffeine 缓存 1 分钟过期
Spring MongoClientspring.data.mongodb.uri / database${mongo.uri} / ${mongo.db}引用下方 mongo 段,改一处即全局生效
Applicationname / management.register_delaysip3-twig-ce / 60000组件自报与注册延迟
Serverserver.port8080API 端口
Serverserver.servlet.context_path/apiAPI 上下文路径
Serverserver.forward_headers_strategyframework反代头处理
Securitysecurity.enabledfalse认证开关;开启后配合 security.grafana.url 做 Grafana 用户映射
Mongomongo.uri / dbmongodb://127.0.0.1:27017 / sip3查询库连接
Mongomongo.max_execution_time10000单查询超时(ms)
Mongomongo.batch_size128游标批大小
Sessionsession.default_limit50检索默认返回条数
Sessionsession.use_x_correlation_headertrue响应带 X-Correlation 头
Sessionsession.show_retransmitstrue结果含重传标记
Sessionsession.ignore_nanostrue时间戳忽略纳秒位
Sessionsession.call.max_legs10呼叫最大腿数,超出截断
Sessionsession.call.aggregation_timeout / termination_timeout60000 / 10000呼叫侧展示聚合参数(与 Salto 呼应)
Sessionsession.register.max_legs / aggregation_timeout / duration_timeout10 / 10000 / 900000注册侧同上
Sessionsession.media.termination_timeout60000媒体侧终止超时
Cachecache.refresh_rate55000集合名缓存刷新周期(ms)
Springdocspringdoc.swagger_ui.path/swagger-ui/Swagger UI 路径(实际访问 /api/swagger-ui/)

调优提示:session.default_limit 是界面每次检索的默认条数上限;mongo.max_execution_time 拉长可容忍大时间窗查询;security.enabled 打开后 Twig 校验 Grafana 会话(security.grafana.url 指向 Grafana 用户接口),实现界面单点登录。

六、Hoof 与 nginx 配置

Hoof 是静态前端(/var/www/sip3-hoof),nginx 站点配置就是它的全部行为(《安装指南》6.4 已给出全文),三个 location 各司其职:

location行为说明
/try_files $uri $uri/ /index.htmlSPA 路由回退
/api/proxy_pass http://127.0.0.1:8080反代 Twig,注意 proxy_pass 不带路径(保留 /api/ 前缀,与 Twig 的 context_path=/api 对齐)
/grafana/proxy_pass http://127.0.0.1:3000/反代 Grafana,末尾带斜杠(剥掉 /grafana 前缀)

改 Twig 端口或上下文时,nginx 的 /api/ 与 Twig 的 server.servlet.context_path 必须成对改;改 Grafana 的 root_url 时同理。nginx 改后 nginx -t && systemctl reload nginx。

七、日志与运行时层

7.1 logback.xml

Salto 默认双 appender(Captain/Twig 结构相同、路径不同):

项default.logmetrics.log
路径/var/log/sip3-salto/default.log/var/log/sip3-salto/metrics.log
记录器io.sip3(INFO)、root(ERROR)LoggingMeterRegistry(INFO)
滚动按天,maxHistory 15按天,maxHistory 15

调整日志级别改 <logger name="io.sip3" level="INFO"> 一行即可,60 秒热扫描生效(DEBUG 排障后记得改回)。metrics.log 是指标写日志通道(配合 metrics.logging),磁盘紧张时可在 logback 中把该 appender 级别上调。

7.2 vertx-options.json

{
  "metricsOptions": {
    "enabled": false,
    "jvmMetricsEnabled": false,
    "labels": ["EB_ADDRESS", "EB_FAILURE", "EB_SIDE", "LOCAL", "REMOTE", "POOL_TYPE", "POOL_NAME", "CLASS_NAME"],
    "influxDbOptions": {
      "enabled": true,
      "uri": "http://127.0.0.1:8086",
      "db": "sip3",
      "step": 5,
      "retention-duration": "7d"
    }
  }
}

Vert.x 框架级指标(enabled/jvmMetricsEnabled)默认关闭;influxDbOptions 是 Salto 业务指标的第二通道(step 单位为秒)。保持默认即可,勿把 influxDbOptions.enabled 改 false——业务指标会断流。

7.3 codecs.yml(仅 Salto)

RTP 编解码目录,按 ITU-T G.113 与 RFC 3551 维护,是 MOS/R 因子计算的依据。每条目必含 name(对齐 SDP 中的编解码名)、payload_types、clock_rate、ie(设备损伤因子)、bpl(丢包鲁棒因子):

codecs:
  - name: PCMA
    payload_types: [ 8 ]
    clock_rate: 8000
    ie: 0
    bpl: 4.3

话务环境用到非默认编解码时在此追加条目;漏配的编解码不影响抓包,但该流不出质量分。

八、存储对接实测

8.1 MongoDB:集合分片与索引核验

按 3.3 的 collections 配置,数据按天落片。本环境实测集合名:

root@sip3-server:~# mongosh --quiet sip3 --eval 'db.getCollectionNames().sort()'
[
  'attributes_20261027',
  'components',
  'sip_call_index_20261027',
  'sip_call_raw_20261027',
  'sip_register_index_20261027',
  'sip_register_raw_20261027',
  'unknown_raw_20261027'
]

索引声明必须用 YAML 列表写法,不能加引号——这是本环境实测踩到的一个真坑。初始激活配置把索引写成了带引号字符串(ascending: "[created_at, ...]"),Salto 启动后集合里只有 _id_ 一个默认索引;把引号去掉改成流式列表(ascending: [created_at, ...])并重启后,索引全部补建成功(含已存在的旧分片):

root@sip3-server:~# grep -n 'ascending\|hashed' /etc/sip3-salto/application.yml
  ascending: [created_at, terminated_at, src_addr, dst_addr, caller, callee, state, error_code, duration]
  hashed: [call_id]
root@sip3-server:~# systemctl restart sip3-salto
root@sip3-server:~# mongosh --quiet sip3 --eval 'db.sip_call_index_20261027.getIndexes().map(i=>i.name)'
[
  '_id_',
  'created_at_1',
  'terminated_at_1',
  'src_addr_1',
  'dst_addr_1',
  'caller_1',
  'callee_1',
  'state_1',
  'error_code_1',
  'duration_1',
  'call_id_hashed'
]

(ascending 列表里的每个字段生成一个单字段升序索引,hashed 列表生成同名哈希索引;sip_call_raw 实测为 _id_ / created_at_1 / call_id_hashed 三索引,attributes 实测为 _id_ / name_hashed。)带引号的字符串写法不报错、静默不建索引,小数据量毫无感知,数据一大查询就退化成全表扫描——务必用列表写法。另外注意:未在 collections 里声明的段也可能建集合——本环境只声明了 4 个前缀,sip_register_index/raw 两片仍随注册数据流入被自动创建(走默认索引),声明的作用是定制索引与保留策略,而非开关集合。

8.2 InfluxDB:指标落地核验

Salto→InfluxDB 指标通道实测(库 sip3):

root@sip3-server:~# influx -database sip3 -execute "SHOW MEASUREMENTS"
name: measurements
name
----
packets_decoded
packets_processed
packets_received
packets_routed
sip_call_attempts
sip_call_messages
sip_call_retransmits
sip_call_transactions
sip_register_messages

(回显节选(实测首尾):另有 sip_register_attempts 等注册侧指标。)packets_* 四项是 Captain 数据面指标,sip_call_/sip_register_ 是 Salto 聚合指标——两条链路都健康。

8.3 Grafana:数据源预置实测

Grafana 用 provisioning 目录声明式管理数据源(比界面手点可复制、可审计)。写入 /etc/grafana/provisioning/datasources/sip3.yml:

apiVersion: 1

datasources:
 - name: Sip3
   type: influxdb
   access: proxy
   url: http://127.0.0.1:8086
   database: sip3
   isDefault: true
   jsonData:
     timeInterval: 1s

systemctl restart grafana-server 后从 API 核验(管理口令改法见《安装指南》6.5):

root@sip3-server:~# curl -s -u admin:q1w2e3r4 http://127.0.0.1:3000/api/datasources
[{"id":1,"uid":"P7A1C86AEE7F2EC26","orgId":1,"name":"Sip3","type":"influxdb","typeName":"InfluxDB","typeLogoUrl":"public/plugins/influxdb/img/influxdb_logo.svg","access":"proxy","url":"http://127.0.0.1:8086","user":"","database":"sip3","basicAuth":false,"isDefault":true,"jsonData":{"timeInterval":"1s"},"readOnly":true}]

服务日志同步记录加载行为:

root@sip3-server:~# journalctl -u grafana-server | grep "inserting datasource"
... logger=provisioning.datasources ... msg="inserting datasource from configuration" name=Sip3 uid=P7A1C86AEE7F2EC26

(输出节选(实测首尾):省略时间戳等前缀字段,关键是 msg 与 name=Sip3。)

注意 readOnly: true——预置的数据源不能在界面编辑/删除,改参数必须改文件重启(FAQ 10.4)。仪表盘 JSON 可放 /etc/grafana/provisioning/dashboards/ 用文件提供者加载(做法见《SIP3 2025.2.1 Docker Compose 部署指南》4.1,deb 路线同构)。

九、镜像路线环境变量对照

官方镜像(2025.2.1)用环境变量 + Jinja2 模板渲染出同一套 application.yml,变量名与 deb 配置键一一对应(机制详见《SIP3 2025.2.1 Docker Compose 部署指南》2.2)。常用对照:

deb 配置键镜像环境变量备注
server.uri(salto)saltoServerUriudp://0.0.0.0:15060
mongo.uri(拼接)mongodbAddress + mongodbPort + mongodbDb镜像线按主机/端口/库三段拼接
metrics.influxdb.*(salto)influxdbAddress + influxdbPort + influxdbDb同上
pcap.dev(captain)captainPcapDev
pcap.bpf_filter(captain)captainPcapBpfFilter含空格需引号
sender.uri(captain)captainSenderUri
name(captain)captainName
sip.register 段开关(salto)registerFeaturetrue/false 分支渲染
session.default_limit(twig)twigSessionDefaultLimit
nginx listen(hoof)hoofPortHoof 无 Java 进程,改 nginx 模板

镜像线变量名规律:组件名 + 配置段驼峰拼接。同一套调优思路(3.33.6、4.14.3 的键值含义)在两条路线完全通用。

十、常见问题(FAQ)

10.1 首次启动失败:配置全注释

deb 包内置 application.yml 仅 name/version 生效,Salto 无 Mongo 配置时因 MongoCollectionManager 空指针反复重启(Restart=on-failure 每 10 秒重试)。按《安装指南》6.2/6.3 激活最小配置即可。

10.2 Captain 与 Salto 的管理端口配对

2026.2.1 的 Salto 包内默认 management.uri 是 15091,Captain 包内默认仍是 15090——两个默认值不相等,直接各自用默认会互相找不到。两端改成同一个值(本文统一 15091),这是从旧版本升级时最容易踩的坑。

10.3 version 字段显示 2026.1.1-SNAPSHOT

2026.2.1-1 包内置默认配置里 version: 2026.1.1-SNAPSHOT 是打包时的应用构建串(实测两处一致:salto/captain 默认文件第三行)。以 apt 包版本号 2026.2.1-1 与 Twig 启动横幅为准,不影响功能。

10.4 Grafana 预置数据源 readOnly:true

provisioning 创建的数据源在界面锁定编辑(API 也拒改),调整参数走「改 yml → 重启 grafana-server」;要从界面手工管理的场景就不放 provisioning 文件。

10.5 Twig 检索超时

大时间窗查询报超时时按序调三处:mongo.max_execution_time(默认 10000)、mongo.batch_size(默认 128)、session.default_limit(默认 50),并确认 MongoDB 侧索引与 3.3 的声明一致(查询字段必须在 ascending 索引清单内)。

10.6 集合索引未生成(引号写法坑)

现象: mongosh 查 getIndexes() 只见 _id_,检索仍能用但越用越慢。原因:collections 段的 indexes 值写成了带引号字符串(ascending: "[created_at, ...]"),Salto 按字符串解析无法展开字段清单,静默跳过建索引。修复:去掉引号改为 YAML 流式列表(ascending: [created_at, ...]),systemctl restart sip3-salto 后索引对已存在的分片一并补建(实测见 8.1)。

十一、参考链接