Reputation: 31
I am a Mac user attempting to set up DBeaver to connect to Cassandra DB. https://downloads.datastax.com/#odbc-jdbc-drivers has no Mac version for Apache Cassandra to download. Any solutions or alternative Cassandra DB tools available for Mac devices?
Installed DBeaver Community Edition. But no Cassandra driver comes with it.
Upvotes: 2
Views: 1854
Reputation: 1685
You can totally leverage the ING JDBC Cassandra driver to plug DBeaver on a Cassandra node.
1. Start Cassandra Locally
Assuming you are running Cassandra locally with Docker
docker run --name cassandra \ -p 9042:9042 \ -d cassandra:4.1.3
2. Setup Cassandra
After about 30s, Cassandra should be started. To connect with DBeaver and the Cassandra JDBC you need to provide the keyspace so let us create one named stackoverflow
docker exec -it cassandra bash -c "cqlsh"
datacenter1
) it will also be needed in the JDBC url.select data_center from system.local;
CREATE KEYSPACE IF NOT EXISTS stackoverflow
WITH REPLICATION = {
'class':'SimpleStrategy',
'replication_factor':1
};
use stackoverflow;
CREATE TABLE IF NOT EXISTS countries (code TEXT PRIMARY KEY, name TEXT);
INSERT INTO countries(code, name) VALUES('fr', 'France');
INSERT INTO countries(code, name) VALUES('uk', 'United Kingdom');
INSERT INTO countries(code, name) VALUES('usa', 'United States');
select * from countries;
3. Download DBeaver
Go the DBeaver download page or Dbearver lite and pick the proper DMG either your are on intel or apple silicon (M1, M2)
4. Download the JDBC driver
Go the release github page of ING JDBC Driver
Pick the latest release. in Assets
, downloads the file cassandra-jdbc-wrapper-x.Y.Z-bundle.jar
in your Documents
folder.
5. Create DBeaver Driver
Open DBeaver application
In the menu go Database > Driver manager
The Panel Click new
without selecting anything
libraries
and select Add File
, look for the jar we just downloaded.Settings
and enter the following values:Var | Value |
---|---|
Driver Name | cassandra-ing-driver |
Driver Type | generic |
ClassName | com.ing.data.cassandra.jdbc.CassandraDriver |
[OK]
6. Create the Datasource
In the menu now select Database > New Database Collection
Pick the driver cassandra-ing
jdbc:cassandra://127.0.0.1:9042/stackoverflow?localdatacenter=datacenter1
Test Connection
Validate and Save
On the left panel you can now see your data
Upvotes: 9