kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jagannath Bilgi <jsbi...@yahoo.com.INVALID>
Subject Fw: Kafka-Connect - Error while creating kafka JDBC Connector with avro data
Date Mon, 30 Apr 2018 22:21:25 GMT
Hi,
I am new to Kafka and Kafka-connect world. Getting connection refused error while creating
Kafka-JDBC connector. Below are the steps followed from Kafka Connect Tutorial — Confluent
Platformdocker run -d \
    --net=host \    --name=zookeeper \    -e ZOOKEEPER_CLIENT_PORT=32181 \    -e ZOOKEEPER_TICK_TIME=2000
\    confluentinc/cp-zookeeper:latest
docker run -d \    --net=host \    --name=kafka \    -e KAFKA_ZOOKEEPER_CONNECT=localhost:32181
\    -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:29092 \    -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
\    confluentinc/cp-kafka:latest
docker run -d \  --net=host \  --name=schema-registry \  -e SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL=localhost:32181
\  -e SCHEMA_REGISTRY_HOST_NAME=localhost \  -e SCHEMA_REGISTRY_LISTENERS=http://localhost:8081
\  confluentinc/cp-schema-registry:latest

docker run -d \  --name=kafka-connect-avro \  --net=host \  -e CONNECT_BOOTSTRAP_SERVERS=localhost:29092
\  -e CONNECT_REST_PORT=28083 \  -e CONNECT_GROUP_ID="quickstart-avro" \  -e CONNECT_CONFIG_STORAGE_TOPIC="quickstart-avro-config"
\  -e CONNECT_OFFSET_STORAGE_TOPIC="quickstart-avro-offsets" \  -e CONNECT_STATUS_STORAGE_TOPIC="quickstart-avro-status"
\  -e CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR=1 \  -e CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR=1
\  -e CONNECT_STATUS_STORAGE_REPLICATION_FACTOR=1 \  -e CONNECT_KEY_CONVERTER="io.confluent.connect.avro.AvroConverter"
\  -e CONNECT_VALUE_CONVERTER="io.confluent.connect.avro.AvroConverter" \  -e CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL="http://localhost:8081"
\  -e CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL="http://localhost:8081" \  -e CONNECT_INTERNAL_KEY_CONVERTER="org.apache.kafka.connect.json.JsonConverter"
\  -e CONNECT_INTERNAL_VALUE_CONVERTER="org.apache.kafka.connect.json.JsonConverter" \ 
-e CONNECT_REST_ADVERTISED_HOST_NAME="localhost" \  -e CONNECT_LOG4J_ROOT_LOGLEVEL=DEBUG
\  -e CONNECT_LOG4J_LOGGERS=org.reflections=ERROR \  -e CONNECT_PLUGIN_PATH=/usr/share/java,/etc/kafka-connect/jars
\  -v /tmp/quickstart/file:/tmp/quickstart \  -v /tmp/quickstart/jars:/etc/kafka-connect/jars
\  confluentinc/cp-kafka-connect:latest
docker exec kafka-connect-avro mkdir -p /tmp/quickstart/jars
docker exec kafka-connect-avro curl -k -SL "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.39.tar.gz"
| tar -xzf - -C /tmp/quickstart/jars --strip-components=1 mysql-connector-java-5.1.39/mysql-connector-java-5.1.39-bin.jar
All above statements are executed without any issues. However below statement result in connection
refused.curl -X POST \
  -H "Content-Type: application/json" \
  --data '{ "name": "quickstart-jdbc-source", "config": { "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"tasks.max": 1, "connection.url": "jdbc:mysql://127.0.0.1:3306/connect_test?user=root&password=confluent",
"mode": "incrementing", "incrementing.column.name": "id", "timestamp.column.name": "modified",
"topic.prefix": "quickstart-jdbc-", "poll.interval.ms": 1000 } }' \
  http://$CONNECT_HOST:28083/connectors
Surly i am missing something. However unable to figure-it-out. Request you to review and advise 
Thanks and regrads.
Jagannath S Bilgi

  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message