3.3. 升级中央集群


在创建了 Central 数据库的备份并使用置备捆绑包生成必要的资源后,下一步是升级 Central 集群。这个过程涉及升级 Central 和 Scanner。

3.3.1. 升级 Central

您可以通过下载和部署更新的镜像,将 Central 更新到最新版本。

注意

如果使用 Kubernetes,请输入 kubectl 而不是 oc

流程

  1. 要更新 Central 镜像,请运行以下命令:

    $ oc -n stackrox set image deploy/central \
    central=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:4.7.8
  2. 要更新 Central-db 镜像,请运行以下命令:

    $ oc -n stackrox set image deploy/central-db \
    central-db=registry.redhat.io/advanced-cluster-security/rhacs-central-db-rhel8:4.7.8 \
    init-db=registry.redhat.io/advanced-cluster-security/rhacs-central-db-rhel8:4.7.8
  3. 要更新配置控制器镜像,请运行以下命令:

    $ oc -n stackrox set image deploy/config-controller \
    manager=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:4.7.8

验证

  • 验证新 pod 是否已部署:

    $ oc get deploy -n stackrox -o wide
    $ oc get pod -n stackrox --watch

3.3.2. 升级扫描器

您可以通过下载和部署更新的镜像将 Scanner 更新至最新版本。

重要

如果使用 Kubernetes,请输入 kubectl 命令而不是 oc 命令。

流程

  1. 如果已创建了自定义 Scanner 配置,则必须在更新 Scanner 配置文件前应用这些更改:

    1. 要生成扫描器,请运行以下命令:

      $ roxctl -e "$ROX_CENTRAL_ADDRESS" scanner generate
    2. 要应用 TLS secret YAML 文件,请运行以下命令:

      $ oc apply -f scanner-bundle/scanner/02-scanner-03-tls-secret.yaml
    3. 要应用 Scanner 配置 YAML 文件,请运行以下命令:

      $ oc apply -f scanner-bundle/scanner/02-scanner-04-scanner-config.yaml
  2. 要更新 Scanner 镜像,请运行以下命令:

    $ oc -n stackrox set image deploy/scanner \
    scanner=registry.redhat.io/advanced-cluster-security/rhacs-scanner-rhel8:4.7.8
  3. 要更新 Scanner 数据库镜像,请运行以下命令:

    $ oc -n stackrox set image deploy/scanner-db \
    db=registry.redhat.io/advanced-cluster-security/rhacs-scanner-db-rhel8:4.7.8 \
    init-db=registry.redhat.io/advanced-cluster-security/rhacs-scanner-db-rhel8:4.7.8

验证

  • 要验证新 pod 是否已部署,请运行以下命令:

    $ oc get deploy -n stackrox -o wide
    $ oc get pod -n stackrox --watch

3.3.3. 验证 Central 集群升级

在升级了 Central 和 Scanner 后,验证该中央集群升级已完成。

注意

如果使用 Kubernetes,请输入 kubectl 而不是 oc

流程

  • 运行以下命令检查 Central 日志:

    $ oc logs -n stackrox deploy/central -c central

    输出示例

    No database restore directory found (this is not an error).
    Migrator: 2023/04/19 17:58:54: starting DB compaction
    Migrator: 2023/04/19 17:58:54: Free fraction of 0.0391 (40960/1048576) is < 0.7500. Will not compact
    badger 2023/04/19 17:58:54 INFO: All 1 tables opened in 2ms
    badger 2023/04/19 17:58:55 INFO: Replaying file id: 0 at offset: 846357
    badger 2023/04/19 17:58:55 INFO: Replay took: 50.324µs
    badger 2023/04/19 17:58:55 DEBUG: Value log discard stats empty
    Migrator: 2023/04/19 17:58:55: DB is up to date. Nothing to do here.
    badger 2023/04/19 17:58:55 INFO: Got compaction priority: {level:0 score:1.73 dropPrefix:[]}
    version: 2023/04/19 17:58:55.189866 ensure.go:49: Info: Version found in the DB was current. We’re good to go!

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部