Service Virtualization

  • 1.  How to connect Cassandra DB having multiple nodes/hosts?

    Posted Mar 06, 2017 11:06 AM

    Hi,

     

    I am trying to connect Cassandra DB in DevTest 8.5. The Cassandra DB has 4 nodes/hosts (node1, node2, node3, node4). Previously, I have connected to Cassandra DB having single node like this (jdbc:cassandra://node1:9160/keySpaceName). However, is there a way to connect all the 4 nodes?

     

    Thanks,

    Uttam.



  • 2.  Re: How to connect Cassandra DB having multiple nodes/hosts?

    Posted Mar 07, 2017 11:17 AM

    Hi Uttam,

    Connection Strings for all the 4 nodes are different or same?

     

    Thanks,

    Monika



  • 3.  Re: How to connect Cassandra DB having multiple nodes/hosts?

    Posted Mar 07, 2017 05:07 PM

    Connection string should be same but it should cover/have all the 4 nodes. As mentioned in my above comment, connection string has only one node. Is there a way to connect all 4 in one single connection string? Say something like this jdbc:cassandra://node1;node2;node3;node4:9160/keySpaceName. 

    On a side note, I got this on google jdbc:cassandra://node1--node2--node3--node4:port/keySpaceName (nodes separated by --). However it didn't work.



  • 4.  Re: How to connect Cassandra DB having multiple nodes/hosts?

    Broadcom Employee
    Posted Mar 07, 2017 05:39 PM

    Can you please provide the jdbc driver you have in your DevTest environment & from where have you got the same?



  • 5.  Re: How to connect Cassandra DB having multiple nodes/hosts?

    Posted Mar 07, 2017 05:46 PM

    You are right, I see the same connection string format on google. 

    Are you getting any error? If yes, Please share the same.



  • 6.  Re: How to connect Cassandra DB having multiple nodes/hosts?

    Posted May 22, 2018 04:54 PM

    Pls find the error while using multiple clusters

     

    java.sql.SQLNonTransientConnectionException: Connection url must specify a host, e.g., jdbc:cassandra://localhost:9170/Keyspace1
    at org.apache.cassandra.cql.jdbc.Utils.parseURL(Utils.java:190)
    at org.apache.cassandra.cql.jdbc.CassandraDriver.connect(CassandraDriver.java:85)
    at com.itko.lisa.jdbc.JDBCNode.getConnection(JDBCNode.java:627)
    at com.itko.lisa.jdbc.JDBCNode.executeSQL(JDBCNode.java:370)
    at com.itko.lisa.jdbc.JDBCNodeEditor.doExec(JDBCNodeEditor.java:483)
    at com.itko.lisa.jdbc.JDBCNodeEditor$6.doCallback(JDBCNodeEditor.java:417)
    at com.itko.util.swing.panels.ProcessingDialog$2.run(ProcessingDialog.java:194)
    at java.lang.Thread.run(Thread.java:745)

     

    Driver - org.apache.cassandra.cql.jdbc.CassandraDriver

    Connection URL - jdbc:cassandra://10.135.83.24--10.135.83.26--10.135.83.24:9160/supply_chain_domain

    Is Devtest supports a different format? Pls let me know



  • 7.  Re: How to connect Cassandra DB having multiple nodes/hosts?

    Broadcom Employee
    Posted Jun 15, 2018 12:26 PM

    I found this link:

    Cassandra JDBC Driver | DbSchema Cassandra Designer 

     

    The format of the JDBC URL looks like this:

     

    URL: jdbc:cassandra://host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[keyspace][?options]]

     

    Hope this helps.



  • 8.  Re: How to connect Cassandra DB having multiple nodes/hosts?

    Posted Jul 03, 2018 02:53 PM

    Thank you Marcy. I will try this out.



  • 9.  Re: How to connect Cassandra DB having multiple nodes/hosts?

    Posted Jul 16, 2018 05:12 PM

    None of the built in features worked for me. I have used java scripts to connect to caasandra3.1.0 using datastax drivers. It is able to connecting to multiple contact points or DB clusters



  • 10.  Re: How to connect Cassandra DB having multiple nodes/hosts?

    Broadcom Employee
    Posted Jul 16, 2018 05:20 PM