用途:指导在自管基础设施上安装并注册 MuleSoft Omni Gateway。先按平台选择参考文件:Linux(Ubuntu/Debian)读 references/linux.md(APT 仓库设置、flex-gateway 包、systemd 服务);Docker 或 Docker Compose 读 references/docker.md(镜像拉取、docker run 与 Compose、conf.d 绑定挂载);Kubernetes 或 OpenShift 读 references/kubernetes.md(Helm 仓库、values.yaml、OpenShift SCC 设置)。
模式:三种平台均支持两种模式。connected mode 会注册到 Anypoint Platform 并出现在 Runtime Manager 中,需要 organization ID 与 registration token(签发后 24 小时过期);local mode 独立运行,无控制面连接,跳过注册步骤。各平台参考文件会标明 local mode 需跳过的步骤。
验证(connected mode):在 Anypoint Platform → Runtime Manager → Flex Gateways 中找到网关,确认状态为 STARTED(绿色);或调用 Flex Gateway Manager API:GET https://anypoint.mulesoft.com/flexgateway/api/v1/organizations/{orgID}/environments/{envID}/gateways/{gatewayID},请求头 Authorization: Bearer <access-token>,预期返回 200 且 "status": "STARTED"。
限制与注意:RHEL、CentOS、Amazon Linux 不在 APT 说明覆盖范围内,需联系 MuleSoft gateway 团队获取 RPM 仓库信息,不要在 RPM 系统上使用 APT 仓库。
常见问题:401 或 authentication failed 多为 token 过期或属于其他组织;404 或 environment not found 多为组织 ID 错误;conf.d 不可写需调整权限;409 Conflict 表示同名网关已注册;状态持续 DISCONNECTED 需检查 conf.d 中的注册文件与挂载路径;Linux 下 flexctl: command not found 需重装或加入 PATH;Docker 容器立即退出可用 docker logs flex-gateway 查看;端口占用需改主机端口;Kubernetes 的 ImagePullBackOff、CrashLoopBackOff、Pending 分别检查网络出口/镜像标签、secret 与 ConfigMap、资源配额与节点亲和性。
后续步骤:为 API 应用策略(见 secure-api)、监控日志(见 omni-gateway-logs)、校验 conf.d 配置(见 omni-gateway-config),以及端到端排查(见 omni-gateway-diagnose)。