1. Install a Kafka cluster. If you are using open source DC/OS, install a Kafka cluster with the following command from the DC/OS CLI. If you are using Enterprise DC/OS, you may need to follow additional instructions. See the Install and Customize section for more information.

    $ dcos package install kafka
    
  2. Create a new topic.

    $ $ dcos confluent-kafka topic create topic1
    
  3. Find Zookeeper and broker endpoint information.

    $ $ dcos confluent-kafka endpoints zookeeper
    master.mesos:2181/dcos-service-kafka
    
    $ $ dcos confluent-kafka endpoints broker
    {
        "address": [
            "10.0.3.226:1000",
            "10.0.3.98:1000",
            "10.0.0.120:1000"
        ],
        "dns": [
            "kafka-2-broker.kafka.autoip.dcos.thisdcos.directory:1000",
            "kafka-0-broker.kafka.autoip.dcos.thisdcos.directory:1000",
            "kafka-1-broker.kafka.autoip.dcos.thisdcos.directory:1000"
        ],
        "vip": "broker.kafka.l4lb.thisdcos.directory:9092"
    }
    
  4. Produce and consume data.

    $ dcos node ssh --master-proxy --leader
    
    [email protected] ~ $ docker run -it mesosphere/kafka-client
    
    [email protected]:/bin# echo "Hello, World." | ./kafka-console-producer.sh --broker-list kafka-0-broker.kafka.autoip.dcos.thisdcos.directory:1000, kafka-1-broker.kafka.autoip.dcos.thisdcos.directory:1000, kafka-2-broker.kafka.autoip.dcos.thisdcos.directory:1000 --topic topic1
    
    [email protected]:/bin# ./kafka-console-consumer.sh --zookeeper master.mesos:2181/dcos-service-kafka --topic topic1 --from-beginning
    Hello, World.
    

See also Connecting clients.