Bubesh Shankar Govindarajan created KAFKA-5798:
--------------------------------------------------

             Summary: Couldnt connect to mysql using mysql.jdbc driver
                 Key: KAFKA-5798
                 URL: https://issues.apache.org/jira/browse/KAFKA-5798
             Project: Kafka
          Issue Type: Bug
          Components: KafkaConnect
    Affects Versions: 0.10.0.1
         Environment: Ubuntu
            Reporter: Bubesh Shankar Govindarajan


Am a beginner to both java and kafka, trying to connect kafka and mysql to 
stream data from mysql database and consume it via kafka consumers. 

I have downloaded the confluent 3.3.0 from the below link 
https://www.confluent.io/download/

I am using - *confluent-3.3.0*
*+Java version :+*
$ java -version
openjdk version "9-Ubuntu"
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b161-1)
OpenJDK Server VM (build 9-Ubuntu+0-9b161-1, mixed mode)

Mysql JDBC driver: *com.mysql.jdbc_5.1.5.jar*

I have started the zookeeper and kafka server  using the below commands

* zookeeper-server-start 
/home/bubesh/Kafka/confluent-3.3.0/etc/kafka/zookeeper.properties
* kafka-server-start 
/home/bubesh/Kafka/confluent-3.3.0/etc/kafka/server.properties

*+I have used the below command to invoke kafka-connect - to connect to mysql 
via jdbc driver:+*

connect-standalone 
/home/bubesh/Kafka/confluent-3.3.0/etc/schema-registry/connect-avro-standalone.properties
 
/home/bubesh/Kafka/confluent-3.3.0/etc/kafka-connect-jdbc/source-quickstart-mysql.properties

*+My CLASSPATH variable has: +*

/home/bubesh/JDBCDriver/com.mysql.jdbc_5.1.5.jar::/home/bubesh/Kafka/confluent-3.3.0/share/java/kafka/*:/home/bubesh/Kafka/confluent-3.3.0/share/java/confluent-common/*:/home/bubesh/Kafka/confluent-3.3.0/share/java/kafka-serde-tools/*:/home/bubesh/Kafka/confluent-3.3.0/share/java/kafka-connect-elasticsearch/*:/home/bubesh/Kafka/confluent-3.3.0/share/java/kafka-connect-hdfs/*:/home/bubesh/Kafka/confluent-3.3.0/share/java/kafka-connect-jdbc/*:/home/bubesh/Kafka/confluent-3.3.0/share/java/kafka-connect-s3/*:/home/bubesh/Kafka/confluent-3.3.0/share/java/kafka-connect-storage-common/*


*+Error while running the command:+*
Error: Config file not found: 
/usr/lib/jvm/java-9-openjdk-i386/conf/management/management.properties

*+connect-avro-standalone.properties:+*

bootstrap.servers=localhost:9092
key.converter=io.confluent.connect.avro.AvroConverter
key.converter.schema.registry.url=http://localhost:8081
value.converter=io.confluent.connect.avro.AvroConverter
value.converter.schema.registry.url=http://localhost:8081
internal.key.converter=org.apache.kafka.connect.json.JsonConverter
internal.value.converter=org.apache.kafka.connect.json.JsonConverter
internal.key.converter.schemas.enable=false
internal.value.converter.schemas.enable=false
offset.storage.file.filename=/tmp/connect.offsets

I use a VMware with Ubuntu installed in it and my MySQL sever is installed in 
my host machine. I have also connected to this 

*+ipconfig of the host:+*

 Connection-specific DNS Suffix  . : home
   Link-local IPv6 Address . . . . . : fe80::c81:5928:4ee6:5a2d%9
   IPv4 Address. . . . . . . . . . . : 192.168.1.10
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

*+source-quickstart-mysql.properties:+*

name=mysql-whitelist-timestamp-source
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1

connection.url=jdbc:mysql://192.168.1.10:3306/sandbox?user=bubesh&password=bubesh21
query=SELECT * from temp1
mode=incrementing
incrementing.column.name=c1

topic.prefix=mysql-test-topic1




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to