英文:
Does Cassandra 2.0.6 not support ROLE in cqlsh?
问题
遇到了Cassandra 2.0.6的问题。
我想通过cqlsh创建一个新的Cassandra角色,使用以下create role命令。然而,它返回了Bad Request错误消息。
cqlsh> CREATE ROLE abc WITH SUPERUSER=true AND LOGIN=true AND PASSWORD='mypass';
Bad Request: line 1:7 no viable alternative at input 'ROLE'
我在Cassandra 2.2.x上运行相同的命令,一切正常。
如果有人能帮助我理解这个问题的原因是什么?Cassandra 2.0.6不支持cqlsh中的ROLE吗?
如果是这样,有什么替代选项吗?
非常感谢!
Jun
英文:
I encountered an issue with Cassandra 2.0.6.
I want to create a new role in Cassandra via cqlsh as following create role command. However, it returns Bad Request error message.
cqlsh> CREATE ROLE abc WITH SUPERUSER=true AND LOGIN=true AND PASSWORD='mypass';
Bad Request: line 1:7 no viable alternative at input 'ROLE'
I run the same command on Cassandra 2.2.x, it was good.
If anyone can help me understand the reason of it? Does Cassandra 2.0.6 not support ROLE in cqlsh?
If so, what is the alternative option?
Thank you so much!
Jun
答案1
得分: 1
正确。角色基础访问控制(RBAC)在Cassandra 2.2中是新功能。
在2.0版本中,您需要执行CREATE USER
命令:
CREATE USER abc WITH PASSWORD='mypass' SUPERUSER;
这应该可以工作(2.0版本也没有LOGIN选项)。
我在2.0/2.1时期回答过类似的问题:
英文:
Correct. Role Based Access Control (RBAC) was new to Cassandra in 2.2.
With 2.0, you’ll need to do a CREATE USER
instead:
CREATE USER abc WITH PASSWORD='mypass' SUPERUSER;
That should work (2.0 also does not have the LOGIN option).
I answered a similar question back in the 2.0/2.1 days:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论