mailgun / kafka-pixy

gRPC/REST proxy for Kafka
Apache License 2.0
773 stars 118 forks source link

kafkaPeers, zookeeperPeers - can't set multiple comma separated peers #191

Closed dimaches closed 3 years ago

dimaches commented 3 years ago

Trying to run kafka-pixy in docker using docker-compose.yaml

Can set only one peer for kafkaPeers & zookeeperPeers.

If I set multiple peers (comma separated - all possible ways) - I got errors:

Failed to connect to broker kafka3.test.local:19093,kafka2.test.local:19092: dial tcp: address kafka3.test.local:19093,kafka2.test.local:19092: too many colons in address" category=sarama

Z error "Failed to start service: err=(failed to spawn proxy, name=default: failed to spawn consumer: failed to create kazoo.Kazoo: address kafka1.test.local:2181,kafka2.test.local:2181: too many colons in address)"

Config kafka-pixy.yaml example:

# Kafka parameters section.
    kafka:

      # List of seed Kafka peers that Kafka-Pixy should access to resolve the
      # Kafka cluster topology.
      seed_peers:
        #- localhost:9092
        - kafka3.test.local:19093,kafka2.test.local:19092

    # ZooKeeper parameters section.
    zoo_keeper:

      # List of seed ZooKeeper peers that Kafka-Pixy should access to resolve the
      # ZooKeeper cluster topology.
      seed_peers:
        #- localhost:2181
        - kafka3.test.local:2181,kafka2.test.local:2181
horkhe commented 3 years ago

The config is in YAML format, to specify multiple seed nodes you should list them as YAML list:

    # Kafka parameters section.
    kafka:

      # List of seed Kafka peers that Kafka-Pixy should access to resolve the
      # Kafka cluster topology.
      seed_peers:
        - kafka3.test.local:19093
        - kafka2.test.local:19092

    # ZooKeeper parameters section.
    zoo_keeper:

      # List of seed ZooKeeper peers that Kafka-Pixy should access to resolve the
      # ZooKeeper cluster topology.
      seed_peers:
        - kafka3.test.local:2181
        - kafka2.test.local:2181