RocketMQ Operator是一个基于Kubernetes Operator模式的工具,旨在自动化管理部署在Kubernetes集群上的RocketMQ服务实例全生命周期。通过自定义资源定义(CRD)和控制器,实现RocketMQ集群的声明式部署、扩展、升级及维护,简化Kubernetes环境中RocketMQ的运维复杂度。
1. 部署CRD
bashkubectl apply -f https://raw.githubusercontent.com/apache/rocketmq-operator/master/deploy/crds/rocketmq.apache.org_rocketmqclusters.yaml kubectl apply -f https://raw.githubusercontent.com/apache/rocketmq-operator/master/deploy/crds/rocketmq.apache.org_brokers.yaml kubectl apply -f https://raw.githubusercontent.com/apache/rocketmq-operator/master/deploy/crds/rocketmq.apache.org_nameservers.yaml
2. 部署Operator
bashkubectl apply -f https://raw.githubusercontent.com/apache/rocketmq-operator/master/deploy/service_account.yaml kubectl apply -f https://raw.githubusercontent.com/apache/rocketmq-operator/master/deploy/role.yaml kubectl apply -f https://raw.githubusercontent.com/apache/rocketmq-operator/master/deploy/role_binding.yaml kubectl apply -f https://raw.githubusercontent.com/apache/rocketmq-operator/master/deploy/operator.yaml
3. 创建RocketMQ集群
创建rocketmq-cluster.yaml文件,示例配置:
yamlapiVersion: rocketmq.apache.org/v1alpha1 kind: RocketMQCluster metadata: name: rocketmq-cluster spec: nameServer: replicas: 2 image: apache/rocketmq-namesrv:4.9.4 resources: requests: memory: "512Mi" cpu: "500m" limits: memory: "1Gi" cpu: "1000m" broker: replicas: 2 image: apache/rocketmq-broker:4.9.4 resources: requests: memory: "1Gi" cpu: "1000m" limits: memory: "2Gi" cpu: "2000m" storageMode: PersistentVolume persistence: storageClassName: "standard" size: "10Gi"
应用配置:
bashkubectl apply -f rocketmq-cluster.yaml
| 参数路径 | 说明 | 默认值 |
|---|---|---|
| spec.nameServer.replicas | NameServer副本数 | 1 |
| spec.nameServer.image | NameServer镜像地址 | apache/rocketmq-namesrv:latest |
| spec.broker.replicas | Broker副本数 | 1 |
| spec.broker.image | Broker镜像地址 | apache/rocketmq-broker:latest |
| spec.broker.storageMode | 存储模式(PersistentVolume/Ephemeral) | PersistentVolume |
| spec.broker.persistence.storageClassName | PV存储类 | default |
| spec.broker.persistence.size | 存储容量 | 10Gi |
bashkubectl get rocketmqclusters kubectl get pods -l app=rocketmq
完整文档和示例请参考:https://github.com/apache/rocketmq-operator
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务