kafka-ui.yaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. ---
  2. version: '2'
  3. services:
  4. kafka-ui:
  5. container_name: kafka-ui
  6. image: provectuslabs/kafka-ui:latest
  7. ports:
  8. - 8080:8080
  9. depends_on:
  10. - zookeeper0
  11. - zookeeper1
  12. - kafka0
  13. - kafka1
  14. - schemaregistry0
  15. - kafka-connect0
  16. environment:
  17. KAFKA_CLUSTERS_0_NAME: local
  18. KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka0:29092
  19. KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper0:2181
  20. KAFKA_CLUSTERS_0_JMXPORT: 9997
  21. KAFKA_CLUSTERS_0_SCHEMAREGISTRY: http://schemaregistry0:8085
  22. KAFKA_CLUSTERS_0_KAFKACONNECT_0_NAME: first
  23. KAFKA_CLUSTERS_0_KAFKACONNECT_0_ADDRESS: http://kafka-connect0:8083
  24. KAFKA_CLUSTERS_1_NAME: secondLocal
  25. KAFKA_CLUSTERS_1_BOOTSTRAPSERVERS: kafka1:29092
  26. KAFKA_CLUSTERS_1_ZOOKEEPER: zookeeper1:2181
  27. KAFKA_CLUSTERS_1_JMXPORT: 9998
  28. KAFKA_CLUSTERS_1_SCHEMAREGISTRY: http://schemaregistry1:8085
  29. KAFKA_CLUSTERS_1_KAFKACONNECT_0_NAME: first
  30. KAFKA_CLUSTERS_1_KAFKACONNECT_0_ADDRESS: http://kafka-connect0:8083
  31. zookeeper0:
  32. image: confluentinc/cp-zookeeper:5.2.4
  33. environment:
  34. ZOOKEEPER_CLIENT_PORT: 2181
  35. ZOOKEEPER_TICK_TIME: 2000
  36. ports:
  37. - 2181:2181
  38. kafka0:
  39. image: confluentinc/cp-kafka:5.3.1
  40. depends_on:
  41. - zookeeper0
  42. ports:
  43. - 9092:9092
  44. - 9997:9997
  45. environment:
  46. KAFKA_BROKER_ID: 1
  47. KAFKA_ZOOKEEPER_CONNECT: zookeeper0:2181
  48. KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka0:29092,PLAINTEXT_HOST://localhost:9092
  49. KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
  50. KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
  51. KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
  52. JMX_PORT: 9997
  53. KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka0 -Dcom.sun.management.jmxremote.rmi.port=9997
  54. zookeeper1:
  55. image: confluentinc/cp-zookeeper:5.2.4
  56. environment:
  57. ZOOKEEPER_CLIENT_PORT: 2181
  58. ZOOKEEPER_TICK_TIME: 2000
  59. kafka1:
  60. image: confluentinc/cp-kafka:5.3.1
  61. depends_on:
  62. - zookeeper1
  63. ports:
  64. - 9093:9093
  65. - 9998:9998
  66. environment:
  67. KAFKA_BROKER_ID: 1
  68. KAFKA_ZOOKEEPER_CONNECT: zookeeper1:2181
  69. KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:29092,PLAINTEXT_HOST://localhost:9093
  70. KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
  71. KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
  72. KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
  73. JMX_PORT: 9998
  74. KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka1 -Dcom.sun.management.jmxremote.rmi.port=9998
  75. schemaregistry0:
  76. image: confluentinc/cp-schema-registry:5.5.0
  77. ports:
  78. - 8085:8085
  79. depends_on:
  80. - zookeeper0
  81. - kafka0
  82. environment:
  83. SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: PLAINTEXT://kafka0:29092
  84. SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper0:2181
  85. SCHEMA_REGISTRY_KAFKASTORE_SECURITY_PROTOCOL: PLAINTEXT
  86. SCHEMA_REGISTRY_HOST_NAME: schemaregistry0
  87. SCHEMA_REGISTRY_LISTENERS: http://schemaregistry0:8085
  88. SCHEMA_REGISTRY_SCHEMA_REGISTRY_INTER_INSTANCE_PROTOCOL: "http"
  89. SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL: INFO
  90. SCHEMA_REGISTRY_KAFKASTORE_TOPIC: _schemas
  91. schemaregistry1:
  92. image: confluentinc/cp-schema-registry:5.5.0
  93. ports:
  94. - 18085:8085
  95. depends_on:
  96. - zookeeper1
  97. - kafka1
  98. environment:
  99. SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: PLAINTEXT://kafka1:29092
  100. SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper1:2181
  101. SCHEMA_REGISTRY_KAFKASTORE_SECURITY_PROTOCOL: PLAINTEXT
  102. SCHEMA_REGISTRY_HOST_NAME: schemaregistry1
  103. SCHEMA_REGISTRY_LISTENERS: http://schemaregistry1:8085
  104. SCHEMA_REGISTRY_SCHEMA_REGISTRY_INTER_INSTANCE_PROTOCOL: "http"
  105. SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL: INFO
  106. SCHEMA_REGISTRY_KAFKASTORE_TOPIC: _schemas
  107. kafka-connect0:
  108. image: confluentinc/cp-kafka-connect:6.0.1
  109. ports:
  110. - 8083:8083
  111. depends_on:
  112. - kafka0
  113. - schemaregistry0
  114. environment:
  115. CONNECT_BOOTSTRAP_SERVERS: kafka0:29092
  116. CONNECT_GROUP_ID: compose-connect-group
  117. CONNECT_CONFIG_STORAGE_TOPIC: _connect_configs
  118. CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
  119. CONNECT_OFFSET_STORAGE_TOPIC: _connect_offset
  120. CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
  121. CONNECT_STATUS_STORAGE_TOPIC: _connect_status
  122. CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
  123. CONNECT_KEY_CONVERTER: org.apache.kafka.connect.storage.StringConverter
  124. CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schemaregistry0:8085
  125. CONNECT_VALUE_CONVERTER: org.apache.kafka.connect.storage.StringConverter
  126. CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schemaregistry0:8085
  127. CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
  128. CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
  129. CONNECT_REST_ADVERTISED_HOST_NAME: kafka-connect0
  130. CONNECT_PLUGIN_PATH: "/usr/share/java,/usr/share/confluent-hub-components"
  131. kafka-init-topics:
  132. image: confluentinc/cp-kafka:5.3.1
  133. volumes:
  134. - ./message.json:/data/message.json
  135. depends_on:
  136. - kafka1
  137. command: "bash -c 'echo Waiting for Kafka to be ready... && \
  138. cub kafka-ready -b kafka1:29092 1 30 && \
  139. kafka-topics --create --topic second.users --partitions 3 --replication-factor 1 --if-not-exists --zookeeper zookeeper1:2181 && \
  140. kafka-topics --create --topic second.messages --partitions 2 --replication-factor 1 --if-not-exists --zookeeper zookeeper1:2181 && \
  141. kafka-topics --create --topic first.messages --partitions 2 --replication-factor 1 --if-not-exists --zookeeper zookeeper0:2181 && \
  142. kafka-console-producer --broker-list kafka1:29092 -topic second.users < /data/message.json'"