博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
kafka的docker文件
阅读量:5103 次
发布时间:2019-06-13

本文共 5415 字,大约阅读时间需要 18 分钟。

一、kafka

apiVersion: extensions/v1beta1kind: Deploymentmetadata:  name: dev-message-router-kafka  namespace: onap  labels:    app: message-router-kafka    chart: message-router-kafka-2.0.0    release: dev    heritage: Tillerspec:  replicas: 1  template:    metadata:      labels:        app:  message-router-kafka        release: dev    spec:      initContainers:      - name: message-router-kafka-seed-kafka-topics        command:        - /bin/bash        - -c        - >          if [ -d /tmp/topics/ECOMP-PORTAL-INBOX-0 ]; then          echo "nothing to do";          else          git clone -b 2.0.0-ONAP --single-branch http://gerrit.onap.org/r/dmaap/messagerouter/messageservice.git /tmp/gerrit;          echo "Clone complete. Copying from /tmp/gerrit/oom-projects/data-kafka/kafka-logs/* to /tmp/topics";          cp -var /tmp/gerrit/oom-topics/data-kafka/kafka-logs/* /tmp/topics;          echo "Done.";          fi        image: "registry.hub.docker.com/oomk8s/ubuntu-init:2.0.0"        imagePullPolicy: IfNotPresent        volumeMounts:        - mountPath: /tmp/topics          name: kafka-data      - command:        - /root/ready.py        args:        - --container-name        - message-router-zookeeper        env:        - name: NAMESPACE          valueFrom:            fieldRef:              apiVersion: v1              fieldPath: metadata.namespace        image: "oomk8s/readiness-check:2.0.0"        imagePullPolicy: IfNotPresent        name: message-router-kafka-readiness      containers:      - name: message-router-kafka        image: "docker.io/wurstmeister/kafka:1.1.0"        imagePullPolicy:  IfNotPresent        ports:        - containerPort: 9092                livenessProbe:          tcpSocket:            port: 9092          initialDelaySeconds: 10          periodSeconds: 10                readinessProbe:          tcpSocket:            port: 9092          initialDelaySeconds: 10          periodSeconds: 10        env:        - name: KAFKA_ZOOKEEPER_CONNECT          value: "message-router-zookeeper:2181"        - name: KAFKA_ADVERTISED_HOST_NAME          value: "message-router-kafka"        - name: KAFKA_BROKER_ID          value: "0"        - name: KAFKA_ADVERTISED_LISTENERS          value: PLAINTEXT://message-router-kafka:9092        - name: KAFKA_ADVERTISED_PORT          value: "9092"        - name: KAFKA_PORT          value: "9092"        volumeMounts:        - mountPath: /etc/localtime          name: localtime          readOnly: true        - mountPath: /var/run/docker.sock          name: docker-socket        - mountPath: /kafka          name: kafka-data      volumes:      - name: localtime        hostPath:          path: /etc/localtime      - name: docker-socket        hostPath:          path: /var/run/docker.sock      - name: kafka-data        persistentVolumeClaim:          claimName: dev-message-router-kafka      imagePullSecrets:      - name: "onap-docker-registry-key"

二、zookeeper

apiVersion: extensions/v1beta1kind: Deploymentmetadata:  name: dev-message-router-zookeeper  namespace: onap  labels:    app: message-router-zookeeper    chart: message-router-zookeeper-2.0.0    release: dev    heritage: Tillerspec:  replicas: 1  template:    metadata:      labels:        app: message-router-zookeeper        release: dev    spec:      initContainers:      - name: message-router-zookeeper-seed-zookeeper-topics        command:        - /bin/bash        - -c        - >          if [ -d /tmp/topics/version-2 ]; then          echo "nothing to do";          else          git clone -b 2.0.0-ONAP --single-branch http://gerrit.onap.org/r/dmaap/messagerouter/messageservice.git /tmp/gerrit;          echo "Clone complete. Copying from /tmp/gerrit/oom-projects/data-zookeeper/* to /tmp/topics";          cp -var /tmp/gerrit/oom-topics/data-zookeeper/* /tmp/topics;          echo "Done.";          fi        image: "registry.hub.docker.com/oomk8s/ubuntu-init:2.0.0"        imagePullPolicy: IfNotPresent        volumeMounts:        - mountPath: /tmp/topics          name: zookeeper-data      containers:      - name: message-router-zookeeper        image: "docker.io/wurstmeister/zookeeper:latest"        imagePullPolicy:  IfNotPresent        ports:        - containerPort: 2181                livenessProbe:          tcpSocket:            port: 2181          initialDelaySeconds: 10          periodSeconds: 10                readinessProbe:          tcpSocket:            port: 2181          initialDelaySeconds: 10          periodSeconds: 10        volumeMounts:        - mountPath: /etc/localtime          name: localtime          readOnly: true        - mountPath: /opt/zookeeper-3.4.9/data          name: zookeeper-data      volumes:      - name: localtime        hostPath:          path: /etc/localtime      - name: zookeeper-data        persistentVolumeClaim:          claimName: dev-message-router-zookeeper      imagePullSecrets:      - name: "onap-docker-registry-key"

三、启动docker脚本

docker run -d -p 2181:2181 --name message-router-zookeeper docker.io/wurstmeister/zookeeper:latestdocker run -d -p 9092:9092 --name message-router-kafka -e KAFKA_ZOOKEEPER_CONNECT=172.17.0.25:2181 -e KAFKA_ADVERTISED_HOST_NAME=message-router-kafka -e KAFKA_BROKER_ID=0 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://10.109.30.170:9092 -e KAFKA_ADVERTISED_PORT=9092 -e KAFKA_PORT=9092  docker.io/wurstmeister/kafka:1.1.0

 

转载于:https://www.cnblogs.com/erdanyang/p/11378530.html

你可能感兴趣的文章
struts.convention.classes.reload配置为true,tomcat启动报错
查看>>
MySQL的并行复制多线程复制MTS(Multi-Threaded Slaves)
查看>>
好玩的-记最近玩的几个经典ipad ios游戏
查看>>
MySQL更改默认的数据文档存储目录
查看>>
PyQt5--EventSender
查看>>
Sql Server 中由数字转换为指定长度的字符串
查看>>
Java 多态 虚方法
查看>>
Unity之fragment shader中如何获得视口空间中的坐标
查看>>
万能的SQLHelper帮助类
查看>>
uboot分析:uboot的启动过程分析
查看>>
tmux的简单快捷键
查看>>
[Swift]LeetCode922.按奇偶排序数组 II | Sort Array By Parity II
查看>>
Html5 离线页面缓存
查看>>
《绿色·精简·性感·迷你版》易语言,小到不可想象
查看>>
开始Flask项目
查看>>
Ruby:多线程队列(Queue)下载博客文章到本地
查看>>
Android打包key密码丢失找回
查看>>
VC6.0调试技巧(一)(转)
查看>>
类库与框架,强类型与弱类型的闲聊
查看>>
webView添加头视图
查看>>