question

ashir avatar image
ashir asked Erick Ramirez answered

How do I connect to Astra DB from CP4D?

I am trying to connect Astra DB to CP4D(cloud pak for data) which is a product of IBM. Firstly I tried to install cassandra on linux and windows environment and connect it remotely to CP4D or other tools but was not able to do it after changing the some configuration in yaml file I was not successful.

I changed the rpc and listen address in yaml file to my public IP address. Now I am trying to conenct Astra DB(cassandra) to CP4D but not able to do it. Could anyone help on it?

astra dbastra-db-clientsibm cp4d
1 comment
10 |1000

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

@ashir, it isn't very clear from your post on what steps that you had performed earlier to get it connected. Could you update your original post with steps to recreate this?


Also, take a look at the "Integrations" page here in the documentation and look at the child pages (via the left navigation menu) too to get some inspiration on hooking up Astra DB with other systems. Alternatively, you could also take a look at the 3rd party tools documentation here to get inspiration.


Disclaimer: I've no idea about IBM's Cloud pack for Data, but it seems to appear that they've a way to hook it up with Cassandra here.

0 Likes 0 ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

If you've already setup your Astra DB, you will need to do two things:

The application token is what you would use in place of a username and password. The secure bundle contains connection details specific for your database.

Once you've downloaded your secure bundle, unpack/unzip it. For example:

cd /path/to/scb
$ unzip secure-connect-myastradb.zip

Here is an example file listing after unpacking the bundle:

/
  path/
    to/
      scb/
        ca.crt          <----- CA certificate
        cert            <----- SSL certificate
        cert.pfx
        config.json.    <----- text file containing DB details
        cqlshrc
        identity.jks
        key
        trustStore.jks

Obtain information about your database from the config.json file. Here is an example:

{
  "host": "70bf8560-105f-11ec-a3ea-0800200c9a66-us-west1.db.astra.datastax.com",
  "port": 98765,
  "cql_port": 34567,
  "keyspace": "mykeyspace",
  "localDC": "us-west-2",
  "caCertLocation": "./ca.crt",
  "keyLocation": "./key",
  "certLocation": "./cert",
  "keyStoreLocation": "./identity.jks",
  "keyStorePassword": "Kga1OJ83EF2oBQYR5",
  "trustStoreLocation": "./trustStore.jks",
  "trustStorePassword": "n8F9ptJO3H7YRxTW1",
  "csvLocation": "./data",
  "pfxCertPassword": "9b3HgFChtY60m4nfJ"
}

Using the details above, follow the procedure for creating an Apache Cassandra connection in CP4D:

  • Hostname - use the value in host field
  • Port number - use the value in cql_port field
  • Keyspace - use the value in keyspace field
  • Username and password - use the string token and the token you generated above
  • SSL certificate - use the certificate files above

Cheers!

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.