Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
cassandra-仅允许超级用户执行创建用户查询_Cassandra_Cql_Cqlsh - Fatal编程技术网

cassandra-仅允许超级用户执行创建用户查询

cassandra-仅允许超级用户执行创建用户查询,cassandra,cql,cqlsh,Cassandra,Cql,Cqlsh,我正在用Java1.7.0\u60-b19在卡桑德拉2.0.8上的Ubuntu 14.10上登录 cqlsh -u cassandra -p cassandra 我在跑步: CREATE USER a WITH PASSWORD 'a' NOSUPERUSER; 我得到了一个错误: Bad Request: Only superusers are allowed to perform CREATE USER queries 推理问题-我以超级用户身份登录 我的问题是:如果我以Cassand

我正在用Java1.7.0\u60-b19在卡桑德拉2.0.8上的Ubuntu 14.10上登录

cqlsh -u cassandra -p cassandra
我在跑步:

CREATE USER a WITH PASSWORD 'a' NOSUPERUSER;
我得到了一个错误:

Bad Request: Only superusers are allowed to perform CREATE USER queries
推理问题-我以超级用户身份登录


我的问题是:如果我以Cassandra用户的身份登录cqlsh,为什么会告诉我我不是超级用户?

您需要在Cassandra.yaml文件中启用PasswordAuthenticator。 要启用PasswordAuthenticator,您需要更改cassandra.yaml中的authenticator属性

改变

authenticator: AllowAllAuthenticator

之后,使用以下命令登录,然后您将能够添加新用户

cqlsh -u cassandra -p cassandra

1在您的计算机上查找并打开“cassandra.yaml”文件

2在文件中查找并删除“authenticator:AllowAllAuthenticator”

3将其替换为“authenticator:PasswordAuthenticator”

4另外,添加此行:“授权人:CassandraAuthorizer”

重新启动卡桑德拉。 如果使用brew,可以使用重新启动

brew服务重新启动cassandra

然后再次登录到cql shell:

cqlsh-u cassandra-p cassandra localhost

创建一个新的超级用户

创建超级用户为TRUE、登录名为TRUE、密码为“”的角色

卡桑德拉出口

出口

使用新的超级用户登录登录

cql-u

然后你输入密码,你就进入了


万一有人也希望授予权限,您需要将下面的内容添加到cassandra.yaml中。authorizer:cassandraauthorizer在cassandra.yaml中设置验证器之前,它假定您是匿名用户。因此,您没有创建超级用户的权限。
cqlsh -u cassandra -p cassandra