如何在Cassandra shell中创建用户?

huangapple go评论56阅读模式
英文:

How do I create users in the Cassandra shell?

问题

我是新手,正在尝试使用Cassandra部署一个应用程序。我在我的Cassandra数据库中创建了一个键空间,但是当我创建键空间帐户时,出现了以下错误:

我尝试了许多方法,比如创建用户和创建角色,但都没有成功。我正在使用的版本是3.11.13。

CREATE ROLE etl WITH PASSWORD = 'xxxxxx' AND LOGIN = true;
InvalidRequest: Error from server: code=2200 [Invalid query]
message="org.apache.cassandra.auth.CassandraRoleManager doesn't support PASSWORD"
CREATE ROLE
CREATE USER
英文:

I'm new to Cassandra and trying to deploy an application using Cassandra. I created a keyspace in my Cassandra DB but when I create my keyspace account I get an error like below

I have tried many ways like create user and create roles but it doesn't work. The version I am using is 3.11.13

CREATE ROLE etl WITH PASSWORD = 'xxxxxx' AND LOGIN = true;
InvalidRequest: Error from server: code=2200 [Invalid query]
message="org.apache.cassandra.auth.CassandraRoleManager doesn't support PASSWORD"
CREATE ROLE
CREATE USER

答案1

得分: 1

错误表明您尚未在您的集群中启用身份验证。

只有在您配置了PasswordAuthenticator时,才支持PASSWORD选项。默认情况下,cassandra.yaml中禁用了身份验证:

authenticator: AllowAllAuthenticator

您需要使用密码验证器配置节点以启用身份验证:

authenticator: PasswordAuthenticator

有关详细信息,请参阅Cassandra 3.11中启用密码身份验证。干杯!

英文:

The error indicates that you haven't enabled authentication in your cluster.

The PASSWORD option is only supported if you have configured PasswordAuthenticator. By default, authentication is disabled in cassandra.yaml with:

authenticator: AllowAllAuthenticator

You need to configure the nodes with the password authenticator to enable authentication:

authenticator: PasswordAuthenticator

For details, see Enabling Password Authentication in Cassandra 3.11. Cheers!

huangapple
  • 本文由 发表于 2023年5月29日 12:03:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76354613.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定