尝试登录到cassandra的控制台(cqlsh),它拒绝我 [英] Trying to login to cassandra's console (cqlsh) and it rejects me

查看:921
本文介绍了尝试登录到cassandra的控制台(cqlsh),它拒绝我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经更新了 cassandra.yaml 与:

 验证者:PasswordAuthenticator 

然后使用replication_factor为3创建了system_auth键空间:

  CREATE KEYSPACE system_auth WITH REPLICATION = {'class':'SimpleStrategy','replication_factor':3}; 

然后使用以下命令重新运行cassandra:

  bin / cassandra 

继续并确保修复我的节点(虽然我不知道为什么这是重要/必要的):

  nodetool修复

即使完成所有这些步骤后,cassandra / / p>

 回溯(最近一次调用)
文件/ home / tscobb / Documents / BM / apache-cassandra- 2.0.5 / bin / cqlsh,行2044,在< module>
main(* read_options(sys.argv [1:],os.environ))
文件/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/cqlsh,行2030,在主
display_float_precision = options.float_precision)
文件/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/cqlsh,第480行,在__init__
cql_version = cqlver,transport = transport)
文件/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/../lib/cql-internal-only-1.4.1。 zip / cql-1.4.1 / cql / connection.py,第143行,在connect
文件/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/../lib/ cql-internal-only-1.4.1.zip/cql-1.4.1/cql/connection.py,第59行,在__init__
文件/home/tscobb/Documents/BM/apache-cassandra-2.0 .5 / bin /../ lib / cql-internal-only-1.4.1.zip / cql-1.4.1 / cql / thrifteries.py,第157行,在establish_connection
文件/ home / tscobb /Documents/BM/apache-cassandra-2.0.5/bin/../lib/cql-internal-only-1.4.1.zip/cql-1.4.1/cql/cassandra/Cas​​sandra.py,第465行,在登录
文件/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/../lib/cql-internal-only-1.4.1.zip/cql-1.4.1/ cql / cassandra / Cassandra.py,行486,在recv_login
cql.cassandra.ttypes.AuthenticationException:AuthenticationException(为什么='org.apache.cassandra.exceptions.UnavailableException:无法实现一致性级别QUORUM')

老实说,在这一点上,我不知道如何继续。如果有人有任何想法,将非常感激。



我在Ubuntu vm中运行cassandra 2.0.5。




$ b

此外,当我运行时:

  nodetool status 

出现以下提示:

  nodetool status 
数据中心:datacenter1
=====================
状态=上/下
| /状态=正常/离开/加入/移动
- 地址加载令牌所有者主机ID机架
UN 127.0.0.1 1.57 MB 256 100.0%37ae1d4c -0df5-43d2-9593-4603ac68c34a rack1


解决方案

 'class':'SimpleStrategy','replication_factor':3 

您的群集中只有一个节点,将复制因子设置为3将是您的问题。以下是介绍Cassandra中的复制的文章。你应该给它一个快速阅读。一部分特别适用于此:


当复制因子超过节点数量时,写入
被拒绝,只要满足所需的一致性
级别即可。




  level QUORUM 

Cassandra将Quorum计算为(replication_factor / 2)+ 1.因此,如果你有复制因子为3,那么2个节点需要运行以满足一致性级别。



基本上,将复制因子设置为1,罚款。


I was trying to set up the user authentication for cassandra when I had the following problem.

First I have updated the cassandra.yaml with:

authenticator: PasswordAuthenticator

then created the system_auth keyspace with a replication_factor of 3 as:

CREATE KEYSPACE system_auth WITH REPLICATION =  { 'class' : 'SimpleStrategy', 'replication_factor' : 3};

Then re-ran cassandra with the command:

bin/cassandra

Then after all that, I proceeded and made sure to repair my node(s) with (though I am not sure if I understand why this is important/necessary):

nodetool repair

Even after doing all of those steps cassandra/java yells at me with:

    Traceback (most recent call last):
  File "/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/cqlsh", line 2044, in <module>
    main(*read_options(sys.argv[1:], os.environ))
  File "/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/cqlsh", line 2030, in main
    display_float_precision=options.float_precision)
  File "/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/cqlsh", line 480, in __init__
    cql_version=cqlver, transport=transport)
  File "/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/../lib/cql-internal-only-1.4.1.zip/cql-1.4.1/cql/connection.py", line 143, in connect
  File "/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/../lib/cql-internal-only-1.4.1.zip/cql-1.4.1/cql/connection.py", line 59, in __init__
  File "/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/../lib/cql-internal-only-1.4.1.zip/cql-1.4.1/cql/thrifteries.py", line 157, in establish_connection
  File "/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/../lib/cql-internal-only-1.4.1.zip/cql-1.4.1/cql/cassandra/Cassandra.py", line 465, in login
  File "/home/tscobb/Documents/BM/apache-cassandra-2.0.5/bin/../lib/cql-internal-only-1.4.1.zip/cql-1.4.1/cql/cassandra/Cassandra.py", line 486, in recv_login
cql.cassandra.ttypes.AuthenticationException: AuthenticationException(why='org.apache.cassandra.exceptions.UnavailableException: Cannot achieve consistency level QUORUM')

Honestly, at this point I am not sure how to proceed. If anyone has any ideas, it would be greatly appreciated.

I am running cassandra 2.0.5 in a Ubuntu vm. Not sure if that helps at all.

Also, when I run:

nodetool status

The following comes up:

nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address Load    Tokens  Owns   Host ID                              Rack
UN  127.0.0.1  1.57 MB  256     100.0%  37ae1d4c-0df5-43d2-9593-4603ac68c34a  rack1

解决方案

'class' : 'SimpleStrategy', 'replication_factor' : 3

As you only have one node in your cluster, setting a replication factor of 3 would be your problem. Here is an article that describes replication in Cassandra. You should give it a quick read through. One part in particular applies here:

When replication factor exceeds the number of nodes, writes are rejected, but reads are served as long as the desired consistency level can be met.

Cannot achieve consistency level QUORUM

Cassandra computes "Quorum" as (replication_factor / 2) + 1. So if you have a replication factor of 3, then 2 nodes need to be running for your consistency level to be met.

Basically, set your replication factor back down to 1, and you should be fine.

这篇关于尝试登录到cassandra的控制台(cqlsh),它拒绝我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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