Cassandra cqlsh无法登录非超级用户

时间:2017-03-23 06:26:39

标签: cassandra datastax cql cqlsh

遵循this程序启用DSE身份验证和授权。

cqlsh能够登录超级用户,但无法登录普通用户(超级用户= false)。

以下是尝试登录普通用户时的错误:

Connection error: ('Unable to connect to any servers', {'127.0.0.1': AuthenticationFailed('Failed to authenticate to 127.0.0.1: Error from server: code=0100 [Bad credentials] message="Failed to login. Please re-try."',)})

它还能够登录cassandra超级用户。

以下是system_auth密钥空间的说明:

CREATE KEYSPACE system_auth WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

cassandra@cqlsh> show version;
[cqlsh 5.0.1 | Cassandra 3.0.9.1346 | DSE 5.0.3 | CQL spec 3.4.0 | Native protocol v4]
cassandra@cqlsh> 

我在我的ubuntu盒子上本地运行cassandra。请帮我解决错误。


编辑 - 03/24/2017

在1个节点(Ubuntu)上运行Cassandra。 DSE,Cassandra,CQL的版本细节都在上面。

$ nodetool status
Datacenter: dc1
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address       Load       Tokens       Owns    Host ID                               Rack
UN  127.0.0.1   1.3 MB     32           ?       aaa1b7c1-6049-4a08-ad3e-3697a0e30e10  rack1

我根据文档创建了这样的用户:

cassandra@cqlsh> create role krishna with password='krishna' and login=true;
cassandra@cqlsh> list roles        **(This gave me expected output, krishna is not superuser)**
cassandra@cqlsh> login krishna
Password: 
'Unable to connect to any servers', {'127.0.0.1': AuthenticationFailed('Failed to authenticate to 127.0.0.1: Error from server: code=0100 [Bad credentials] message="Failed to login. Please re-try."',)} 

我也尝试使用cqlsh登录:

$ cqlsh -u krishna -p krishna
Connection error: ('Unable to connect to any servers', {'127.0.0.1': AuthenticationFailed('Failed to authenticate to 127.0.0.1: Error from server: code=0100 [Bad credentials] message="Failed to login. Please re-try."',)})

创建超级用户时同样有效:

cassandra@cqlsh> create role superuser with password='superuser' and login=true and superuser=true;
cassandra@cqlsh> login superuser 
Password: 
superuser@cqlsh>                 **(Logged in correctly)**

还有cqlsh:

$ cqlsh -u superuser -p superuser
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.9.1346 | DSE 5.0.3 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
superuser@cqlsh

0 个答案:

没有答案