8.3.3. 部署应用程序


创建应用程序后,需要部署它。部署应用程序会创建一个 Pod 并启动代理。

步骤

  1. 在 OpenShift Container Platform web 控制台中点 StatefulSets
  2. broker-amq 部署。
  3. 单击 Deploy 以部署应用。

    注意

    集群模板的默认副本数为 0。您应该不会看到任何 Pod。

  4. 将 Pod 扩展至三个,以创建代理集群。

    $ oc scale statefulset broker-amq --replicas=3
    statefulset "broker-amq" scaled
    Copy to Clipboard Toggle word wrap
  5. 检查是否有三个 Pod 正在运行。

    $ oc get pods
    NAME           READY     STATUS    RESTARTS   AGE
    broker-amq-0   1/1       Running   0          33m
    broker-amq-1   1/1       Running   0          33m
    broker-amq-2   1/1       Running   0          29m
    Copy to Clipboard Toggle word wrap
  6. 如果 Pod 状态显示 ErrImagePullImagePullBackOff,您的部署无法直接从 Red Hat Container Registry 中拉取指定的代理镜像。在这种情况下,编辑 StatefulSet 来引用与 Red Hat Container Registry 中用于身份验证的帐户关联的正确代理镜像名称和镜像 pull secret 名称。然后,您可以导入代理镜像并启动代理。为此,请完成与部署和启动 代理应用程序 类似的步骤。
  7. 通过检查日志,验证代理是否已通过新 Pod 集群。

    $ oc logs broker-amq-2
    Copy to Clipboard Toggle word wrap

    这会显示新代理的日志,以及代理之间创建的集群桥接条目:

    2018-08-29 07:43:55,779 INFO  [org.apache.activemq.artemis.core.server] AMQ221027: Bridge ClusterConnectionBridge@1b0e9e9d [name=$.artemis.internal.sf.my-cluster.4333c830-ab5f-11e8-afb8-0a580a82006e, queue=QueueImpl[name=$.artemis.internal.sf.my-cluster.4333c830-ab5f-11e8-afb8-0a580a82006e, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=9cedb69d-ab5e-11e8-87a4-0a580a82006c], temp=false]@5e0c0398 targetConnector=ServerLocatorImpl (identity=(Cluster-connection-bridge::ClusterConnectionBridge@1b0e9e9d [name=$.artemis.internal.sf.my-cluster.4333c830-ab5f-11e8-afb8-0a580a82006e, queue=QueueImpl[name=$.artemis.internal.sf.my-cluster.4333c830-ab5f-11e8-afb8-0a580a82006e, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=9cedb69d-ab5e-11e8-87a4-0a580a82006c], temp=false]@5e0c0398 targetConnector=ServerLocatorImpl [initialConnectors=[TransportConfiguration(name=artemis, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory) ?port=61616&host=10-130-0-110], discoveryGroupConfiguration=null]]::ClusterConnectionImpl@806813022[nodeUUID=9cedb69d-ab5e-11e8-87a4-0a580a82006c, connector=TransportConfiguration(name=artemis, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory) ?port=61616&host=10-130-0-108, address=, server=ActiveMQServerImpl::serverUUID=9cedb69d-ab5e-11e8-87a4-0a580a82006c])) [initialConnectors=[TransportConfiguration(name=artemis, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory) ?port=61616&host=10-130-0-110], discoveryGroupConfiguration=null]] is connected
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat