|NO.Z.00274|——————————|^^ 部署 ^^|——|KuberNetes&中间件容器化及helm.V21|——|中间件.v01|helm.v3.5.4|直接部署|zookeeper&kafka|
一、部署zookeeper和kafka集群概述

### --- zookeeper和kafka的官方地址
~~~ https://docs.bitnami.com/tutorials/deploy-scalable-kafka-zookeeper-cluster-kubernetes
~~~ 使用的是bitnami开源项目来做的
~~~ bitnami提供了一些比较复杂的项目,一键式安装这些复杂工具
二、使用helm部署zookeeper和kafka;直接部署
### --- 添加bitnami的helm仓库并添加版本库
~~~ 添加bitnami的helm仓库
[root@k8s-master01 zookeeper-kafka]# helm repo add bitnami https://charts.bitnami.com/bitnami
### --- 查看添加的仓库
[root@k8s-master01 zookeeper-kafka]# helm repo list
NAME URL
bitnami https://charts.bitnami.com/bitnami
### --- 查看bitnami仓库下zookeeper和kafka的程序包
~~~ 注:可以直接安装,也可以下载后更改values值后安装
[root@k8s-master01 zookeeper-kafka]# helm search repo zookeeper
NAME CHART VERSION APP VERSION DESCRIPTION
bitnami/zookeeper 6.7.2 3.7.0 A centralized service for maintaining configura...
bitnami/kafka 12.18.1 2.8.0 Apache Kafka is a distributed streaming platform.
### --- 使用helm直接安装zookeeper和kafka
### --- 直接安装
~~~ 注:可以指定namespace
~~~ 注:若是生产环境下:集群副本数更改为3,打开metrics,可以让promise可以采集它的一些信息
[root@k8s-master01 zookeeper-kafka]# helm install zookeeper bitnami/zookeeper --set replicaCount=1 --set auth.enabled=false --set allowAnonymousLogin=true
[root@k8s-master01 zookeeper-kafka]# helm install zookeeper bitnami/kafka --set replicaCount=1 --set auth.enabled=false --set allowAnonymousLogin=true
~~~ 注:
--set replicaCount=3 // 副本数设置为1
--set auth.enabled=false // 认证方式关闭;因为zookeeper集群不会暴露到公网,所以认证方式给关闭
--set allowAnonymousLogin=true // 允许匿名访问
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
——W.S.Landor
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了