Joel
Joel

Reputation: 8978

How do I connect to Cassandra with Dbeaver Community edition?

Has anyone had any success with connecting to a Cassandra cluster using DBeaver Community Edition? I've tried to follow this post, but haven't had any success. I have to have authentication enabled, and I get an error saying:

Authentication error on host /x.x.x.x:9042: Host /x.x.x.x:9042 requires authentication, but no authenticator found in Cluster configuration

Upvotes: 13

Views: 30267

Answers (2)

Erick Ramirez
Erick Ramirez

Reputation: 16353

IMPORTANT UPDATE

The Simba JDBC driver from Magnitude is no longer available for free. It is no longer downloadable from the DataStax website so the instructions in this post is obsolete.

The alternative option is to use ING Bank's open-source JDBC wrapper and I have documented the steps for using it with DBeaver Community Edition on DBA Stack Exchange (post #340409).


Overview

DataStax offers the JDBC driver from Magnitude (formerly Simba) to users at no cost so you should be able to use it with DBeaver.

These are the high-level steps for connecting to a Cassandra cluster with DBeaver:

  1. Download the Simba JDBC driver from DataStax
  2. Import the Simba JDBC driver
  3. Create a new connection to your cluster

Download the driver

  1. Go to https://downloads.datastax.com/#odbc-jdbc-drivers.
  2. Select Simba JDBC Driver for Apache Cassandra.
  3. Select JDBC 4.2.
  4. Accept the license terms (click the checkbox).
  5. Hit the blue Download button.
  6. Once the download completes, unzip the downloaded file.

Import the driver

In DBeaver, go to the Driver Manager and import the Simba JDBC driver as follows:

  1. Click the New button
  2. In the Libraries tab, click the Add File button
  3. Locate the directory where you unzipped the download and add the CassandraJDBC42.jar file.
  4. Click the Find Class button which should identify the driver class as com.simba.cassandra.jdbc42.Driver.
  5. In the Settings tab, set the following:
  • Driver Name: Cassandra
  • Driver Type: Generic
  • Class Name: com.simba.cassandra.jdbc42.Driver
  • URL Template: jdbc:cassandra://{host}[:{port}];AuthMech=1 (set authentication mechanism to 0 if your cluster doesn't have authentication enabled)
  • Default Port: 9042
  1. Click the OK button to save the driver.

At this point, you should see Cassandra as one of the drivers in the list.

Connect to your cluster

In DBeaver, create a new database connection as follows:

  1. Select Cassandra from the drivers list.
  2. In the Main tab of the JDBC connection settings, set the following:
  • Host: node_ip_address (this could be any node in your cluster)
  • Port: 9042 (or whatever you've set as rpc_port in cassandra.yaml)
  • Username: your_db_username
  • Password: your_db_password
  1. Click on the Test Connection button to confirm that the driver configuration is working.
  2. Click on the Finish button to save the connection settings.

At this point, you should be able to browse the keyspaces and tables in your Cassandra cluster. Cheers!


👉 Please support the Apache Cassandra community by hovering over then click on the Watch tag button. 🙏 Thanks!

Upvotes: 54

Siddhesh T
Siddhesh T

Reputation: 446

The answer by Erick Ramirez works well, with a few modifications as of 5th June 2024.

  1. The Simba driver is unavailable on the link in the answer. In the comments, there is a wayback machine link shared by VasiliNovikov, which works to get the right driver.
  2. While importing the driver, I was unable to follow step 4, using the Find Class button. I went on with the rest of the steps. When creating the Database connection, there is a Driver Settings button, where I was able to click on Find Class again, and it identified the required driver class name.

That's it. Tested with DBeaver community version 24.1.0.

Upvotes: 2

Related Questions