首页 > 其他分享 >docker-compose部署kafka和kafka-eagle

docker-compose部署kafka和kafka-eagle

时间:2023-05-11 14:45:38浏览次数:33  
标签:eagle kafka ssl ###################################### sasl docker cluster1

docker-compose部署kafka和kafka-eagle

创建自定义docker网络

docker network create kafkanetwork

创建目录

mkdir -pv /data/kafka/mysql/{data/logs}

cd  /data/kafka

编写docker-compose

[root@centos kafka]# vim docker-compose.yml 
version: '2'
services:
  zookeeper:
    image:  zookeeper:3.8.1
    container_name: zookeeper
    restart: always
    environment:
      - ZOOKEEPER_CLIENT_PORT=2181
       # 必须开启 允许匿名登录
      - ALLOW_ANONYMOUS_LOGIN=yes
      - /etc/localtime:/etc/localtime
      - TZ=Asia/Shanghai
    ports:
      - 2181:2181
    networks: 
      - kafkanetwork

  kafka:
    image:  bitnami/kafka:3.2.3
    container_name: kafka
    restart: always
    environment:
      - KAFKA_BROKER_ID=1
       # 内部访问
      - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092
       # 外部访问 由于有端口冲突 指定为190092
      - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://192.168.0.118:19092
      - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
      - ALLOW_PLAINTEXT_LISTENER=yes
       # 是否启用kafka Raft 模式 默认是yes 要给关闭
      - KAFKA_ENABLE_KRAFT=no
      - JMX_PORT=9999
      - /etc/localtime:/etc/localtime
      - TZ=Asia/Shanghai
    ports:
      - 19092:9092
      - 9999:9999
    depends_on:
      - zookeeper
    networks: 
      - kafkanetwork


  mysql-kafka:
    image: mysql:5.7
    container_name: mysql-kafka
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=123456
      - MYSQL_DATABASE=ke
      - TZ=Asia/Shanghai
      - /etc/localtime:/etc/localtime
    volumes:
      - /data/kafka/mysql/data:/var/lib/mysql
      - /data/kafka/mysql/logs:/var/log/mysql
    networks:
      - kafkanetwork
    ports:
      - 13306:3306

  eagle:
    image:  rottenleaf/kafka-eagle:2.0.3
    container_name: eagle
    volumes: 
      - /data/kafka/system-config.properties:/kafka-eagle/conf/system-config.properties
    environment: 
      - EFAK_CLUSTER_ZK_LIST=zookeeper:2181
       # 所有的做时间同步宿主机 要不然会有时间问题 
      - /etc/localtime:/etc/localtime
      - TZ=Asia/Shanghai
    depends_on:
      - kafka
    ports:
      - 8048:8048
    networks:
      - kafkanetwork


networks:
  kafkanetwork:
    driver: bridge

kafka-eagle配置文件

[root@centos kafka]# vim  system-config.properties 
# 指定zookeeper
######################################
# multi zookeeper & kafka cluster list
######################################
kafka.eagle.zk.cluster.alias=cluster1
cluster1.zk.list=zookeeper:2181

######################################
# zookeeper enable acl
######################################
cluster1.zk.acl.enable=false
cluster1.zk.acl.schema=digest
cluster1.zk.acl.username=test
cluster1.zk.acl.password=test123

######################################
# broker size online list
######################################
cluster1.kafka.eagle.broker.size=10

######################################
# zk client thread limit
######################################
kafka.zk.limit.size=25

######################################
# kafka eagle webui port
######################################
kafka.eagle.webui.port=8048

######################################
# kafka jmx acl and ssl authenticate
######################################
cluster1.kafka.eagle.jmx.acl=false
cluster1.kafka.eagle.jmx.user=keadmin
cluster1.kafka.eagle.jmx.password=keadmin123
cluster1.kafka.eagle.jmx.ssl=false
cluster1.kafka.eagle.jmx.truststore.location=/Users/dengjie/workspace/ssl/certificates/kafka.truststore
cluster1.kafka.eagle.jmx.truststore.password=ke123456

######################################
# kafka offset storage
######################################
cluster1.kafka.eagle.offset.storage=kafka
cluster2.kafka.eagle.offset.storage=zookeeper

######################################
# kafka metrics, 15 days by default
######################################
kafka.eagle.metrics.charts=true
kafka.eagle.metrics.retain=15

######################################
# kafka sql topic records max
######################################
kafka.eagle.sql.topic.records.max=5000

######################################
# delete kafka topic token
######################################
kafka.eagle.topic.token=keadmin

######################################
# kafka sasl authenticate
######################################
cluster1.kafka.eagle.sasl.enable=false
cluster1.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
cluster1.kafka.eagle.sasl.mechanism=SCRAM-SHA-256
cluster1.kafka.eagle.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="kafka" password="kafka-eagle";
cluster1.kafka.eagle.sasl.client.id=
cluster1.kafka.eagle.blacklist.topics=
cluster1.kafka.eagle.sasl.cgroup.enable=false
cluster1.kafka.eagle.sasl.cgroup.topics=
cluster2.kafka.eagle.sasl.enable=false
cluster2.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
cluster2.kafka.eagle.sasl.mechanism=PLAIN
cluster2.kafka.eagle.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="kafka" password="kafka-eagle";
cluster2.kafka.eagle.sasl.client.id=
cluster2.kafka.eagle.blacklist.topics=
cluster2.kafka.eagle.sasl.cgroup.enable=false
cluster2.kafka.eagle.sasl.cgroup.topics=

######################################
# kafka ssl authenticate
######################################
cluster3.kafka.eagle.ssl.enable=false
cluster3.kafka.eagle.ssl.protocol=SSL
cluster3.kafka.eagle.ssl.truststore.location=
cluster3.kafka.eagle.ssl.truststore.password=
cluster3.kafka.eagle.ssl.keystore.location=
cluster3.kafka.eagle.ssl.keystore.password=
cluster3.kafka.eagle.ssl.key.password=
cluster3.kafka.eagle.blacklist.topics=
cluster3.kafka.eagle.ssl.cgroup.enable=false
cluster3.kafka.eagle.ssl.cgroup.topics=

# eagle 默认使用hadoop 存储信息
######################################
# kafka sqlite jdbc driver address
######################################
#kafka.eagle.driver=org.sqlite.JDBC
#kafka.eagle.url=jdbc:sqlite:/hadoop/kafka-eagle/db/ke.db
#kafka.eagle.username=root
#kafka.eagle.password=www.kafka-eagle.org

# 我们使用MySQL 进行数据存储 
######################################
# kafka mysql jdbc driver address
######################################
kafka.eagle.driver=com.mysql.jdbc.Driver
kafka.eagle.url=jdbc:mysql://192.168.0.118:13306/ke?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
kafka.eagle.username=root
kafka.eagle.password=123456

标签:eagle,kafka,ssl,######################################,sasl,docker,cluster1
From: https://www.cnblogs.com/scfssq/p/17390955.html

相关文章

  • Docker 镜像详细讲解
    Docker镜像详细讲解微枫Micromaple 运维网工 2023-03-0509:00 发表于重庆收录于合集#docker4个#docker镜像1个来自:CSDN,作者:微枫Micromaple链接:https://micromaple.blog.csdn.net/article/details/125727576前言大家好,本文是对Docker镜像的详细讲解,讲解......
  • windows docker 存储迁移
    通常在安装的windowsdocker,默认在C:\ProgramFiles\Docker,,镜像增多之后,会发现磁盘不够,别担心,下面来个无脑迁移操作。1:停止Docker服务。你可以在命令提示符(cmd)中输入以下命令  netstopcom.docker.service 2:移动C:\ProgramData\Docker到新的位置。例如,如果你想把......
  • Github 自动部署(docker)
    githubaction自动化部署(docker)上一篇博客pm2方式自动部署方式类型一个利用pm2方式本文利用docker方式配置文件name:github-action-demo#工作流名称on:push:branches:-develop#生效分支jobs:first-github-job:#任务名称自定义runs-on:......
  • Docker compose单机编排工具
    Dockercompose单机编排工具目录Dockercompose单机编排工具docker-compose介绍DockerCompose使用的三步:docker-compose安装部署Docker-compose语法YAML语法自动编排zabbix注意事项:官方版MySQLcompose官方escomposedocker-compose常用命令docker-compose介绍Compose是用于定......
  • docker overlay2 占用大量磁盘空间
    dockeroverlay2占用大量磁盘空间#进入实际的dockeroverlay2目录#以下是举例:查询到builder-mw容器中,日志量异常(根据实际的服务器查询到目录为准)[root@pdsweb~]#cd/home/docker/overlay2/[root@pdsweboverlay2]#du-h--max-depth=1|grep[GT]5.4G ./7908539d4......
  • Docker CLI docker compose run常用命令
    Docker是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的镜像中,然后发布到任何流行的Linux或Windows操作系统的机器上,也可以实现虚拟化。Docker是内核虚拟化,不使用Hypervisor是不完全虚拟化,依赖内核的特性实现资源隔离。本文主要介绍DockerCLI中d......
  • 消息推送平台的实时数仓?!flink消费kafka消息入到hive
    大家好,3y啊。好些天没更新了,并没有偷懒,只不过一直在安装环境,差点都想放弃了。上一次比较大的更新是做了austin的预览地址,把企业微信的应用和机器人消息各种的消息类型和功能给完善了。上一篇文章也提到了,austin常规的功能已经更新得差不多了,剩下的就是各种细节的完善。不知道大......
  • Docker 国内镜像加速
    1.摘要国内从DockerHub拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker官方和国内很多云服务商都提供了国内加速器服务,建议根据运行docker的云平台选择对应的镜像加速服务。下面列出国内常用的加速站点,排名不分先后,总体来说阿里云速度较稳定。docker中国区官方镜像加......
  • docker修改镜像源
    docker修改镜像源我们在Linux系统上装docker后,下载我们所需要的镜像去创建容器时,由于docker的默认是从国外的仓库里边去下载我们所需要的镜像的,从而会导致dockerpull下拉速度比较慢将docker镜像源修改为国内的编辑配置文件在/etc/docker/daemon.json文件中添加以下参数,......
  • 使用docker搭建nodebb论坛
    1、首先放开4567端口因为这是nodebb的端口号firewall-cmd--zone=public--add-port=4567/tcp--permanent2、构建所需要的docker网络dockernetworkcreatemongo-net3、安装mongodockerrun--namemongo--restartalways--networkmongo-net-dmongo--wiredTigerCacheSizeGB......