How can I create a superuser account on Cassandra using a home build?

I installed cassandra with homebrew and am trying to create a superuser administrator account. when I type sudo cqlsh -u cassandra -p cassandra, I get this error:

Python Cassandra driver not installed, or not on PYTHONPATH.
You might try "pip install cassandra-driver".
Python: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Module load path: ['/usr/local/Cellar/cassandra/2.1.2/bin', '/Library/Python/2.7/site-packages/cql-1.4.0-py2.7.egg', '/Library/Python/2.7/site-packages/thrift-0.9.2-py2.7-macosx-10.10-intel.egg', '/Library/Python/2.7/site-packages/ccm-2.0.2-py2.7.egg', '/Library/Python/2.7/site-packages/tailer-0.3-py2.7.egg', '/Library/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/psutil-2.2.0-py2.7-macosx-10.10-intel.egg', '/Library/Python/2.7/site-packages/pip-6.0.6-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']

Error: No module named cassandra

when I do this without sudo, I can login to cqlsh with the default login. The problem is that when you enter CREATE USER admn WITH PASSWORD 'pw' SUPERUSER;this returns:

code=2100 [Unauthorized] message="Only superusers are allowed to perform CREATE USER queries"

When I saw this, I was no problem and ended up in my cassandra.yaml file located in /usr/local/etc/cassandraand changing authenticator: AllowAllAuthenticator to authenticator: PasswordAuthenticator. I saved the file that returned to cqlsh and tried again. The same result. Can someone please tell me what to do to set up new users?

+4
3

. - 'cassandra' password 'cassandra', .

, cassandra.yaml cassandra, Authenticator . , "CassandraAuthorizer".

multi- node, , system_auth, auth , node, .

+3

cassandra node cqlsh cqlsh -u cassandra -p cassandra.

, , :

  • cassandra.yaml , .

//authenticator: AllowAllAuthenticator

: PasswordAuthenticator

//authorizer: AllowAllAuthorizer

authorizer: CassandraAuthorizer

  1. cassandra node

  2. cqlsh cassandra/cassandra

4. system.log(tail -f system.log), .

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

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

  1. "system_auth", "system_auth" " ".
+2

: Cassandra 2.2

"CREATE USER . Cassandra 2.2 ROLES, CREATE ROLE .

: ROLE


, :

Cassandra cassandra.yaml :

:

authenticator: AllowAllAuthenticator

:

authenticator: PasswordAuthenticator

Comment this line:

authorizer: AllowAllAuthorizer

and replace for:

authorizer: CassandraAuthorizer

After that, you can create your own superuser:

create the user your_user_name with the superuser password your_password;

+2
source

All Articles