github.com/leonlxy/hyperledger@v1.0.0-alpha.0.20170427033203-34922035d248/bddtests/environments/kafka/README.md (about)

     1  # Apache Kafka Docker Image
     2  This image can be used to start Apache Kafka in a Docker container.
     3  
     4  Use the provided [`docker-compose.yml`](docker-compose.yml) file as a starting point.
     5  
     6  ## Usage
     7  #### Start
     8  ```console
     9  $ docker-compose up -d
    10  Creating kafka_zookeeper_1
    11  Creating kafka_kafka_1
    12  $
    13  ```
    14  #### Scale
    15  ```console
    16  $ docker-compose scale kafka=3
    17  Creating and starting kafka_kafka_2 ... done
    18  Creating and starting kafka_kafka_3 ... done
    19  $
    20  ```
    21  #### Stop
    22  ```console
    23  $ docker-compose stop
    24  Stopping kafka_kafka_3 ... done
    25  Stopping kafka_kafka_2 ... done
    26  Stopping kafka_kafka_1 ... done
    27  Stopping kafka_zookeeper_1 ... done
    28  $
    29  ```
    30  #### Cleanup
    31  Use `docker-compose down` instead of `docker-compose rm` when cleaning up, so that the network is purged in addition to the containers.
    32  ```console
    33  $ docker-compose down
    34  Stopping kafka_kafka_3 ... done
    35  Stopping kafka_kafka_2 ... done
    36  Stopping kafka_kafka_1 ... done
    37  Stopping kafka_zookeeper_1 ... done
    38  Removing kafka_kafka_3 ... done
    39  Removing kafka_kafka_2 ... done
    40  Removing kafka_kafka_1 ... done
    41  Removing kafka_zookeeper_1 ... done
    42  Removing network kafka_default
    43  $
    44  ```
    45  ## Configuration
    46  Edit the [`docker-compose.yml`](docker-compose.yml) file to configure.
    47  ### server.properties
    48  To configure a Kafka server property, add it to the environment section of the Kafka service. Kafka properties map to environment variables as follows:
    49  1. Replace dots with underscores.
    50  2. Change to upper case.
    51  3. Prefix with `KAFKA_`
    52  
    53  For example, `default.replication.factor` becomes `KAFKA_DEFAULT_REPLICATION_FACTOR`.