简体   繁体   中英

Cassandra Authentication issue

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM