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
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With