How Can I Set Up A Superuser Account On Cassandra With Homebrew Build?
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:
- Edit the cassandra.yaml and replaced the authenticator and authorizer values as below.
//authenticator: AllowAllAuthenticator
authenticator: PasswordAuthenticator
//authorizer: AllowAllAuthorizer
authorizer: CassandraAuthorizer
Re start the cassandra node
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'
- 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?"