kafka-connect-jdbc : SQLException: No suitable driver only when using distributed mode












0















We have successfully used mySQL - kafka data ingestion using jdbc standalone connector but now facing issue in using the same in distributed mode (as kafka connect service ).



connect-distributed.properties file-



bootstrap.servers=IP1:9092,IP2:9092
group.id=connect-cluster
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.topic=connect-offsets
offset.storage.replication.factor=2
config.storage.topic=connect-configs
config.storage.replication.factor=2
status.storage.topic=connect-status
status.storage.replication.factor=2
offset.flush.interval.ms=10000
plugin.path=/usr/share/java,/usr/share/java/kafka-connect-jdbc


I have my connector jars here-



/usr/share/java/kafka-connect-jdbc

-rw-r--r-- 1 root root 906708 Jul 29 01:18 zookeeper-3.4.13.jar
-rw-r--r-- 1 root root 74798 Jul 29 01:18 zkclient-0.10.jar
-rw-r--r-- 1 root root 5575351 Jul 29 01:18 sqlite-jdbc-3.8.11.2.jar
-rw-r--r-- 1 root root 41203 Jul 29 01:18 slf4j-api-1.7.25.jar
-rw-r--r-- 1 root root 658466 Jul 29 01:18 postgresql-9.4-1206-jdbc41.jar
-rw-r--r-- 1 root root 1292696 Jul 29 01:18 netty-3.10.6.Final.jar
-rw-r--r-- 1 root root 489884 Jul 29 01:18 log4j-1.2.17.jar
-rw-r--r-- 1 root root 211219 Jul 29 01:18 kafka-connect-jdbc-5.0.0.jar
-rw-r--r-- 1 root root 317816 Jul 29 01:18 jtds-1.3.1.jar
-rw-r--r-- 1 root root 87325 Jul 29 01:18 jline-0.9.94.jar
-rw-r--r-- 1 root root 20844 Jul 29 01:18 common-utils-5.0.0.jar
-rw-r--r-- 1 root root 20437 Jul 29 01:18 audience-annotations-0.5.0.jar
-rw-r----- 1 root root 2132635 Nov 11 16:31 mysql-connector-java-8.0.13.jar


I am able to run the standalone mode by running the script in this way-



/usr/bin/connect-standalone /etc/kafka/connect-standalone.properties /etc/kafka-connect-jdbc/source-quickstart-mysql.properties


But when I try to invoke the REST API to run a distributed mode connector , I get the error:



curl -X POST -H "Accept:application/json" -H "Content-Type:application/json" X.X.X.X:8083/connectors/ -d '{"name": "linuxemp-connector", "config": { "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector", "tasks.max": "1", "connection.url": "jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd","table.whitelist": "emp","mode": "timestamp","incrementing.column.name":"empid","topic.prefix": "mysqlconnector-" } }'


error-



{"error_code":400,"message":"Connector configuration is invalid and contains the following 2 error(s):nInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd for configuration Couldn't open connection to jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwdnInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd for configuration Couldn't open connection to jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwdnYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"}


note-
connector jars are placed on all connect nodes , plugin.path is same on all connect nodes and kafka-connect service is up and running .



What am I missing ? Why am I not able to submit REST call to start a distributed connect worker/task for this mysql pipeline ?
This works absolutely fine with standalone mode . But throws error with distributed mode .



Please help!



Thanks !










share|improve this question




















  • 1





    Please remove /usr/share/java/kafka-connect-jdbc from the plugin path

    – cricket_007
    Nov 16 '18 at 7:59






  • 2





    @Tony note that mysql-connector-java-8.0.13.jar is not readable for all the users. This may very likely cause your issue. Change this through chmod 644 mysql-connector-java-8.0.13.jar. As already pointed by @cricket_007, change the plugin path to plugin.path=/usr/share/java

    – marius_neo
    Nov 17 '18 at 16:56
















0















We have successfully used mySQL - kafka data ingestion using jdbc standalone connector but now facing issue in using the same in distributed mode (as kafka connect service ).



connect-distributed.properties file-



bootstrap.servers=IP1:9092,IP2:9092
group.id=connect-cluster
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.topic=connect-offsets
offset.storage.replication.factor=2
config.storage.topic=connect-configs
config.storage.replication.factor=2
status.storage.topic=connect-status
status.storage.replication.factor=2
offset.flush.interval.ms=10000
plugin.path=/usr/share/java,/usr/share/java/kafka-connect-jdbc


I have my connector jars here-



/usr/share/java/kafka-connect-jdbc

-rw-r--r-- 1 root root 906708 Jul 29 01:18 zookeeper-3.4.13.jar
-rw-r--r-- 1 root root 74798 Jul 29 01:18 zkclient-0.10.jar
-rw-r--r-- 1 root root 5575351 Jul 29 01:18 sqlite-jdbc-3.8.11.2.jar
-rw-r--r-- 1 root root 41203 Jul 29 01:18 slf4j-api-1.7.25.jar
-rw-r--r-- 1 root root 658466 Jul 29 01:18 postgresql-9.4-1206-jdbc41.jar
-rw-r--r-- 1 root root 1292696 Jul 29 01:18 netty-3.10.6.Final.jar
-rw-r--r-- 1 root root 489884 Jul 29 01:18 log4j-1.2.17.jar
-rw-r--r-- 1 root root 211219 Jul 29 01:18 kafka-connect-jdbc-5.0.0.jar
-rw-r--r-- 1 root root 317816 Jul 29 01:18 jtds-1.3.1.jar
-rw-r--r-- 1 root root 87325 Jul 29 01:18 jline-0.9.94.jar
-rw-r--r-- 1 root root 20844 Jul 29 01:18 common-utils-5.0.0.jar
-rw-r--r-- 1 root root 20437 Jul 29 01:18 audience-annotations-0.5.0.jar
-rw-r----- 1 root root 2132635 Nov 11 16:31 mysql-connector-java-8.0.13.jar


I am able to run the standalone mode by running the script in this way-



/usr/bin/connect-standalone /etc/kafka/connect-standalone.properties /etc/kafka-connect-jdbc/source-quickstart-mysql.properties


But when I try to invoke the REST API to run a distributed mode connector , I get the error:



curl -X POST -H "Accept:application/json" -H "Content-Type:application/json" X.X.X.X:8083/connectors/ -d '{"name": "linuxemp-connector", "config": { "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector", "tasks.max": "1", "connection.url": "jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd","table.whitelist": "emp","mode": "timestamp","incrementing.column.name":"empid","topic.prefix": "mysqlconnector-" } }'


error-



{"error_code":400,"message":"Connector configuration is invalid and contains the following 2 error(s):nInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd for configuration Couldn't open connection to jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwdnInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd for configuration Couldn't open connection to jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwdnYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"}


note-
connector jars are placed on all connect nodes , plugin.path is same on all connect nodes and kafka-connect service is up and running .



What am I missing ? Why am I not able to submit REST call to start a distributed connect worker/task for this mysql pipeline ?
This works absolutely fine with standalone mode . But throws error with distributed mode .



Please help!



Thanks !










share|improve this question




















  • 1





    Please remove /usr/share/java/kafka-connect-jdbc from the plugin path

    – cricket_007
    Nov 16 '18 at 7:59






  • 2





    @Tony note that mysql-connector-java-8.0.13.jar is not readable for all the users. This may very likely cause your issue. Change this through chmod 644 mysql-connector-java-8.0.13.jar. As already pointed by @cricket_007, change the plugin path to plugin.path=/usr/share/java

    – marius_neo
    Nov 17 '18 at 16:56














0












0








0








We have successfully used mySQL - kafka data ingestion using jdbc standalone connector but now facing issue in using the same in distributed mode (as kafka connect service ).



connect-distributed.properties file-



bootstrap.servers=IP1:9092,IP2:9092
group.id=connect-cluster
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.topic=connect-offsets
offset.storage.replication.factor=2
config.storage.topic=connect-configs
config.storage.replication.factor=2
status.storage.topic=connect-status
status.storage.replication.factor=2
offset.flush.interval.ms=10000
plugin.path=/usr/share/java,/usr/share/java/kafka-connect-jdbc


I have my connector jars here-



/usr/share/java/kafka-connect-jdbc

-rw-r--r-- 1 root root 906708 Jul 29 01:18 zookeeper-3.4.13.jar
-rw-r--r-- 1 root root 74798 Jul 29 01:18 zkclient-0.10.jar
-rw-r--r-- 1 root root 5575351 Jul 29 01:18 sqlite-jdbc-3.8.11.2.jar
-rw-r--r-- 1 root root 41203 Jul 29 01:18 slf4j-api-1.7.25.jar
-rw-r--r-- 1 root root 658466 Jul 29 01:18 postgresql-9.4-1206-jdbc41.jar
-rw-r--r-- 1 root root 1292696 Jul 29 01:18 netty-3.10.6.Final.jar
-rw-r--r-- 1 root root 489884 Jul 29 01:18 log4j-1.2.17.jar
-rw-r--r-- 1 root root 211219 Jul 29 01:18 kafka-connect-jdbc-5.0.0.jar
-rw-r--r-- 1 root root 317816 Jul 29 01:18 jtds-1.3.1.jar
-rw-r--r-- 1 root root 87325 Jul 29 01:18 jline-0.9.94.jar
-rw-r--r-- 1 root root 20844 Jul 29 01:18 common-utils-5.0.0.jar
-rw-r--r-- 1 root root 20437 Jul 29 01:18 audience-annotations-0.5.0.jar
-rw-r----- 1 root root 2132635 Nov 11 16:31 mysql-connector-java-8.0.13.jar


I am able to run the standalone mode by running the script in this way-



/usr/bin/connect-standalone /etc/kafka/connect-standalone.properties /etc/kafka-connect-jdbc/source-quickstart-mysql.properties


But when I try to invoke the REST API to run a distributed mode connector , I get the error:



curl -X POST -H "Accept:application/json" -H "Content-Type:application/json" X.X.X.X:8083/connectors/ -d '{"name": "linuxemp-connector", "config": { "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector", "tasks.max": "1", "connection.url": "jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd","table.whitelist": "emp","mode": "timestamp","incrementing.column.name":"empid","topic.prefix": "mysqlconnector-" } }'


error-



{"error_code":400,"message":"Connector configuration is invalid and contains the following 2 error(s):nInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd for configuration Couldn't open connection to jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwdnInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd for configuration Couldn't open connection to jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwdnYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"}


note-
connector jars are placed on all connect nodes , plugin.path is same on all connect nodes and kafka-connect service is up and running .



What am I missing ? Why am I not able to submit REST call to start a distributed connect worker/task for this mysql pipeline ?
This works absolutely fine with standalone mode . But throws error with distributed mode .



Please help!



Thanks !










share|improve this question
















We have successfully used mySQL - kafka data ingestion using jdbc standalone connector but now facing issue in using the same in distributed mode (as kafka connect service ).



connect-distributed.properties file-



bootstrap.servers=IP1:9092,IP2:9092
group.id=connect-cluster
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.topic=connect-offsets
offset.storage.replication.factor=2
config.storage.topic=connect-configs
config.storage.replication.factor=2
status.storage.topic=connect-status
status.storage.replication.factor=2
offset.flush.interval.ms=10000
plugin.path=/usr/share/java,/usr/share/java/kafka-connect-jdbc


I have my connector jars here-



/usr/share/java/kafka-connect-jdbc

-rw-r--r-- 1 root root 906708 Jul 29 01:18 zookeeper-3.4.13.jar
-rw-r--r-- 1 root root 74798 Jul 29 01:18 zkclient-0.10.jar
-rw-r--r-- 1 root root 5575351 Jul 29 01:18 sqlite-jdbc-3.8.11.2.jar
-rw-r--r-- 1 root root 41203 Jul 29 01:18 slf4j-api-1.7.25.jar
-rw-r--r-- 1 root root 658466 Jul 29 01:18 postgresql-9.4-1206-jdbc41.jar
-rw-r--r-- 1 root root 1292696 Jul 29 01:18 netty-3.10.6.Final.jar
-rw-r--r-- 1 root root 489884 Jul 29 01:18 log4j-1.2.17.jar
-rw-r--r-- 1 root root 211219 Jul 29 01:18 kafka-connect-jdbc-5.0.0.jar
-rw-r--r-- 1 root root 317816 Jul 29 01:18 jtds-1.3.1.jar
-rw-r--r-- 1 root root 87325 Jul 29 01:18 jline-0.9.94.jar
-rw-r--r-- 1 root root 20844 Jul 29 01:18 common-utils-5.0.0.jar
-rw-r--r-- 1 root root 20437 Jul 29 01:18 audience-annotations-0.5.0.jar
-rw-r----- 1 root root 2132635 Nov 11 16:31 mysql-connector-java-8.0.13.jar


I am able to run the standalone mode by running the script in this way-



/usr/bin/connect-standalone /etc/kafka/connect-standalone.properties /etc/kafka-connect-jdbc/source-quickstart-mysql.properties


But when I try to invoke the REST API to run a distributed mode connector , I get the error:



curl -X POST -H "Accept:application/json" -H "Content-Type:application/json" X.X.X.X:8083/connectors/ -d '{"name": "linuxemp-connector", "config": { "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector", "tasks.max": "1", "connection.url": "jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd","table.whitelist": "emp","mode": "timestamp","incrementing.column.name":"empid","topic.prefix": "mysqlconnector-" } }'


error-



{"error_code":400,"message":"Connector configuration is invalid and contains the following 2 error(s):nInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd for configuration Couldn't open connection to jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwdnInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwd for configuration Couldn't open connection to jdbc:mysql://Y.Y.Y.Y:3306/linux_db?user=groot&password=pwdnYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"}


note-
connector jars are placed on all connect nodes , plugin.path is same on all connect nodes and kafka-connect service is up and running .



What am I missing ? Why am I not able to submit REST call to start a distributed connect worker/task for this mysql pipeline ?
This works absolutely fine with standalone mode . But throws error with distributed mode .



Please help!



Thanks !







mysql jdbc apache-kafka apache-kafka-connect confluent






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 7:58









cricket_007

83k1145112




83k1145112










asked Nov 15 '18 at 14:32









TonyTony

12512




12512








  • 1





    Please remove /usr/share/java/kafka-connect-jdbc from the plugin path

    – cricket_007
    Nov 16 '18 at 7:59






  • 2





    @Tony note that mysql-connector-java-8.0.13.jar is not readable for all the users. This may very likely cause your issue. Change this through chmod 644 mysql-connector-java-8.0.13.jar. As already pointed by @cricket_007, change the plugin path to plugin.path=/usr/share/java

    – marius_neo
    Nov 17 '18 at 16:56














  • 1





    Please remove /usr/share/java/kafka-connect-jdbc from the plugin path

    – cricket_007
    Nov 16 '18 at 7:59






  • 2





    @Tony note that mysql-connector-java-8.0.13.jar is not readable for all the users. This may very likely cause your issue. Change this through chmod 644 mysql-connector-java-8.0.13.jar. As already pointed by @cricket_007, change the plugin path to plugin.path=/usr/share/java

    – marius_neo
    Nov 17 '18 at 16:56








1




1





Please remove /usr/share/java/kafka-connect-jdbc from the plugin path

– cricket_007
Nov 16 '18 at 7:59





Please remove /usr/share/java/kafka-connect-jdbc from the plugin path

– cricket_007
Nov 16 '18 at 7:59




2




2





@Tony note that mysql-connector-java-8.0.13.jar is not readable for all the users. This may very likely cause your issue. Change this through chmod 644 mysql-connector-java-8.0.13.jar. As already pointed by @cricket_007, change the plugin path to plugin.path=/usr/share/java

– marius_neo
Nov 17 '18 at 16:56





@Tony note that mysql-connector-java-8.0.13.jar is not readable for all the users. This may very likely cause your issue. Change this through chmod 644 mysql-connector-java-8.0.13.jar. As already pointed by @cricket_007, change the plugin path to plugin.path=/usr/share/java

– marius_neo
Nov 17 '18 at 16:56












1 Answer
1






active

oldest

votes


















0














By fixing below things, the issue got resolved -



1.Changed permissions of /usr/share/java/kafka-connect-jdbc/mysql-connector-java-8.0.13.jar to 755
2.Keep only /usr/share/java in plugin path.



3.Change my sql table structure to have one primary key and one column property with incremental nature or timestamp.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53321726%2fkafka-connect-jdbc-sqlexception-no-suitable-driver-only-when-using-distribute%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    By fixing below things, the issue got resolved -



    1.Changed permissions of /usr/share/java/kafka-connect-jdbc/mysql-connector-java-8.0.13.jar to 755
    2.Keep only /usr/share/java in plugin path.



    3.Change my sql table structure to have one primary key and one column property with incremental nature or timestamp.






    share|improve this answer






























      0














      By fixing below things, the issue got resolved -



      1.Changed permissions of /usr/share/java/kafka-connect-jdbc/mysql-connector-java-8.0.13.jar to 755
      2.Keep only /usr/share/java in plugin path.



      3.Change my sql table structure to have one primary key and one column property with incremental nature or timestamp.






      share|improve this answer




























        0












        0








        0







        By fixing below things, the issue got resolved -



        1.Changed permissions of /usr/share/java/kafka-connect-jdbc/mysql-connector-java-8.0.13.jar to 755
        2.Keep only /usr/share/java in plugin path.



        3.Change my sql table structure to have one primary key and one column property with incremental nature or timestamp.






        share|improve this answer















        By fixing below things, the issue got resolved -



        1.Changed permissions of /usr/share/java/kafka-connect-jdbc/mysql-connector-java-8.0.13.jar to 755
        2.Keep only /usr/share/java in plugin path.



        3.Change my sql table structure to have one primary key and one column property with incremental nature or timestamp.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 5 at 13:29

























        answered Nov 18 '18 at 12:16









        TonyTony

        12512




        12512
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53321726%2fkafka-connect-jdbc-sqlexception-no-suitable-driver-only-when-using-distribute%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            The Sandy Post

            Danny Elfman

            Pages that link to "Head v. Amoskeag Manufacturing Co."