Cassandra 2.0.6 不支持在 cqlsh 中使用 ROLE 吗?

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

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时期回答过类似的问题:

https://stackoverflow.com/questions/22213786/how-do-you-create-the-first-user-in-cassandra-db/22227678#22227678

英文:

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:

https://stackoverflow.com/questions/22213786/how-do-you-create-the-first-user-in-cassandra-db/22227678#22227678

huangapple
  • 本文由 发表于 2023年1月9日 19:49:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75056847.html
匿名

发表评论

匿名网友

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

确定