reduce the offsets topic partitions
[dmaap/messagerouter/messageservice.git] / src / main / resources / docker-compose / docker-compose.yml
index a7db004..9878c3c 100644 (file)
@@ -1,46 +1,73 @@
 version: '2'
 services:
   zookeeper:
-    image: wurstmeister/zookeeper
+    image: nexus3.onap.org:10001/onap/dmaap/zookeeper:6.0.3
     ports:
       - "2181:2181"
-    volumes:
-      - ./data-zookeeper:/opt/zookeeper-3.4.9/data
-    logging:
-      driver: "json-file"
-      options:
-       max-size: "30m"
-       max-file: "5"
-  kafka:
-    build: .
-    ports:
-      - "9092:9092"
     environment:
-      KAFKA_ADVERTISED_HOST_NAME: 172.18.0.1
-      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+     ZOOKEEPER_REPLICAS: 1
+     ZOOKEEPER_TICK_TIME: 2000
+     ZOOKEEPER_SYNC_LIMIT: 5
+     ZOOKEEPER_INIT_LIMIT: 10
+     ZOOKEEPER_MAX_CLIENT_CNXNS: 200
+     ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3
+     ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24
+     ZOOKEEPER_CLIENT_PORT: 2181
+     KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl
+     ZOOKEEPER_SERVER_ID: 1
     volumes:
-      - /var/run/docker.sock:/var/run/docker.sock
-      - ./data-kafka:/kafka
-    logging:
-      driver: "json-file"
-      options:
-       max-size: "30m"
-       max-file: "5"
-    depends_on:
-      - zookeeper
-      
+      -  ./zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf
+    networks:
+      net:
+        aliases:
+        - zookeeper
+
+  kafka:
+   image: nexus3.onap.org:10001/onap/dmaap/kafka111:1.0.4
+   ports:
+    - "9092:9092"
+   environment:
+    enableCadi: 'false'
+    KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+    KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000
+    KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000
+    KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT
+    KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://kafka:9092
+    KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092
+    KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT
+    KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false'
+    KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf
+    KAFKA_ZOOKEEPER_SET_ACL: 'true'
+    KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+    # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment
+    KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 10
+   volumes:
+     -  ./kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf
+   networks:
+     net:
+       aliases:
+       - kafka
+   depends_on:
+    - zookeeper
+
   dmaap:
-    image: nexus3.onap.org:10001/onap/dmaap/dmaap-mr
+    image: nexus3.onap.org:10001/onap/dmaap/dmaap-mr:1.1.18
     ports:
       - "3904:3904"
       - "3905:3905"
+    environment:
+     enableCadi: 'false'
     volumes:
-      - /var/tmp/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties  
+      - ./mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
+      - ./mr/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml
+      - ./mr/cadi.properties:/appl/dmaapMR1/etc/cadi.properties
+    networks:
+      net:
+        aliases:
+        - dmaap
     depends_on:
       - zookeeper
       - kafka
-    logging:
-      driver: "json-file"
-      options:
-       max-size: "30m"
-       max-file: "5"    
+networks:
+  net:
+    driver: bridge