Kubernetes activemq系列| k8s 部署activemq artemis 集群(可外部通信)
Apache ActiveMQ Artemis 是一个高性能的开源消息代理,它完全符合 Java Message Service (JMS) 2.0 规范,并支持多种通信协议,包括 AMQP、MQTT、STOMP 和 OpenWire 等。ActiveMQ Artemis 由 Apache Software Foundation 开发和维护,旨在提供可靠的消息传递解决方案,适用于各种异步通信场景。
一、ActiveMQ Artemis介绍
Apache ActiveMQ Artemis 是一个高性能的开源消息代理,它完全符合 Java Message Service (JMS) 2.0 规范,并支持多种通信协议,包括 AMQP、MQTT、STOMP 和 OpenWire 等。ActiveMQ Artemis 由 Apache Software Foundation 开发和维护,旨在提供可靠的消息传递解决方案,适用于各种异步通信场景。
bin- 运行 ActiveMQ Artemis 所需的二进制文件和脚本。
examples- 各种例子。
lib- 运行 ActiveMQ Artemis 所需的 jar 和库
schema- 用于验证 ActiveMQ Artemis 配置文件的 XML 模式
web- 代理运行时加载 Web 上下文的文件夹。
api- api 文档放在 web 文件夹下。
user-manual- 用户手册位于 web 文件夹下。
二、k8s 部署activemq artemis
官方镜像地址
https://hub.docker.com/r/apache/activemq-artemis/tags
---
apiVersion: v1
kind: Namespace
metadata:
name: activemq
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: activemq
namespace: activemq
spec:
replicas: 3
serviceName: activemq-headless
selector:
matchLabels:
app: activemq
template:
metadata:
labels:
app: activemq
spec:
containers:
- name: activemq
image: apache/activemq-artemis:latest
ports:
- containerPort: 61616
name: tcp
- containerPort: 8161
name: web
- containerPort: 1883
name: mqtt
volumeMounts:
- name: activemq-data
mountPath: /var/lib/artemis-instance
volumeClaimTemplates:
- metadata:
name: activemq-data
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "nfs-client"
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
name: activemq
namespace: activemq
spec:
type: NodePort # Change service type to NodePort
ports:
- port: 61616
targetPort: tcp
name: tcp
nodePort: 30000 # Specify the node port (you can choose any available port)
- port: 8161
targetPort: web
name: web
nodePort: 30001 # Specify the node port (you can choose any available port)
- port: 1883
targetPort: mqtt
name: mqtt
nodePort: 30002 # Specify the node port (you can choose any available port)
selector:
app: activemq
---
apiVersion: v1
kind: Service
metadata:
name: activemq-headless
namespace: activemq
spec:
ports:
- port: 61616
targetPort: tcp
name: tcp
- port: 8161
targetPort: web
name: web
- port: 1883
targetPort: mqtt
name: mqtt
selector:
app: activemq
AMQP端口:默认为5672端口,用于AMQP(高级消息队列协议)的通信。
OpenWire端口:默认为61616端口,用于OpenWire协议的通信,OpenWire是ActiveMQ自身的二进制协议。
STOMP端口:默认为61613端口,用于STOMP(简单文本协议)的通信。
HornetQ Core端口:默认为5445端口,用于HornetQ Core协议的通信。
Web管理端口:默认为8161端口,用于访问Web管理控制台。
JMX端口:默认为1099端口,用于Java管理扩展的远程管理。
MQTT端口:端口1883通常用于MQTT的非加密通信,而端口8883通常用于MQTT的加密通信(通过TLS/SSL)。
持续更新中关注不迷糊。。。
更多推荐
所有评论(0)