前言
大家好,在今天的討論中,我們將深入研究如何將ActiveMQ遷移到云端,以便更好地利用Kubernetes的容器調度和資源管理能力,確保ActiveMQ的高可用性和可擴展性。
ActiveMQ是Apache開源組織推出的一款開源的、完全支持JMS1.1和J2EE1.4規范的JMS Provider實現的消息中間件(MOM)。它是所有開源項目中最流行也最強大的開源消息中間件,主要用于分布式系統架構中,可以實現高可用、高性能、可伸縮、易用和安全的企業級面向消息服務的系統。
ActiveMQ的核心概念主要包括以下幾個方面:
- 消息:消息是ActiveMQ中最基本的單位,它包含了實際需要傳輸的數據。
- 主題(Topic):主題是一種廣播類型的消息模式,一個生產者向一個主題發送消息,而所有的消費者都可以接收到這個消息。這種方式非常適合于需要將一條消息分發到多個消費者的場景。
- 隊列(Queue):隊列是一種點對點的消息模式,一個生產者向一個隊列發送消息,只有一個消費者能接收到這個消息。這種方式非常適合于需要將一條消息發送給一個特定的消費者的場景。
- 消費者(Consumer):消費者是從隊列或主題中獲取并處理消息的應用程序。
- 生產者(Producer):生產者是創建并向隊列或主題發送消息的應用程序。
- 消息代理(Broker):消息代理是ActiveMQ的核心組件,它負責接收、存儲和轉發消息。在ActiveMQ中,每一個運行的實例都是一個消息代理。
- JMS(Java Message Service):Java消息服務是關于面向消息中間件的API,用于在兩個應用程序之間或者分布式系統中發送消息,進行異步通信。JMS與具體的平臺無關,絕大多數MOM(Message Oriented Middleware)提供商都對JMS提供了支持,例如ActiveMQ就是其中一個實現。
一、部署單機ActiveMQ
步驟一:創建ConfigMap
首先,我們需要創建ConfigMap,用來存儲和管理ActiveMQ的相關配置。
apiVersion: v1
kind: ConfigMap
metadata:name: activemq-config-singlenamespace: 你實際的namespace
data:activemq.xml: |<beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"><!-- Allows us to use system properties as variables in this configuration file --><bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="locations"><value>file:${activemq.conf}/credentials.properties</value></property></bean><!-- Allows accessing the server log --><bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"lazy-init="false" scope="singleton"init-method="start" destroy-method="stop"></bean><!--The <broker> element is used to configure the ActiveMQ broker.--><broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq-single" dataDirectory="${activemq.data}"> <plugins><simpleAuthenticationPlugin><users><authenticationUser username="my_mq_test" password="my_mq_test" groups="users,admins"/></users></simpleAuthenticationPlugin></plugins><destinationPolicy><policyMap><policyEntries><policyEntry topic=">" ><!-- The constantPendingMessageLimitStrategy is used to preventslow topic consumers to block producers and affect other consumersby limiting the number of messages that are retainedFor more information, see:http://activemq.apache.org/slow-consumer-handling.html--><pendingMessageLimitStrategy><constantPendingMessageLimitStrategy limit="1000"/></pendingMessageLimitStrategy></policyEntry></policyEntries></policyMap></destinationPolicy><!--The managementContext is used to configure how ActiveMQ is exposed inJMX. By default, ActiveMQ uses the MBean server that is started bythe JVM. For more information, see:http://activemq.apache.org/jmx.html--><managementContext><managementContext createConnector="false"/></managementContext><!--Configure message persistence for the broker. The default persistencemechanism is the KahaDB store (identified by the kahaDB tag).For more information, see:http://activemq.apache.org/persistence.html--><persistenceAdapter><kahaDB directory="${activemq.data}/kahadb"/></persistenceAdapter><!--The systemUsage controls the maximum amount of space the broker willuse before disabling caching and/or slowing down producers. For more information, see:http://activemq.apache.org/producer-flow-control.html--><systemUsage><systemUsage><memoryUsage><memoryUsage percentOfJvmHeap="70" /></memoryUsage><storeUsage><storeUsage limit="100 gb"/></storeUsage><tempUsage><tempUsage limit="50 gb"/></tempUsage></systemUsage></systemUsage><!--The transport connectors expose ActiveMQ over a given protocol toclients and other brokers. For more information, see:http://activemq.apache.org/configuring-transports.html--><transportConnectors><!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --><transportConnector name="openwire" uri="tcp://0.0.0.0:30226?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="amqp" uri="amqp://0.0.0.0:30227?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="stomp" uri="stomp://0.0.0.0:30228?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="mqtt" uri="mqtt://0.0.0.0:30229?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="ws" uri="ws://0.0.0.0:30230?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/></transportConnectors><!-- destroy the spring context on shutdown to stop jetty --><shutdownHooks><bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" /></shutdownHooks></broker><!--Enable web consoles, REST and Ajax APIs and demosThe web consoles requires by default login, you can disable this in the jetty.xml fileTake a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details--><import resource="jetty.xml"/></beans>
---
apiVersion: v1
kind: ConfigMap
metadata:name: activemq-config-jetty-realmnamespace: 你實際的namespace
data:jetty-realm.properties: |admin: my_mq_test, adminuser: user, user
在上面的配置中,我們在activemq.xml
中使用簡單授權配置以及修改了默認的端口號以提高服務的安全性;在jetty-realm.properties
中配置了web端控制臺的登錄用戶名和密碼,格式為:
用戶名 : 密碼 ,角色名
步驟二:創建Deployment
接下來,我們需要創建一個Deployment,用來定義ActiveMQ的副本數量、鏡像版本等相關信息。
apiVersion: apps/v1
kind: Deployment
metadata:name: activemq-singlenamespace: 你實際的namespace
spec:progressDeadlineSeconds: 600replicas: 1selector:matchLabels:app: activemq-singlestrategy:rollingUpdate:maxSurge: 50%maxUnavailable: 50%type: RollingUpdatetemplate:metadata:labels:app: activemq-singlespec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:- matchExpressions:- key: project.nodeoperator: Invalues:- 你實際的節點名稱volumes:- name: timezonehostPath:path: /usr/share/zoneinfo/Asia/Shanghai- name: config-activemqconfigMap: name: activemq-config-single- name: jetty-realmconfigMap: name: activemq-config-jetty-realmcontainers:- name: activemqimage: webcenter/activemq:5.14.3imagePullPolicy: IfNotPresentterminationMessagePath: /dev/termination-logterminationMessagePolicy: FilevolumeMounts: - name: config-activemqmountPath: /opt/activemq/conf/activemq.xmlsubPath: activemq.xml- name: jetty-realmmountPath: /opt/activemq/conf/jetty-realm.propertiessubPath: jetty-realm.propertiesenv:- name: HOST_IPvalueFrom:fieldRef:fieldPath: status.hostIP- name: POD_IPvalueFrom:fieldRef:fieldPath: status.podIP- name: POD_NAMEvalueFrom:fieldRef:fieldPath: metadata.name- name: TZvalue: "Asia/Shanghai"
在上述配置中,我們定義了一個名為activemq-single
的Deployment。在這里,我們使用的鏡像已經版本為webcenter/activemq:5.14.3
,并且使用了之前創建的ConfigMap中的配置文件。
步驟三:創建Service
然后,我們還需要創建一個Service,用來將K8S集群中運行的ActiveMQ實例暴露為可訪問的服務。
apiVersion: v1
kind: Service
metadata: name: service-activemq-singlenamespace: 你實際的namespace
spec: selector: app: activemq-singletype: NodePortsessionAffinity: Noneports:- name: activemq-adminport: 8161targetPort: 8161nodePort: 30225- name: activemq-tcpport: 30226targetPort: 30226nodePort: 30226- name: activemq-amqpport: 30227targetPort: 30227nodePort: 30227- name: activemq-stompport: 30228targetPort: 30228nodePort: 30228- name: activemq-mqttport: 30229targetPort: 30229nodePort: 30229- name: activemq-wsport: 30230targetPort: 30230nodePort: 30230
步驟四:驗證單機ActiveMQ
- 首先,我們啟動一個
生產者
鏈接到剛部署的單機ActiveMQ上,并且向名稱為mdm_distribute_CostCenter
的隊列中發送了一條消息,消息內容為mdm_distribute_CostCenter
。
- 接下來,我們再啟動一個
消息者
同樣鏈接到剛部署的單機ActiveMQ上,并且監聽名為mdm_distribute_CostCenter
的隊列。
- 最后,我們可以在web端的admin頁面查看相應隊列中的記錄
小結
以上就是在K8S中部署單機ActiveMQ的相關步驟。通過這些步驟,我們成功地使用無狀態的Deployment部署了一個可用的單機ActiveMQ。
二、部署ActiveMQ集群(networks of brokers)
步驟一:創建ConfigMap
與單機版類似,我們同樣需要創建一個ConfigMap來存儲和管理ActiveMQ的相關配置。
apiVersion: v1
kind: ConfigMap
metadata:name: activemq-config-node-0namespace: 你實際的namespace
data:activemq.xml: |<beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"><!-- Allows us to use system properties as variables in this configuration file --><bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="locations"><value>file:${activemq.conf}/credentials.properties</value></property></bean><!-- Allows accessing the server log --><bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"lazy-init="false" scope="singleton"init-method="start" destroy-method="stop"></bean><!--The <broker> element is used to configure the ActiveMQ broker.--><broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq-node-0" dataDirectory="${activemq.data}"><networkConnectors><networkConnector userName="my_mq_test" password="my_mq_test" uri="static:(tcp://你的實際ip:30220)" duplex="true"/></networkConnectors> <plugins><simpleAuthenticationPlugin><users><authenticationUser username="my_mq_test" password="my_mq_test" groups="users,admins"/></users></simpleAuthenticationPlugin></plugins><destinationPolicy><policyMap><policyEntries><policyEntry topic=">" ><!-- The constantPendingMessageLimitStrategy is used to preventslow topic consumers to block producers and affect other consumersby limiting the number of messages that are retainedFor more information, see:http://activemq.apache.org/slow-consumer-handling.html--><pendingMessageLimitStrategy><constantPendingMessageLimitStrategy limit="1000"/></pendingMessageLimitStrategy></policyEntry></policyEntries></policyMap></destinationPolicy><!--The managementContext is used to configure how ActiveMQ is exposed inJMX. By default, ActiveMQ uses the MBean server that is started bythe JVM. For more information, see:http://activemq.apache.org/jmx.html--><managementContext><managementContext createConnector="false"/></managementContext><!--Configure message persistence for the broker. The default persistencemechanism is the KahaDB store (identified by the kahaDB tag).For more information, see:http://activemq.apache.org/persistence.html--><persistenceAdapter><kahaDB directory="${activemq.data}/kahadb"/></persistenceAdapter><!--The systemUsage controls the maximum amount of space the broker willuse before disabling caching and/or slowing down producers. For more information, see:http://activemq.apache.org/producer-flow-control.html--><systemUsage><systemUsage><memoryUsage><memoryUsage percentOfJvmHeap="70" /></memoryUsage><storeUsage><storeUsage limit="100 gb"/></storeUsage><tempUsage><tempUsage limit="50 gb"/></tempUsage></systemUsage></systemUsage><!--The transport connectors expose ActiveMQ over a given protocol toclients and other brokers. For more information, see:http://activemq.apache.org/configuring-transports.html--><transportConnectors><!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --><transportConnector name="openwire" uri="tcp://0.0.0.0:30218?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="amqp" uri="amqp://0.0.0.0:30221?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="stomp" uri="stomp://0.0.0.0:30222?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="mqtt" uri="mqtt://0.0.0.0:30223?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="ws" uri="ws://0.0.0.0:30224?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/></transportConnectors><!-- destroy the spring context on shutdown to stop jetty --><shutdownHooks><bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" /></shutdownHooks></broker><!--Enable web consoles, REST and Ajax APIs and demosThe web consoles requires by default login, you can disable this in the jetty.xml fileTake a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details--><import resource="jetty.xml"/></beans>
---
apiVersion: v1
kind: ConfigMap
metadata:name: activemq-config-node-1namespace: 你實際的namespace
data:activemq.xml: |<beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"><!-- Allows us to use system properties as variables in this configuration file --><bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="locations"><value>file:${activemq.conf}/credentials.properties</value></property></bean><!-- Allows accessing the server log --><bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"lazy-init="false" scope="singleton"init-method="start" destroy-method="stop"></bean><!--The <broker> element is used to configure the ActiveMQ broker.--><broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq-node-0" dataDirectory="${activemq.data}"> <networkConnectors><networkConnector userName="my_mq_test" password="my_mq_test" uri="static:(tcp://你的實際ip:30218)" duplex="true"/></networkConnectors><plugins><simpleAuthenticationPlugin><users><authenticationUser username="my_mq_test" password="my_mq_test" groups="users,admins"/></users></simpleAuthenticationPlugin></plugins><destinationPolicy><policyMap><policyEntries><policyEntry topic=">" ><!-- The constantPendingMessageLimitStrategy is used to preventslow topic consumers to block producers and affect other consumersby limiting the number of messages that are retainedFor more information, see:http://activemq.apache.org/slow-consumer-handling.html--><pendingMessageLimitStrategy><constantPendingMessageLimitStrategy limit="1000"/></pendingMessageLimitStrategy></policyEntry></policyEntries></policyMap></destinationPolicy><!--The managementContext is used to configure how ActiveMQ is exposed inJMX. By default, ActiveMQ uses the MBean server that is started bythe JVM. For more information, see:http://activemq.apache.org/jmx.html--><managementContext><managementContext createConnector="false"/></managementContext><!--Configure message persistence for the broker. The default persistencemechanism is the KahaDB store (identified by the kahaDB tag).For more information, see:http://activemq.apache.org/persistence.html--><persistenceAdapter><kahaDB directory="${activemq.data}/kahadb"/></persistenceAdapter><!--The systemUsage controls the maximum amount of space the broker willuse before disabling caching and/or slowing down producers. For more information, see:http://activemq.apache.org/producer-flow-control.html--><systemUsage><systemUsage><memoryUsage><memoryUsage percentOfJvmHeap="70" /></memoryUsage><storeUsage><storeUsage limit="100 gb"/></storeUsage><tempUsage><tempUsage limit="50 gb"/></tempUsage></systemUsage></systemUsage><!--The transport connectors expose ActiveMQ over a given protocol toclients and other brokers. For more information, see:http://activemq.apache.org/configuring-transports.html--><transportConnectors><!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --><transportConnector name="openwire" uri="tcp://0.0.0.0:30220?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="amqp" uri="amqp://0.0.0.0:30221?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="stomp" uri="stomp://0.0.0.0:30222?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="mqtt" uri="mqtt://0.0.0.0:30223?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="ws" uri="ws://0.0.0.0:30224?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/></transportConnectors><!-- destroy the spring context on shutdown to stop jetty --><shutdownHooks><bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" /></shutdownHooks></broker><!--Enable web consoles, REST and Ajax APIs and demosThe web consoles requires by default login, you can disable this in the jetty.xml fileTake a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details--><import resource="jetty.xml"/></beans>
---
apiVersion: v1
kind: ConfigMap
metadata:name: activemq-config-jetty-realmnamespace: 你實際的namespace
data:jetty-realm.properties: |admin: my_mq_test, adminuser: user, user
步驟二:創建Deployment
接下來,我們需要創建2個Deployment,分別對應ActiveMQ集群中的2個節點。主要區別在于使用ConfigMap中的配置文件的不同和containers
中暴露的端口不同。
apiVersion: apps/v1
kind: Deployment
metadata:name: activemq-node-0namespace: 你實際的namespace
spec:progressDeadlineSeconds: 600replicas: 1selector:matchLabels:app: activemq-node-0strategy:rollingUpdate:maxSurge: 50%maxUnavailable: 50%type: RollingUpdatetemplate:metadata:labels:app: activemq-node-0name: activemq-nodespec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:- matchExpressions:- key: project.nodeoperator: Invalues:- 你實際的節點名稱volumes:- name: timezonehostPath:path: /usr/share/zoneinfo/Asia/Shanghai- name: config-activemqconfigMap: name: activemq-config-node-0- name: jetty-realmconfigMap: name: activemq-config-jetty-realmcontainers:- name: activemqimage: webcenter/activemq:5.14.3imagePullPolicy: IfNotPresentterminationMessagePath: /dev/termination-logterminationMessagePolicy: FilevolumeMounts: - name: config-activemqmountPath: /opt/activemq/conf/activemq.xmlsubPath: activemq.xml- name: jetty-realmmountPath: /opt/activemq/conf/jetty-realm.propertiessubPath: jetty-realm.propertiesenv:- name: HOST_IPvalueFrom:fieldRef:fieldPath: status.hostIP- name: POD_IPvalueFrom:fieldRef:fieldPath: status.podIP- name: POD_NAMEvalueFrom:fieldRef:fieldPath: metadata.name- name: TZvalue: "Asia/Shanghai"
---
apiVersion: apps/v1
kind: Deployment
metadata:name: activemq-node-1namespace: 你實際的namespace
spec:progressDeadlineSeconds: 600replicas: 1selector:matchLabels:app: activemq-node-1strategy:rollingUpdate:maxSurge: 50%maxUnavailable: 50%type: RollingUpdatetemplate:metadata:labels:app: activemq-node-1name: activemq-nodespec:affinity:nodeAffinity:requiredDuringSchedulingIgnoredDuringExecution:nodeSelectorTerms:- matchExpressions:- key: project.nodeoperator: Invalues:- 你實際的節點名稱volumes:- name: timezonehostPath:path: /usr/share/zoneinfo/Asia/Shanghai- name: config-activemqconfigMap: name: activemq-config-node-1- name: jetty-realmconfigMap: name: activemq-config-jetty-realmcontainers:- name: activemqimage: webcenter/activemq:5.14.3imagePullPolicy: IfNotPresentterminationMessagePath: /dev/termination-logterminationMessagePolicy: FilevolumeMounts: - name: config-activemqmountPath: /opt/activemq/conf/activemq.xmlsubPath: activemq.xml- name: jetty-realmmountPath: /opt/activemq/conf/jetty-realm.propertiessubPath: jetty-realm.propertiesenv:- name: HOST_IPvalueFrom:fieldRef:fieldPath: status.hostIP- name: POD_IPvalueFrom:fieldRef:fieldPath: status.podIP- name: POD_NAMEvalueFrom:fieldRef:fieldPath: metadata.name- name: TZvalue: "Asia/Shanghai"
步驟三:創建Service
然后,我們還需要來創建Service,用來將K8S集群中運行的ActiveMQ實例暴露為可訪問的服務。這里同樣需要創建2個Service,分別對應步驟二中的2個Deployment,還需要1個Service來暴露公共的端口。
apiVersion: v1
kind: Service
metadata: name: service-activemq-commonnamespace: 你實際的namespace
spec: selector: name: activemq-nodetype: NodePortsessionAffinity: Noneports:- name: activemq-amqpport: 30221targetPort: 30221nodePort: 30221- name: activemq-stompport: 30222targetPort: 30222nodePort: 30222- name: activemq-mqttport: 30223targetPort: 30223nodePort: 30223- name: activemq-wsport: 30224targetPort: 30224nodePort: 30224
---
apiVersion: v1
kind: Service
metadata:name: service-activemq-node-0namespace: 你實際的namespace
spec:selector:app: activemq-node-0type: NodePortsessionAffinity: Noneports:- name: activemq-adminport: 8161targetPort: 8161nodePort: 30217- name: activemq-tcpport: 30218targetPort: 30218nodePort: 30218
---
apiVersion: v1
kind: Service
metadata:name: service-activemq-node-1namespace: 你實際的namespace
spec:selector:app: activemq-node-1type: NodePortsessionAffinity: Noneports:- name: activemq-adminport: 8161targetPort: 8161nodePort: 30219- name: activemq-tcpport: 30220targetPort: 30220nodePort: 30220
步驟五:驗證ActiveMQ集群
- 首先,我們啟動一個
生產者
鏈接到剛部署的集群ActiveMQ上,并且向名稱為mdm_distribute_Employee
的隊列中發送了一條消息,消息內容為mdm_distribute_Employee
。
- 接下來,我們再啟動一個
消息者
同樣鏈接到剛部署的集群ActiveMQ上,并且監聽名為mdm_distribute_Employee
的隊列。
- 最后,我們可以在web端的admin頁面查看相應隊列中的記錄
小結
在K8S中部署ActiveMQ集群的相關步驟已經介紹完畢。通過這些步驟,我們成功地使用無狀態的Deployment部署了一個可用的ActiveMQ集群。
結論
本文詳盡地探討了在K8S環境中部署ActiveMQ單機與集群的詳細步驟。細讀全文,我們可以發現,ActiveMQ的數據存儲仍在POD中,這是由于業務需求所決定的。當發送MQ消息時,數據需要先被寫入數據庫,然后再進行發送,因此ActiveMQ的數據存儲變得無關緊要。當然,我們還可以選擇使用pvc或者直接掛載到宿主機等方式來保存數據。相較于傳統的手動部署方式,利用K8S進行部署能夠帶來更高的便捷性和效率,從而更快速地完成ActiveMQ集群的部署和管理任務。