部署RocketMQ在Kubernetes环境中需要以下步骤:
公司主营业务:网站制作、成都网站制作、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联公司是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联公司推出涵江免费做网站回馈大家。
1、创建命名空间
2、创建持久化存储
3、部署NameServer
4、部署Broker
以下是详细的操作步骤:
1. 创建命名空间
apiVersion: v1 kind: Namespace metadata: name: rocketmq
将以上内容保存为namespace.yaml
,然后运行kubectl apply f namespace.yaml
。
2. 创建持久化存储
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: rocketmqpvc namespace: rocketmq spec: accessModes: ReadWriteOnce resources: requests: storage: 1Gi storageClassName: manual apiVersion: v1 kind: PersistentVolumeClaim metadata: name: rocketmqnamesrvpvc namespace: rocketmq spec: accessModes: ReadWriteOnce resources: requests: storage: 1Gi storageClassName: manual
将以上内容保存为pvc.yaml
,然后运行kubectl apply f pvc.yaml
。
3. 部署NameServer
apiVersion: apps/v1 kind: Deployment metadata: name: rocketmqnamesrv namespace: rocketmq spec: replicas: 1 selector: matchLabels: app: rocketmqnamesrv template: metadata: labels: app: rocketmqnamesrv spec: containers: name: rocketmqnamesrv image: apacherocketmq/rocketmq:4.7.1 command: ["sh", "mqnamesrv"] env: name: ROCKETMQ_NAMESRV_ADDR value: "localhost:9876" ports: containerPort: 9876 volumeMounts: name: rocketmqnamesrvdata mountPath: /opt/rocketmq4.7.1/store/commitlog subPath: commitlog name: rocketmqnamesrvdata mountPath: /opt/rocketmq4.7.1/store/consumequeue subPath: consumequeue volumes: name: rocketmqnamesrvdata persistentVolumeClaim: claimName: rocketmqnamesrvpvc
将以上内容保存为namesrv.yaml
,然后运行kubectl apply f namesrv.yaml
。
4. 部署Broker
apiVersion: apps/v1 kind: Deployment metadata: name: rocketmqbroker namespace: rocketmq spec: replicas: 1 selector: matchLabels: app: rocketmqbroker template: metadata: labels: app: rocketmqbroker spec: containers: name: rocketmqbroker image: apacherocketmq/rocketmq:4.7.1 command: ["sh", "mqbroker", "n", "localhost:9876", "c", "/opt/rocketmq4.7.1/conf/2mnoslave/brokera.properties"] env: name: ROCKETMQ_BROKER_NAMESRV_ADDR value: "localhost:9876" ports: containerPort: 10911 containerPort: 10909 volumeMounts: name: rocketmqbrokerdata mountPath: /opt/rocketmq4.7.1/store/commitlog subPath: commitlog name: rocketmqbrokerdata mountPath: /opt/rocketmq4.7.1/store/consumequeue subPath: consumequeue volumes: name: rocketmqbrokerdata persistentVolumeClaim: claimName: rocketmqpvc
将以上内容保存为broker.yaml
,然后运行kubectl apply f broker.yaml
。
至此,RocketMQ已经在Kubernetes环境中部署完成。
名称栏目:求一份在kubernetes环境里面部署rockermq的文档?
转载源于:http://www.shufengxianlan.com/qtweb/news47/76947.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联