xjfromsh
xjfromsh

Reputation: 103

Does Cassandra 2.0.6 not support ROLE in cqlsh?

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

Upvotes: 1

Views: 27

Answers (1)

Aaron
Aaron

Reputation: 57748

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:

How do you create the first user in Cassandra DB

Upvotes: 1

Related Questions