Skip to content Skip to sidebar Skip to footer

How Can I Set Up A Superuser Account On Cassandra With Homebrew Build?

I have installed cassandra with homebrew and am trying to create a superuser admin account. when I type sudo cqlsh -u cassandra -p cassandra I get this error: Python Cassandra driv

Solution 1:

You are on the right track. The default superuser account is username 'cassandra' password 'cassandra' and you are appropriately configuring the authenticator.

What's missing is that after changing the cassandra.yaml file, you need to restart cassandra in order for the Authenticator change to take effect. Note that you should also change the authorizer to 'CassandraAuthorizer'.

If you have a multi-node cluster, you should make this change on all nodes and you should also increase the replication factor on the system_auth keyspace in order to allow auth to continue working after the node owning the data goes down.

Solution 2:

I was facing the issue to create a new user, after connecting cassandra node from cqlsh as cqlsh -u cassandra -p cassandra.

Solution worked out to me is:

  1. Edit the cassandra.yaml and replaced the authenticator and authorizer values as below.

//authenticator: AllowAllAuthenticator

authenticator: PasswordAuthenticator

//authorizer: AllowAllAuthorizer

authorizer: CassandraAuthorizer

  1. Re start the cassandra node

  2. connect from cqlsh with cassandra/cassandra credentials

4.Watched out a system.log(tail -f system.log), you should see following message.

INFO [NonPeriodicTasks:1] 2015-04-23 11:02:03,973 PasswordAuthenticator.java:215 - PasswordAuthenticator created default user 'cassandra'

INFO [NonPeriodicTasks:1] 2015-04-23 11:02:03,987 Auth.java:277 - Created default superuser 'cassandra'

  1. Before to this I didn't have "system_auth" key space, after this change now am able to see "system_auth" key space and "credentials" table.

Solution 3:

Note: for Cassandra 2.2 and later

"CREATE USER is supported for backwards compatibility. Authentication and authorization for Cassandra 2.2 and later are based on ROLES, and CREATE ROLE should be used."

Take a look at: Creating a new user using ROLE


Answering your question, this worked for me:

In the configuration file of Cassandra, cassandra.yaml modify these lines:

Comment this line:

authenticator: AllowAllAuthenticator

and replace for:

authenticator: PasswordAuthenticator

Comment this line:

authorizer: AllowAllAuthorizer

and replace for:

authorizer: CassandraAuthorizer

After that, you can create your own super user:

create user your_user_name with password 'your_password' superuser;

Post a Comment for "How Can I Set Up A Superuser Account On Cassandra With Homebrew Build?"