Skip to content

Commit

Permalink
Kafka cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanow committed Dec 3, 2024
1 parent 66a6cec commit e68a29d
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 10 deletions.
1 change: 0 additions & 1 deletion elastic/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
services:
elastic:
image: elasticsearch:8.12.2
Expand Down
1 change: 0 additions & 1 deletion java/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
services:
echo-server:
image: romanowalex/echo-server:v2.0
Expand Down
1 change: 1 addition & 0 deletions kafka/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Kafka and Zookeeper

* [Single Node](docker-compose.yml)
* [Cluster](docker-compose.cluster.yml)
78 changes: 78 additions & 0 deletions kafka/docker-compose.cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.7.1
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
healthcheck:
test: [ "CMD-SHELL", "nc -z localhost 2181 || exit -1" ]
interval: 10s
timeout: 5s
retries: 10
ports:
- "2181:2181"

kafka-1:
image: confluentinc/cp-kafka:7.7.1
container_name: kafka-1
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-1:29092,EXTERNAL://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
healthcheck:
test: [ "CMD-SHELL", "kafka-topics --bootstrap-server localhost:9092 --list" ]
interval: 10s
timeout: 5s
retries: 10
depends_on:
zookeeper:
condition: service_healthy

kafka-2:
image: confluentinc/cp-kafka:7.7.1
container_name: kafka-2
ports:
- "9093:9093"
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-2:29093,EXTERNAL://localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
healthcheck:
test: [ "CMD-SHELL", "kafka-topics --bootstrap-server localhost:9093 --list" ]
interval: 10s
timeout: 5s
retries: 10
depends_on:
zookeeper:
condition: service_healthy

console:
image: docker.redpanda.com/redpandadata/console:latest
container_name: console
environment:
KAFKA_BROKERS: "kafka-1:29092,kafka-2:29093"
ports:
- "8081:8080"
healthcheck:
test: [ "CMD-SHELL", "curl --fail http://localhost:8080 || exit 1" ]
interval: 5s
timeout: 5s
retries: 5
depends_on:
kafka-1:
condition: service_healthy
kafka-2:
condition: service_healthy
1 change: 0 additions & 1 deletion kafka/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.7.1
Expand Down
1 change: 0 additions & 1 deletion logging/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
services:
fluent-bit:
image: fluent/fluent-bit:3.1.7-debug
Expand Down
2 changes: 1 addition & 1 deletion minio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ $ mc alias set local http://localhost:9000 program qwerty123
$ mc mb local/my-bucket
$ mc mv data.txt local/my-bucket/

```
```
4 changes: 1 addition & 3 deletions minio/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

x-minio-common: &minio-common
image:
minio/minio:latest
Expand Down Expand Up @@ -50,4 +48,4 @@ services:

volumes:
data1:
data2:
data2:
2 changes: 1 addition & 1 deletion minio/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ http {
proxy_pass http://console;
}
}
}
}
1 change: 0 additions & 1 deletion postgres/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
services:
postgres:
build: .
Expand Down

0 comments on commit e68a29d

Please sign in to comment.