K8S如何部署ActiveMQ(單機、集群)

3.png

前言

大家好,在今天的討論中,我們將深入研究如何將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&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="amqp" uri="amqp://0.0.0.0:30227?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="stomp" uri="stomp://0.0.0.0:30228?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="mqtt" uri="mqtt://0.0.0.0:30229?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="ws" uri="ws://0.0.0.0:30230?maximumConnections=1000&amp;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

3.png

  • 接下來,我們再啟動一個消息者同樣鏈接到剛部署的單機ActiveMQ上,并且監聽名為mdm_distribute_CostCenter的隊列。

4.png

  • 最后,我們可以在web端的admin頁面查看相應隊列中的記錄

6.png

小結

以上就是在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&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="amqp" uri="amqp://0.0.0.0:30221?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="stomp" uri="stomp://0.0.0.0:30222?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="mqtt" uri="mqtt://0.0.0.0:30223?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="ws" uri="ws://0.0.0.0:30224?maximumConnections=1000&amp;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&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="amqp" uri="amqp://0.0.0.0:30221?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="stomp" uri="stomp://0.0.0.0:30222?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="mqtt" uri="mqtt://0.0.0.0:30223?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/><transportConnector name="ws" uri="ws://0.0.0.0:30224?maximumConnections=1000&amp;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

2.png

  • 接下來,我們再啟動一個消息者同樣鏈接到剛部署的集群ActiveMQ上,并且監聽名為mdm_distribute_Employee的隊列。

1.png

  • 最后,我們可以在web端的admin頁面查看相應隊列中的記錄

5.png

小結

在K8S中部署ActiveMQ集群的相關步驟已經介紹完畢。通過這些步驟,我們成功地使用無狀態的Deployment部署了一個可用的ActiveMQ集群。

結論

本文詳盡地探討了在K8S環境中部署ActiveMQ單機與集群的詳細步驟。細讀全文,我們可以發現,ActiveMQ的數據存儲仍在POD中,這是由于業務需求所決定的。當發送MQ消息時,數據需要先被寫入數據庫,然后再進行發送,因此ActiveMQ的數據存儲變得無關緊要。當然,我們還可以選擇使用pvc或者直接掛載到宿主機等方式來保存數據。相較于傳統的手動部署方式,利用K8S進行部署能夠帶來更高的便捷性和效率,從而更快速地完成ActiveMQ集群的部署和管理任務。

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/166689.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/166689.shtml
英文地址,請注明出處:http://en.pswp.cn/news/166689.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

申請二級域名

1、登錄騰訊云 騰訊云 產業智變云啟未來 - 騰訊 (tencent.com) 2、進入我的域名&#xff0c;點擊主域名 3、點擊前往DNSPod管理 4、點擊我的域名&#xff0c;然后點擊主域名 5、點擊添加記錄&#xff0c;進行添加二級域名信息 6、添加相應二級域名信息 7、添加后需要進行驗證…

系列一、Spring Framework

一、Spring Framework 1.1、概述 Spring是一個輕量級的開源的JavaEE框架&#xff1b;Spring可以解決企業應用開發的復雜性&#xff1b;Spring有兩個核心部分&#xff1a;IOC和AOP ① IOC&#xff1a;控制反轉&#xff0c;把創建對象的過程交給Spring進行管理&#xff1b; ② …

PSP - 從頭搭建 抗原類別 (GPCR) 的 蛋白質結構預測 項目流程

歡迎關注我的CSDN&#xff1a;https://spike.blog.csdn.net/ 本文地址&#xff1a;https://spike.blog.csdn.net/article/details/134595717 GPCRs&#xff08;G Protein-Coupled Receptors&#xff0c;G蛋白偶聯受體&#xff09;&#xff0c;又稱為7次跨膜受體&#xff0c;是細…

界面組件Telerik UI for WinForms中文教程 - 創建明暗模式的桌面應用

黑暗模式現在在很多應用程序中都挺常見的&#xff0c;但如何在桌面應用程序中實現它呢&#xff1f;這很簡單&#xff0c;本文將為大家介紹如何使用一個類和命令行調用來實現&#xff01; Telerik UI for WinForms擁有適用Windows Forms的110多個令人驚嘆的UI控件。所有的UI fo…

Appium 全新 2.0 全新跨平臺生態,版本特性搶鮮體驗!

關于Appium V2 Appium V2 beta版本在2021年發布&#xff0c;從2022年1月1號開始&#xff0c;Appium核心團隊不會再維護Appium 1.x版本了&#xff0c;所有近期官方發布的平臺驅動&#xff08;如Android平臺的UIAutomator&#xff0c;IOS平臺的XCUITest&#xff09;不再兼容Appi…

shrio----(1)基礎

文章目錄 前言 一、Shrio1、什么是shiro2、為什么使用shrio 二、主要類2.1、Subject2.2、SecurityManager2.3、Realms 三、認證授權3.1、認證(Authentication)3.2、授權&#xff08;authorization&#xff09;四、入門示例參考文章 前言 簡單入門介紹 一、Shrio http://shir…

【譯】Spring 6 入參數據校驗: 綜合指南

一、前言 在 Spring 6.1 中&#xff0c;有一個非常值得注意的重要改進——編程式驗證器實現。Spring 長期以來一直通過注解支持聲明式驗證&#xff0c;而 Spring 6.1 則通過提供專用的編程式驗證方法引入了這一強大的增強功能。 編程式驗證允許開發人員對驗證過程進行細粒度控…

網站定制開發有哪些分類?|企業軟件app小程序定制

網站定制開發有哪些分類&#xff1f;|企業軟件app小程序定制 網站定制開發是指根據客戶需求&#xff0c;為其量身定制設計和開發的網站服務。目前&#xff0c;網站定制開發主要分為以下幾個分類&#xff1a; 1. 靜態網站定制開發&#xff1a;靜態網站是由HTML、CSS和JavaScrip…

手寫promise(3)-- 實例方法 靜態方法

目錄 實例方法 catch finally 靜態方法 reslove reject race all allSettled any 實例方法 提供給promise實例的方法 包括catch 與finally catch Promise 實例的 catch() 方法用于注冊一個在 promise 被拒絕時調用的函數。它會立即返回一個等效的 Promise 對象&…

一文詳解 requests 庫中 json 參數和 data 參數的用法

在requests庫當中&#xff0c;requests請求方法&#xff0c;當發送post/put/delete等帶有請求體的請求時&#xff0c;有json和data2個參數可選。 眾所周知&#xff0c;http請求的請求體格式主要有以下4種&#xff1a; application/json applicaiton/x-www-from-urlencoded …

java堆文件排查

技術主題 在之前的開發的一個項目中&#xff0c;因為程序的一個bug&#xff0c;導致一些引用的對象一直沒有回收&#xff0c;從而導致堆內存一直在增大&#xff0c;老年代一直在增大&#xff0c;老年代進行堆積&#xff0c;后來的排查思路是通過dump堆的文件&#xff0c;然后對…

Dockerfile-CentOS7.9+Python3.11.2

本文為CentOS7.9下安裝Python3.11.2環境的Dockerfile # CentOS with Python3.11.2 # Author xxmail.com# build a new image with basic centos FROM centos:centos7.9.2009 # who is the author MAINTAINER xxmail.comRUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/…

vue的生命周期及不同階段狀態可以進行的行為

什么是vue的生命周期&#xff1f; Vue 的實例從創建到銷毀的過程 &#xff0c;就是生命周期 &#xff0c;也就是從開始創建 &#xff0c;初始化數據 &#xff0c;編譯模板 &#xff0c;掛載Dom到渲染DOM &#xff0c;更新數據再到渲染 &#xff0c;卸載等一系列的過程 &#x…

OpenAI研發神秘“Q*”模型:科學家認輸,AI贏了人類關鍵一戰

圖片來源&#xff1a;視覺中國 作者丨葉蓁 編輯丨康曉 出品丨深網騰訊新聞小滿工作室 在山姆奧特曼&#xff08;Sam Altman&#xff09;被OpenAI前董事會突然罷免之前&#xff0c;數位研究人員向董事會發送了一封信&#xff0c;警告稱他們發現了一種能夠威脅到人類的強大人工…

IIS 基線安全加固操作

目錄 賬號管理、認證授權 ELK-IIS-01-01-01 ELK-IIS-01-01-02 ELK-IIS-01-01-03 ELK-IIS-01-01-04 日志配置 ELK-IIS-02-01-01 ELK-IIS-02-01-02 ??????? ELK-IIS-02-01-03 通信協議 ELK-IIS-03-01-01 設備其他安全要求 ELK-IIS-04-01-01 ??????? ELK-I…

【DDS】OpenDDS配置與使用

&#x1f60f;★,:.☆(&#xffe3;▽&#xffe3;)/$:.★ &#x1f60f; 這篇文章主要介紹OpenDDS配置與使用。 無專精則不能成&#xff0c;無涉獵則不能通。——梁啟超 歡迎來到我的博客&#xff0c;一起學習&#xff0c;共同進步。 喜歡的朋友可以關注一下&#xff0c;下次更…

華為云編譯構建CodeArts Build常見問答匯總

1.【Build】公有云編譯構建是否支持導入外部機器做執行機 答&#xff1a;參考鏈接&#xff1a;https://support.huaweicloud.com/usermanual-devcloud/devcloud_01_0017.html ? 使用代理機功能&#xff0c;需要配備1臺4U8G或以上規格、磁盤>80GB的主機。 ? 安裝代理的…

Ubuntu 啟用 root 用戶

在啟用 root 用戶之前&#xff0c;我們先來了解一下&#xff0c; ubuntu 命令的組成。 打開 ubuntu 的終端&#xff0c;現在的命令行是由 topeetubuntu:~$ 這幾個字母組成&#xff0c;那么這幾個字母都代表 什么意思呢&#xff1f; topeet …

配電室智慧運維監控系統

配電室智能運維監控系統是一個綜合性的管理系統&#xff0c;專門針對配電室的運維工作進行設計。依托電易云-智慧電力物聯網&#xff0c;它融合了先進的監測技術、自動化技術、數據分析技術等&#xff0c;對配電室進行全方位、實時的智能化監控和管理&#xff0c;以提升配電室運…

人工智能對當代生活的影響

人工智能&#xff08;AI&#xff09;是指通過模擬人類智能的方式&#xff0c;使機器能夠執行某些需要智能的任務。隨著技術的快速發展和應用的廣泛推廣&#xff0c;人工智能已經深入到我們的日常生活中&#xff0c;對我們的生活和社會產生了深遠的影響。本文將探討人工智能對當…