Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra Authentication issue

Tags:

cassandra

cassandra version :apache-cassandra-2.1.8

I have recently configured 2 node cluster with Authenticator set to PasswordAuthenticator. When one of the node is down I am not able to login to Cqlsh and gets below error

Connection error: ('Unable to connect to any servers', 
{'192.168.0.45': AuthenticationFailed(u'Failed to authenticate to 192.168.0.45: code=0100 [Bad credentials] 
message="org.apache.cassandra.exceptions.UnavailableException: Cannot achieve consistency level QUORUM"',)})

The system_auth RF is set to 2 as i have 2 nodes.

C:\apache-cassandra-2.1.8-bin\apache-cassandra-2.1.8\bin>nodetool status
Starting NodeTool
Datacenter: DC1
================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address       Load       Tokens  Owns    Host ID                               Rack
UN  192.168.0.45  327.87 KB  256     ?       66a97a0a-d69c-4daf-b0f5-55cb8442d728  RAC1
UN  192.168.0.46  234.28 KB  256     ?       432031fc-eea3-4b02-8d79-f877bbd8afaf  RAC1


KeySpace RF

cassandra@cqlsh> select * from system.schema_keyspaces;

 keyspace_name | durable_writes | strategy_class                              | strategy_options
---------------+----------------+---------------------------------------------+----------------------------
   system_auth |           True | org.apache.cassandra.locator.SimpleStrategy | {"replication_factor":"2"}
        system |           True |  org.apache.cassandra.locator.LocalStrategy |                         {}
 system_traces |           True | org.apache.cassandra.locator.SimpleStrategy | {"replication_factor":"2"}

(3 rows)

I have attached the Cassandra File,cassandra.yaml and cassandra-topology.properties file

like image 314
user2704472 Avatar asked Jul 26 '15 10:07

user2704472


People also ask

How do I enable Cassandra authentication?

To enable authentication: Update all Edge components that connect to Cassandra with the Cassandra username and password. On all Cassandra nodes, enable authentication. Set the Cassandra username and password on any one node.

Is Cassandra secure?

TLS/SSL EncryptionCassandra provides secure communication between a client machine and a database cluster and between nodes within a cluster. Enabling encryption ensures that data in flight is not compromised and is transferred securely.

How do I check my Cassandra service?

Check the status of the Cassandra nodes in your cluster - Go to the /<Install_Dir>/apache-cassandra/bin/ directory and type the ./nodetool status command. If the status for all the nodes shows as UN , then the nodes are up and running. If the status for any node shows as DN , then that particular node is down.


1 Answers

It might have something to do with this:

"For most system_auth queries, Cassandra uses a consistency level of LOCAL_ONE and uses QUORUM for the default cassandrasuperuser;"

Are you trying to connect as user "cassandra"? If so, that might be why it is trying to use consistency level quorum. Since you only have two nodes, a quorum would be both nodes.

So try creating a different user per the instructions here.

like image 191
Jim Meyer Avatar answered Sep 28 '22 14:09

Jim Meyer