Help Center> GeminiDB> GeminiDB Cassandra API> FAQs> Database Connection> What Can I Do If Spark Failed to Connect to Cassandra?
Updated on 2023-05-18 GMT+08:00

What Can I Do If Spark Failed to Connect to Cassandra?

Symptom

You used Spark to connect to the open-source Cassandra, data can be read properly, but an error was reported during the connection.

Error message is as follows.

Configuration Details

The following shows the components and account details.

  • Component configuration details
    Table 1 Configuration details

    Component

    Version

    spark-cassandra-connector

    2.5.1

    spark

    2.5.1

    Open-source Cassandra

    3.11

    scala

    2.12

  • User: user1 (created by user rwuser)

Possible Cause

  • user1 does not have the permission to query the keyspace system.
  • The Spark version is incorrect.

Solution

  1. Grant the keyspace system query permission to user1 as user rwuser.
  2. Use spark-cassandra-connector 2.4.1.