如何在Cassandra上使用homebrew构建设置超级用户帐户? [英] How can I set up a superuser account on Cassandra with homebrew build?

查看:928
本文介绍了如何在Cassandra上使用homebrew构建设置超级用户帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装cassandra与自制软件,我正在创建超级用户管理帐户。当我输入 sudo cqlsh -u cassandra -p cassandra 我得到这个错误:

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 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

它没有sudo,我允许进入cqlsh与默认登录。问题是,当我键入 CREATE USER admn WITH PASSWORD'pw'SUPERUSER; 时,会返回:

when I do it without sudo, I am allowed into cqlsh with the default login. Problem is that when I type CREATE USER admn WITH PASSWORD 'pw' SUPERUSER;, this gets returned:

code> code = 2100 [Unauthorized] message =只有超级用户可以执行CREATE USER查询

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

我是,没有故障,并进入我的cassandra.yaml文件,位于 / usr / local / etc / cassandra 并更改 authenticationator:AllowAllAuthenticator
authenticationator:PasswordAuthenticator 。我保存的文件返回到cqlsh并再次尝试。结果相同。有人可以告诉我如何设置新用户吗?

When I saw this I was like, no prob, and got into my cassandra.yaml file, located in /usr/local/etc/cassandra and changed authenticator: AllowAllAuthenticator to authenticator: PasswordAuthenticator. I saved the file went back to the cqlsh and tried again. Same result. Can somebody please tell me what to do to set up new users?

推荐答案

您在正确的轨道上。默认超级用户帐户是用户名cassandra密码cassandra,并且您正在正确配置验证器。

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

缺少的是在更改cassandra.yaml文件后,重新启动cassandra,以使Authenticator更改生效。请注意,您还应将授权人更改为CassandraAuthorizer。

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'.

如果您有多节点群集,则应在所有节点上进行此更改, system_auth键空间上的复制因子,以便在拥有数据的节点关闭后允许auth继续工作。

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.

这篇关于如何在Cassandra上使用homebrew构建设置超级用户帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆