1

我在 OpenShift 中有一个 JBoss AMQ 的默认设置,并希望将其扩展到两个 pod。我该如何做到这一点?

只是缩放它会导致以下结果:

INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/opt/amq/data/split-1/serverData/kahadb]
INFO | PListStore:[/opt/amq/data/split-1/serverData/backend-amq-12-j27mn/tmp_storage] started
INFO | Apache ActiveMQ 5.11.0.redhat-630343 (backend-amq-12-j27mn, ID:backend-amq-12-j27mn-35700-1597673091911-0:1) is starting
INFO | Listening for connections at: stomp://backend-amq-12-j27mn:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600&transport.hbGracePeriodMultiplier=2.5
INFO | Connector stomp started
INFO | Starting OpenShift discovery agent for service backend-amq-mesh transport type tcp
INFO | Network Connector DiscoveryNetworkConnector:NC:BrokerService[backend-amq-12-j27mn] started
INFO | Apache ActiveMQ 5.11.0.redhat-630343 (backend-amq-12-j27mn, ID:backend-amq-12-j27mn-35700-1597673091911-0:1) started
INFO | For help or more information please see: http://activemq.apache.org 
INFO | Adding service: [tcp://100.62.169.46:61616, failed:false, connectionFailures:0]
INFO | Establishing network connection from vm://backend-amq-12-j27mn to tcp://100.62.169.46:61616
INFO | Connector vm://backend-amq-12-j27mn started
INFO | backend-amq-12-j27mn Shutting down NC
INFO | backend-amq-12-j27mn bridge to Unknown stopped
INFO | error with pending local brokerInfo on: vm://backend-amq-12-j27mn#0
org.apache.activemq.transport.TransportDisposedIOException: peer (vm://backend-amq-12-j27mn#1) stopped.
   at org.apache.activemq.transport.vm.VMTransport.stop(VMTransport.java:230)[activemq-broker-5.11.0.redhat-630343.jar:5.11.0.redhat-630343]
   at org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)[activemq-client-5.11.0.redhat-630343.jar:5.11.0.redhat-630343]
   at org.apache.activemq.transport.TransportFilter.stop(TransportFilter.java:65)[activemq-client-5.11.0.redhat-630343.jar:5.11.0.redhat-630343]
   at org.apache.activemq.transport.ResponseCorrelator.stop(ResponseCorrelator.java:132)[activemq-client-5.11.0.redhat-630343.jar:5.11.0.redhat-630343]
   at org.apache.activemq.broker.TransportConnection.doStop(TransportConnection.java:1193)[activemq-broker-5.11.0.redhat-630343.jar:5.11.0.redhat-630343]
   at org.apache.activemq.broker.TransportConnection$4.run(TransportConnection.java:1159)[activemq-broker-5.11.0.redhat-630343.jar:5.11.0.redhat-630343]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_171]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_171]
   at java.lang.Thread.run(Thread.java:748)[:1.8.0_171]
INFO | Connector vm://backend-amq-12-j27mn stopped
WARN | Could not start network bridge between: vm://backend-amq-12-j27mn and: tcp://100.62.169.46:61616 due to: Connection refused (Connection refused)
INFO | Establishing network connection from vm://backend-amq-12-j27mn to tcp://100.62.169.46:61616
4

1 回答 1

0

要让 pod 相互通信,您需要创建一个服务

apiVersion: v1
kind: Service
metadata:
  name: amq-svc      
spec:
  selector:                  
    docker-registry: default
...
  ports:
  - nodePort: 0
    port: 61616               
    protocol: TCP
    targetPort: 61616 

对于 pod 数量和缩放等。您需要使用部署配置

但我不会从头开始做所有事情,而是使用这样的示例项目。它已经有一个模板可供您使用,然后根据您的要求对其进行编辑。

于 2020-08-23T23:31:04.377 回答