question

Vikaskarn avatar image
Vikaskarn asked Erick Ramirez edited

How do I configure odbc.ini to use two IP/ports?

Hi Team, I have a client requirement where I have to connect to two different host of Cassandra DB. They are different in IP's and Port number however keyspace is same. Can you please suggest what and how should I configure odbc.ini file as I am not able to connect via isql command at OS level.

odbc driver
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez edited

You didn't specify which driver you're using so I'm going to assume that you've installed the DataStax ODBC Driver for Apache Cassandra.

To specify multiple Cassandra nodes in odbc.ini, set the Host property to a list of hosts + ports:

Host=10.1.2.3:9042,10.1.2.4:9042,10.1.2.5:9042

For more info, see page 23 of the Installation Guide. Cheers!

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Vikaskarn avatar image Vikaskarn commented ·
Hi Erick, sorry to mentioned that I need to connect to two different Cassandra Environment from my SAS UAT i.e., Cassandra Dev and Cassandra UAT. I have already connected to Cassandra Dev and it's working fine and now the requirement came to connect to Cassandra UAT. So, here there are two different IP's, port numbers, DSN, Keyspace, username and password. I tried adding in ODBC.ini file but it didn't work for me. Request you to please suggest !!
0 Likes 0 ·
Erick Ramirez avatar image Erick Ramirez ♦♦ Vikaskarn commented ·

You cannot do that. You can only configure the driver to connect to one cluster at a time.

This is by design for all drivers, not just the ODBC driver. Cheers!

0 Likes 0 ·