我已经安装了cassandra和自制软件,我正在尝试创建一个超级用户管理员帐户.当我输入sudo cqlsh -u cassandra -p cassandra时出现此错误:
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;时,会返回:
code = 2100 [Unauthorized] message =“只允许超级用户执行CREATE USER查询”
当我看到这个时,我就像,没有概率,进入我的cassandra.yaml文件,位于/usr/local/etc / cassandra并更改了身份验证器:AllowAllAuthenticator
验证者:PasswordAuthenticator.我保存文件回到cqlsh并再次尝试.结果相同.有人可以告诉我如何设置新用户?
解决方法:
你走在正确的轨道上.默认的超级用户帐户是用户名’cassandra’密码’cassandra’,您正在适当地配置身份验证器.
缺少的是更改cassandra.yaml文件后,需要重新启动cassandra才能使Authenticator更改生效.请注意,您还应将授权程序更改为“CassandraAuthorizer”.
如果您有多节点群集,则应在所有节点上进行此更改,并且还应增加system_auth键空间上的复制因子,以便在拥有数据的节点关闭后允许auth继续工作.