用rocketmq-operator部署rocketmq集群1-operator部署
用rocketmq-operator部署rocketmq集群2-nameserver部署
用rocketmq-operator部署rocketmq集群3-broker部署
用rocketmq-operator部署rocketmq集群4-console部署

broker直接用官方的:

ConfigMap broker-config

apiVersion: v1
kind: ConfigMap
metadata:
  name: broker-config
  namespace: rocketmq
data:
  # BROKER_MEM sets the broker JVM, if set to "" then Xms = Xmx = max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB))
  BROKER_MEM: " -Xms2g -Xmx2g -Xmn1g "
  broker-common.conf: |
    # brokerClusterName, brokerName, brokerId are automatically generated by the operator and do not set it manually!!!
    deleteWhen=04
    fileReservedTime=48
    flushDiskType=ASYNC_FLUSH
    # set brokerRole to ASYNC_MASTER or SYNC_MASTER. DO NOT set to SLAVE because the replica instance will automatically be set!!!
    brokerRole=ASYNC_MASTER

Broker cluster

apiVersion: rocketmq.apache.org/v1alpha1
kind: Broker
metadata:
  name: broker
  namespace: rocketmq
spec:
  #主broker数量
  size: 3
  nameServers: "namesrv1:9876;namesrv2:9876"
  # replicaPerGroup 每个主broker的副本数量
  replicaPerGroup: 1
  brokerImage: apacherocketmq/rocketmq-broker:4.5.0-alpine-operator-0.3.0
  imagePullPolicy: IfNotPresent
  resources:
    requests:
      memory: "2048Mi"
      cpu: "250m"
    limits:
      memory: "12288Mi"
      cpu: "500m"
  allowRestart: true
  storageMode: StorageClass
  hostPath: /data/rocketmq/broker
  # scalePodName is [Broker name]-[broker group number]-master-0
  scalePodName: broker-0-master-0
  # env defines custom env, e.g. BROKER_MEM
  env:
    - name: BROKER_MEM
      valueFrom:
        configMapKeyRef:
          name: broker-config
          key: BROKER_MEM
  volumes:
    - name: broker-config
      configMap:
        name: broker-config
        items:
          - key: broker-common.conf
            path: broker-common.conf
  volumeClaimTemplates:
    - metadata:
        name: broker-storage
      spec:
        accessModes:
          - ReadWriteOnce
        storageClassName: nas
        resources:
          requests:
            storage: 100Gi

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code