cassandra | A Ruby client for the Cassandra distributed database
kandi X-RAY | cassandra Summary
kandi X-RAY | cassandra Summary
A Ruby client for the Cassandra distributed database. Supports 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1 and rubinius on Cassandra 0.7.x through 2.0.x.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cassandra
cassandra Key Features
cassandra Examples and Code Snippets
public static void main(String... args) throws Exception {
EmbeddedCassandraServerHelper.startEmbeddedCassandra();
ColumnConfiguration configuration = new CassandraConfiguration();
try(ColumnFamilyManagerFactory entityManage
@Override
@Bean
public CassandraMappingContext cassandraMapping() throws ClassNotFoundException {
return new BasicCassandraMappingContext();
}
@Bean(destroyMethod = "close")
public Session session(CassandraProperties properties, Cluster cluster) {
log.debug("Configuring Cassandra session");
return StringUtils.hasText(properties.getKeyspaceName()) ? cluster.connect(proper
Community Discussions
Trending Discussions on cassandra
QUESTION
To archive this using Cassendra Shell :
...ANSWER
Answered 2022-Mar-24 at 10:28The metrics in nodetool tablestats
(formerly cfstats
) is not exposed to the drivers so you cannot get this information via CQL.
These metrics are only exposed via JMX. Cheers!
QUESTION
I am trying to setup a cassandra DB and connect to it with a golang app.
this is my docker-compose
ANSWER
Answered 2022-Mar-08 at 17:28Each container has its own localhost (127.0.0.1
) address - you need to connect to IP address of your machine (if you use bridge
), or maybe better to connect by the name (cassandra
)
QUESTION
I'm working with Scala and trying to save my calendar information from Spark to Cassandra.
I started with creating the same schema with Cassandra:
session.execute("CREATE TABLE calendar (DateNum int, Date text, YearMonthNum int, ..., PRIMARY KEY (datenum,date))")
and then imported my data from spark to Cassandra:
...ANSWER
Answered 2022-Feb-21 at 14:06Data in Cassandra is ordered only inside the Cassandra partition, but partitions themselves aren't sorted by value, and organized by hash of partition key. So when you read data, you can read nearby Cassandra partitions, but they may belong to completely different dates.
So if you have data sorted in Spark, you need to explicitly sort data using the .orderBy
QUESTION
we try to upgrade apache cassandra 3.11.12 to 4.0.2, this is the first node we upgrade in this cluster (seed node). we drain the node and stop the service before replace the version.
system log:
...ANSWER
Answered 2022-Mar-07 at 00:15During startup, Cassandra tries to retrieve the host ID by querying the local system table with:
QUESTION
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
ANSWER
Answered 2021-Sep-02 at 10:28DataStax 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
- 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.
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 to0
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 clusterIn 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 asrpc_port
incassandra.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!
QUESTION
I need to start by saying that I have no experience using Cassandra and I am not the one who who created this deployment.
I have Cassandra running in a cluster in AKS. The PVC as configured in the statefulset is 1000Gi. Currently the pods are out of storage and are in a constant unhealthy state.
I am looking to expand the volumes attached to the pods. The problem I am facing is that I cannot scale down the statefulset because the statefulsets only scale down when all their pods are healthy.
I even tried deleting the statefulset and then recreateing it with a larger PVC (as recomended here)
Howerver, I can't seem to delete the statefulset. It looks to me like the CassandraDatacenter CRD keeps recreating the statefulset as soon as I delete it. Giving me no time to change anything.
My question are as follows:
- Is there a standard way to expand the volume without losing data?
- What would happen if I scale down the replicas in the CassandraDatacenter? Will it delete the PVC or keep it?
- If there is no standard, does anyone have any ideas on how to accomplish expanding the volume size without losing storage?
ANSWER
Answered 2021-Aug-01 at 13:03Ordinarily in a Cassandra cluster, the best practice is to scale horizontally (not vertically). You want more Cassandra nodes to spread the load out to achieve maximum throughput.
The equivalent in Kubernetes is to scale up your deployment. As you increase the node count, the amount of data on each individual Cassandra node will decrease proportionally.
If you really want to resize the PVC, you will only be able to do it dynamically if you have enabled allowVolumeExpansion
. You won't lose data as you do this.
Deleting a STS isn't going to work because by design it will be automatically replaced as you already know. You also won't be able to scale down because there isn't enough capacity (disk space) in your cluster if you do. Cheers!
QUESTION
I'm new to Cassandra and I've been having some issues trying to delete multiple rows in table. I have a table defined as follows:
...ANSWER
Answered 2022-Feb-02 at 09:56It doesn't work this way in Cassandra. You need to have a full or partial primary key specified in the DELETE
command. If you want to delete by non-primary/partition key, then you need first to find rows with that value, extract primary key, and then delete by primary key.
You can find ways to do that in this answer.
QUESTION
I use both Cassandra and ScyllaDB 3-node clusters and use PySpark to read data. I was wondering if any of them are not repaired forever, is there any challenge while reading data from either if there are inconsistencies in nodes. Will the correct data be read and if yes, then why do we need to repair them?
...ANSWER
Answered 2022-Jan-12 at 06:47Yes you can get incorrect data if reapir is not done. It also depends on with what consistency you are reading or writing. Generally in production systems writes are done with (Local_one/Local_quorum) and read with Local_quorum.
If you are writing with weak consistency level, then repair becomes important as some of the nodes might not have got the mutations and while reading those nodes may get selected.
For example if you write with consistency level ONE
on a table TABLE1
with a replication of 3. Now it may happen your write was written to NodeA
only and NodeB
and NodeC
might have missed the mutation. Now if you are reading with Consistency level LOCAL_QUORUM
, it may happen that NodeB
and 'NodeC' get selected and they do not return the written data.
Repair is an important maintenance task for Cassandra which should be done periodically and continuously to keep data in healthy state.
QUESTION
I'm looking for a way to put a default value (like in relational DBs) in a Cassandra table. After some research I found out that it is not possible to do this, however I want to be able to update some info in my table, as I don't know when the info it will arrive. e.g.
...ANSWER
Answered 2022-Jan-12 at 07:10As Aaron mentioned in comment, you should be fine with value==null till the new value arrives. I think it will be the best practice because appropriate value of column arrive later, so better to update it at that time. Till then it is better to keep it null. If client application cannot put null check then you can put placeholder value as you defined in your example.
QUESTION
Our organisation has move on from Cassandra to ScyllaDB recently and since there's so little info about ScyllaDB, and as the title suggests, how often should we repair ScyllaDB nodes to maintain equal count of rows in each node as Cassandra's repair frequency is recommended as 5 Days?
...ANSWER
Answered 2022-Jan-11 at 19:20Scylla Manager automates the repair process and allows you to configure how and when repair occurs. When you create a cluster a repair task is automatically scheduled. This task is set to occur each week by default, but you can change it to another time, change its parameters or add additional repair tasks if needed.
Source: https://manager.docs.scylladb.com/stable/repair/index.html
[Edi: Pointing to latest docs]
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
Install cassandra
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page