Cassandra身份验证问题 [英] Cassandra Authentication issue

查看:2339
本文介绍了Cassandra身份验证问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

cassandra版本:apache-cassandra-2.1.8

cassandra version :apache-cassandra-2.1.8

我最近配置了两个节点集群 Authenticator 设置为 PasswordAuthenticator 。当一个节点关闭时,我无法登录到Cqlsh并得到以下错误

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"',)})

system_auth RF设置为2因为我有2个节点。

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)

我已附加Cassandra文件,cassandra.yaml和cassandra-topology.properties文件

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

推荐答案

这可能与此有关:

对于大多数system_auth查询,Cassandra使用一致性级别为LOCAL_ONE,并对默认的cassandrasuperuser使用QUORUM;

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

您尝试以使用者「cassandra」连线吗?如果是这样,这可能是为什么它试图使用一致性级别仲裁。由于您只有两个节点,因此定额将同时是节点。

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.

这篇关于Cassandra身份验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆