mirror of
https://github.com/kremalicious/umami.git
synced 2025-01-21 02:10:07 +01:00
add properties to kafka client
This commit is contained in:
parent
508e23c52e
commit
0beedb0e1c
@ -1,27 +1,84 @@
|
||||
---
|
||||
version: '3'
|
||||
version: "3"
|
||||
services:
|
||||
zookeeper:
|
||||
image: confluentinc/cp-zookeeper:7.0.1
|
||||
container_name: zookeeper
|
||||
environment:
|
||||
ZOOKEEPER_CLIENT_PORT: 2181
|
||||
ZOOKEEPER_TICK_TIME: 2000
|
||||
|
||||
broker:
|
||||
image: confluentinc/cp-kafka:7.0.1
|
||||
container_name: broker
|
||||
image: 'bitnami/zookeeper:latest'
|
||||
ports:
|
||||
# To learn about configuring Kafka for access across networks see
|
||||
# https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/
|
||||
- "9092:9092"
|
||||
- '2181:2181'
|
||||
environment:
|
||||
- ALLOW_ANONYMOUS_LOGIN=yes
|
||||
|
||||
kafka1:
|
||||
image: 'bitnami/kafka:latest'
|
||||
container_name: kafka1
|
||||
ports:
|
||||
- '9092:9092'
|
||||
- '19092:19092'
|
||||
environment:
|
||||
- KAFKA_BROKER_ID=1
|
||||
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||
- ALLOW_PLAINTEXT_LISTENER=yes
|
||||
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
|
||||
- KAFKA_CFG_LISTENERS=CLIENT://:19092,EXTERNAL://0.0.0.0:9092
|
||||
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka1:19092,EXTERNAL://dev-01.umami.dev:9092
|
||||
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
|
||||
depends_on:
|
||||
- zookeeper
|
||||
|
||||
kafka2:
|
||||
image: 'bitnami/kafka:latest'
|
||||
container_name: kafka2
|
||||
ports:
|
||||
- '9093:9093'
|
||||
- '19093:19093'
|
||||
environment:
|
||||
KAFKA_BROKER_ID: 1
|
||||
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
|
||||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
|
||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://broker:29092
|
||||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
||||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
|
||||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
|
||||
- KAFKA_BROKER_ID=2
|
||||
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||
- ALLOW_PLAINTEXT_LISTENER=yes
|
||||
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
|
||||
- KAFKA_CFG_LISTENERS=CLIENT://:19093,EXTERNAL://0.0.0.0:9093
|
||||
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka2:19093,EXTERNAL://dev-01.umami.dev:9093
|
||||
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
|
||||
depends_on:
|
||||
- zookeeper
|
||||
|
||||
kafka3:
|
||||
image: 'bitnami/kafka:latest'
|
||||
container_name: kafka3
|
||||
ports:
|
||||
- '9094:9094'
|
||||
- '19094:19094'
|
||||
environment:
|
||||
- KAFKA_BROKER_ID=3
|
||||
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||
- ALLOW_PLAINTEXT_LISTENER=yes
|
||||
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
|
||||
- KAFKA_CFG_LISTENERS=CLIENT://:19094,EXTERNAL://0.0.0.0:9094
|
||||
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka3:19094,EXTERNAL://dev-01.umami.dev:9094
|
||||
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
|
||||
depends_on:
|
||||
- zookeeper
|
||||
|
||||
|
||||
# version: "3"
|
||||
# services:
|
||||
# zookeeper:
|
||||
# image: 'bitnami/zookeeper:latest'
|
||||
# ports:
|
||||
# - '2181:2181'
|
||||
# environment:
|
||||
# - ALLOW_ANONYMOUS_LOGIN=yes
|
||||
# kafka:
|
||||
# image: 'bitnami/kafka:latest'
|
||||
# ports:
|
||||
# - '9092:9092'
|
||||
# - '9093:9093'
|
||||
# environment:
|
||||
# - KAFKA_BROKER_ID=1
|
||||
# - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||
# - ALLOW_PLAINTEXT_LISTENER=yes
|
||||
# - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
|
||||
# - KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://0.0.0.0:9093
|
||||
# - KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://dev-01.umami.dev:9093
|
||||
# - KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
|
||||
# depends_on:
|
||||
# - zookeeper
|
@ -13,11 +13,13 @@ export function getKafkaClient() {
|
||||
return new Kafka({
|
||||
clientId: 'umami',
|
||||
brokers: brokers,
|
||||
connectionTimeout: 3000,
|
||||
});
|
||||
} else {
|
||||
return new Kafka({
|
||||
clientId: 'umami',
|
||||
brokers: brokers,
|
||||
connectionTimeout: 3000,
|
||||
ssl: true,
|
||||
sasl: {
|
||||
mechanism: 'plain',
|
||||
|
Loading…
Reference in New Issue
Block a user