lensesio / kafka-topics-ui

Web Tool for Kafka Topics |
https://lenses.io
877 stars 148 forks source link

What version kafka-rest use? #91

Closed magvan closed 7 years ago

Antwnis commented 7 years ago

Up to CP 3.2.0 you will need kafka topics ui version 0.8.3 With newer version of Kafka-Rest use latest release / or build from source

magvan commented 7 years ago

Thank you. I use docker-compose, cp 3.2.0 and ui 0.9.2. It don't work. ((( cp 3.2.0 and ui 0.8.3, also don't work

` kafka-rest: image: confluentinc/cp-kafka-rest:3.2.0 depends_on:

05db279320

Antwnis commented 7 years ago

We have a docker image for 0.8.3

You can either

image: landoop/kafka-topics-ui:0.8.3

or use the latest & greatest by using the CP 3.3 version (cp-kafka-rest:3.3.0)

Or if you are into development maybe this image (that packages everything in a single docker) could be of help https://github.com/Landoop/fast-data-dev

magvan commented 7 years ago

I use confluentinc/cp-kafka-rest:3.3.0 and landoop/kafka-topics-ui:0.9.2, also get errors. Tell me, please. Can I use cp 3.3.0 and ui 0.9.2? c7e90d1381 1111111111111

Antwnis commented 7 years ago

You will have to configure Kafka-Rest a bit more

 environment:
      - ACCESS_CONTROL_ALLOW_ORIGIN_DEFAULT="*"
      - KAFKA_REST_SCHEMA_REGISTRY_URL=http://schema-registry:8081
      - KAFKA_REST_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_REST_HOST_NAME=kafka-rest
      - KAFKA_REST_LISTENERS=http://kafka-rest:8082
      - KAFKA_REST_CONSUMER_REQUEST_TIMEOUT_MS=30000
      - KAFKA_REST_BOOTSTRAP_SERVERS=PLAINTEXT://kafka:9092

Also have a quick look at https://github.com/Landoop/kafka-topics-ui/issues/72 for a similar discussion

andmarios commented 7 years ago

A small correction, kafka Topics UI up to 0.8.x works with REST Proxy up to 3.1.x. kafka Topics UI since 0.9.x needs REST Proxy 3.2.x or better.

From your browser logs (502 Bad Gateway), I get the idea that REST Proxy isn't working for some reason. I would use docker logs (eg docker logs kafka-rest) to check the issue.

I think if you follow @Antwnis advise it will work, mainly because of this option which seems mandatory for newer versions of REST Proxy:

KAFKA_REST_BOOTSTRAP_SERVERS=PLAINTEXT://kafka:9092

Also it could be good to set:

KAFKA_REST_LISTENERS=http://0.0.0.0:8082
drobati commented 7 years ago

Hey I saw that @magvan was using docker-compose. It's important to note that docker-compose spins up a different network.

docker-images (master) λ docker network ls
NETWORK ID          NAME                   DRIVER              SCOPE
e1b76c8f75e6        bridge                 bridge              local
b078dda31c27        dockerimages_default   bridge              local
9b9f1d9e7414        host                   host                local
1154c80836ef        none                   null                local

If I'm spinning up containers outside the docker-compose.yml file I always pass --network= dockerimages_default.

Maybe this is knowledge you know, but in my case I know it was causing connectivity issues.

andmarios commented 7 years ago

So did it solve your issue?

magvan commented 7 years ago

Thanks! It works.

  zookeeper:
    image: "confluentinc/cp-zookeeper"
    container_name: office_zookeeper
    ports:
      - "2181:2181"
    environment:
      - ZOOKEEPER_CLIENT_PORT=2181

  kafka:
    image: "confluentinc/cp-kafka"
    container_name: office_kafka
    ports:
      - "9092:9092"
    depends_on:
      - zookeeper
    environment:
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092

  kafka-rest:
    image: "confluentinc/cp-kafka-rest"
    container_name: office_kafka_rest
    ports:
      - "8082:8082"
    environment:
      - ACCESS_CONTROL_ALLOW_ORIGIN_DEFAULT="*"
      - KAFKA_REST_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_REST_LISTENERS=http://kafka-rest:8082
      - KAFKA_REST_HOST_NAME=kafka-rest
      - KAFKA_REST_CONSUMER_REQUEST_TIMEOUT_MS=30000
      - KAFKA_REST_BOOTSTRAP_SERVERS=PLAINTEXT://kafka:9092
    depends_on:
      - kafka
      - zookeeper

  kafka-topic-ui:
    image: "landoop/kafka-topics-ui"
    container_name: office_kafka_topics_ui
    ports:
      - "9991:8000"
    environment:
      - KAFKA_REST_PROXY_URL=http://kafka-rest:8082
      - SCHEMAREGISTRY_UI_URL=http://schema-registry:8081
      - PROXY=true
    depends_on:
      - kafka
      - zookeeper
      - kafka-rest

UI works. But, the console has errors.

console

Antwnis commented 7 years ago

In the docker compose, i don't see you running the SCHEMA REGISTRY docker

Thus the _schemas topic will not be created, and you won't have AVRO support

The kafka-topics-ui does an attempt to read _schemas in order to figure out which topic / if any contains Avro messages (that's why you see those console errors)

Either run the schema-registry service, or (ignore) those errors :-)

Antwnis commented 7 years ago

Closing this issue @magvan - feel free to re-open Ivan