Closed yuanjinzhong closed 2 years ago
docker 安装
Mac 版 docker 默认无法访问外部网络,详情见 docker 官方文档 https://docs.docker.com/desktop/mac/networking/
Mac 版 docker 默认无法访问外部网络
但是我那三个kfaka地址是可以访问的
Mac 版 docker 默认无法访问外部网络
但是我那三个kfaka地址是可以访问的
你在容器里面就访问不到了
Mac 版 docker 默认无法访问外部网络
但是我那三个kfaka地址是可以访问的
你在容器里面就访问不到了
需要我咋设置呢?docker 这块不是很熟悉
Mac 版 docker 默认无法访问外部网络
但是我那三个kfaka地址是可以访问的
你在容器里面就访问不到了
需要我咋设置呢?docker 这块不是很熟悉
换台 Linux 机器安装吧
可以把kafak-map 和kafka集群 以及zookeeper 写在同一个docker-compose里面吗?这样是不是可以解决网络问题
可以把kafak-map 和kafka集群 以及zookeeper 写在同一个docker-compose里面吗?这样是不是可以解决网络问题
我觉得应该没有人会把 Mac 当作服务器来使用,因此我只提供了一个简单的安装方式。
version: '2.1'
services: zoo1: image: zookeeper:3.4.9 hostname: zoo1 restart: always container_name: zoo1 ports:
./zk-single-kafka-multiple/zoo1/datalog:/datalog
kafka1: image: confluentinc/cp-kafka:5.4.0 hostname: kafka1 restart: always container_name: kafka1 ports:
zoo1
kafka2: image: confluentinc/cp-kafka:5.4.0 hostname: kafka2 restart: always container_name: kafka2 ports:
zoo1
kafka3: image: confluentinc/cp-kafka:5.4.0 hostname: kafka3 restart: always container_name: kafka3 ports:
zoo1
kafka-manager:
image: sheepkiller/kafka-manager:latest
restart: always
container_name: kafka-manager
hostname: kafka-manager
ports:
kafka3 environment: ZK_HOSTS: zoo1:2181 KAFKA_BROKERS: kafka1:9092,kafka2:9093,kafka3:9094
kafka-map: image: dushixiang/kafka-map:latest restart: always container_name: kafka-map hostname: kafka-map ports:
帮我瞧瞧这个docker-compose 写的有没有问题,是不是缺少什么网络配置。我这样docker-compose.yml up 起来之后,还是没法添加集群。kafka-map的控制台可以访问
我在m1的mac启动这个docker容器。kafka的控制台都无法打开。。
version: "3.9"
services:
zookeeper:
image: zookeeper
container_name: zookeeper
volumes:
- zookeeper:/data
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: bitnami/kafka
container_name: kafka
depends_on:
- zookeeper
links:
- zookeeper
volumes:
- kafka:/kafka
ports:
- "9092:9092"
environment:
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181/kafka"
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092"
KAFKA_BROKER_ID: 1
KAFKA_LISTENERS: "PLAINTEXT://0.0.0.0:9092"
kafka-map:
image: dushixiang/kafka-map:latest
container_name: kafka-map
ports:
- "8080:8080"
environment:
DEFAULT_USERNAME: admin
DEFAULT_PASSWORD: admin
volumes:
zookeeper:
kafka:
我这样能用了。。
version: "3.9" services: zookeeper: image: zookeeper container_name: zookeeper volumes: - zookeeper:/data ports: - "2181:2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 ZOOKEEPER_TICK_TIME: 2000 kafka: image: bitnami/kafka container_name: kafka depends_on: - zookeeper links: - zookeeper volumes: - kafka:/kafka ports: - "9092:9092" environment: ALLOW_PLAINTEXT_LISTENER: "yes" KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181/kafka" KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092" KAFKA_BROKER_ID: 1 KAFKA_LISTENERS: "PLAINTEXT://0.0.0.0:9092" kafka-map: image: dushixiang/kafka-map:latest container_name: kafka-map ports: - "8080:8080" environment: DEFAULT_USERNAME: admin DEFAULT_PASSWORD: admin volumes: zookeeper: kafka:
我这样能用了。。
你需要保证的是网络畅通,这点没办法帮助你的。
docker 安装