How do I connect to Cassandra with Dbeaver Community edition? - cassandra

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

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:
Download the Simba JDBC driver from DataStax
Import the Simba JDBC driver
Create a new connection to your cluster
Download the driver
Go to https://downloads.datastax.com/#odbc-jdbc-drivers.
Select Simba JDBC Driver for Apache Cassandra.
Select JDBC 4.2.
Accept the license terms (click the checkbox).
Hit the blue Download button.
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:
Click the New button
In the Libraries tab, click the Add File button
Locate the directory where you unzipped the download and add the CassandraJDBC42.jar file.
Click the Find Class button which should identify the driver class as com.simba.cassandra.jdbc42.Driver.
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
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:
Select Cassandra from the drivers list.
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
Click on the Test Connection button to confirm that the driver configuration is working.
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 cassandra then click on the Watch tag button. 🙏 Thanks!

Erick Ramirez answer mostly worked for me. I did manage to get a connection, but I never figured out how to get dbeaver to properly work with dates. By default they were displayed in local time, and queries with filters on exact timestamps did not work.
What did work very well for me was the Cassandra integration in JetBrains Rider. (I guess it's the same as for JetBrains IntelliJ)

Related

How do I configure the Twig JDBC driver in DbVisualizer to connect to a Cassandra cluster?

I have an Ubuntu 20.04.5 install which has a Cassandra database which I want to connect to with DbVisualizer v14.0.1 using the Cassandra Twig driver (for reasons best known to my organisation).
I have installed DbVis and downloaded the cassandra-twig-jdbc-3.0.1.jar driver, started DbVis with the free version.
I have installed the driver successfully, providing the URL format as jdbc:cassandra://<server>:<port>/<database> specified by the Cassandra docs, and named it 'Cassandra':
I am now trying to create a database connection, for which the documentation states there is a wizard, however I cannot find that.
Going with a manual connection, I do not see the Database Connection panel described by the documentation, I just get a driver selection:
If I select the 'Cassandra' driver I don't get a 'Database URL' field:
Clicking 'Connect' fails - how can I define the connection URL for my local database?
Open Tools->Driver Manager and choose the Cassandra DataStax driver entry. In the right pane click the Start Download link. Once ready, close the dialog. In the main window and in the Databases tab, click to create a new database connection and choose Cassandra DataStax. Now you can choose Database URL.
The first step where you have installed the Twig driver in DBVisualizer, that's where you configure the URL.
In your screenshot, you have configured it with:
jdbc:cassandra://<server>:<port>/<database>
You should instead populate it with details of your cluster. For example, for this cluster:
contact point IP - 10.1.2.3
client port - 9042
keyspace name - mykeyspace
the corresponding JDBC URL is:
jdbc:cassandra://10.1.2.3:9042/mykeyspace
I haven't written instructions specifically for DBVisualizer but if you're interested, I've written one for DBeaver in this post -- How do I connect to Cassandra with Dbeaver Community edition?. Cheers!

How do I configure Talend Open Studio to connect to a Cassandra cluster?

I referred this Documentation
https://www.javatpoint.com/talend-jdbc-connection
For how to config DB connection on Talend. In the documentation mentioned, MySQL JDBC Connector is used to connect the MySQL DB to Talend. In my case, I need to connect with Cassandra JDBC Connector is used to connect the Cassandra DB to Talend, and the connection is also established successfully.
The documentation mentioned when we right-click on the database connection it will show the popup menu. The pop-menu shows the retrieve schema option. This option is used to show the table. But when I right-click on the DB connection it's not showing a pop-menu on the Talend Open Studio. How to fix this issue.
I suspect the problem is that you're using the wrong JDBC driver although I'm unable to confirm that since you didn't actually say which one you're using.
You will need to download the Simba JDBC Driver for Apache Cassandra from DataStax Downloads in order to connect to a Cassandra cluster. Then you'll need to install the driver on to your Talend.
I don't have the detailed steps for doing that but I've previously written instructions for connecting clients like Pentaho Data Integration and DBeaver to Astra DB which is a Cassandra-as-a-service. The instructions for those should give you an idea of how to configure Talend. Cheers!
I encountered the same problem, you're supposed to make the connection under the 'NoSQL Connections' Tab since Cassandra is a NoSQL database.
I followed the instructions here

not able to connect cluster to opscenter

hyy folks,
i have setup cassandra gui using this doc https://docs.datastax.com/en/install/6.8/install/opscInstallRHEL.html
but as soon as i hit the url it will open this page
here i chosen manage existing clsuter and go to next page
there it is shown like this
there i paste my private ip
but as soon i hit next it showing this error
how can i add my cluster in opscenter
sudo service opscenterd status
it is showing in Running state
i entered username and password then it is showing this
OpsCenter only works with DataStax Enterprise.
You cannot use OpsCenter to connect to:
open-source Apache Cassandra,
other distributions which are forks of Cassandra, or
versions from cloud vendors which run a CQL API engine to make the database "look and feel" like Cassandra.
Cheers!

OpsCenter with HTTPS kills session when clicked on Spark Console

I have a DataStax Enterprise cluster running on 2 AWS nodes. DSE is installed in enterprise mode and one of the nodes is configured in Analytics mode.
Everything was working normal until I followed the steps outlined here to enable HTTPS for OpsCenter: http://docs.datastax.com/en/opscenter/5.0/opsc/configure/opscEnablingAuth.html
OpsCenter authentication is now working fine. However if I click the Spark Console hyperlink of the Analytics node the raw text of the Spark job details will show but the page's CSS and images are gone, looking at Chrome's developer tools it looks like I'm getting an access denied on these resources. Also, as soon as I click the link and the Spark Console popup opens, the OpsCenter tab will kill my session and log me out. I was able to observe the same behavior with Chrome and IE.
Instance: m3.large
AMI: DataStax Auto-Clustering AMI 2.6.3-1404-hvm - ami-8b392cbb
I've reproduced this issue using OpsCenter 5.2 and DSE 4.7. I've created a ticket in our internal tracking system to address this issue; the reference number for that ticket is OPSC-6606.
Thanks for bringing this issue to our attention!

Opscenter doesn't show my key spaces

I have Cassandra cluster (ver 2.0.12) and Datastax Agents 5.0.1. Also I using OpsCenter 5.1.0. In "Explorer" tab I see no keyspaces.
Query from CLI:
SELECT keyspace_name FROM system.schema_keyspaces;
show my keyspaces. I try URL:
http://<cluster_url>:8888/<cluster_name>/keyspaces
that show me JSON output which conatain keyspaces info(i think), but "Explorer" tab still empty.
Opscenter does not necessarily automatically connects to the local node to get the cluster information. You can review this piece of documentation to check what is in your configuration files, and update them properly. There can be multiple reasons why OpsCenter can't connect to your local instance.
Or you can use the wizard to add a cluster to manage. This should populate data properly into the config files.

Resources