Cassandra 2.0集群的PasswordAuthenticator无法初始化默认用户:“某些节点尚未就绪”

时间:2013-10-08 11:29:08

标签: authentication cassandra cassandra-2.0

如何设置?我有一个复制因子为3的三节点集群,并在启动时收到以下错误:

WARN [NonPeriodicTasks:1] 2013-10-08 14:06:42,751 PasswordAuthenticator.java (line 242) PasswordAuthenticator skipped default user setup: some nodes were not ready
WARN [NonPeriodicTasks:1] 2013-10-08 14:06:42,763 Auth.java (line 223) Skipped default superuser setup: some nodes were not ready

没有创建默认用户,并尝试使用例如登录cqlsh失败:

$ cqlsh mynode myport -u cassandra -p cassandra
Traceback (most recent call last):
  File "/usr/opt/apache-cassandra-2.0.1/bin/cqlsh", line 2031, in <module>
    main(*read_options(sys.argv[1:], os.environ))
  File "/usr/opt/apache-cassandra-2.0.1/bin/cqlsh", line 2017, in main
    display_float_precision=options.float_precision)
  File "/usr/opt/apache-cassandra-2.0.1/bin/cqlsh", line 477, in __init__
    cql_version=cqlver, transport=transport)
  File "/usr/opt/apache-cassandra-2.0.1/bin/../lib/cql-internal-only-1.4.0.zip/cql-1.4.0/cql/connection.py", line 143, in connect
  File "/usr/opt/apache-cassandra-2.0.1/bin/../lib/cql-internal-only-1.4.0.zip/cql-1.4.0/cql/connection.py", line 59, in __init__
  File "/usr/opt/apache-cassandra-2.0.1/bin/../lib/cql-internal-only-1.4.0.zip/cql-1.4.0/cql/thrifteries.py", line 157, in establish_connection
  File "/usr/opt/apache-cassandra-2.0.1/bin/../lib/cql-internal-only-1.4.0.zip/cql-1.4.0/cql/cassandra/Cassandra.py", line 455, in login
  File "/usr/opt/apache-cassandra-2.0.1/bin/../lib/cql-internal-only-1.4.0.zip/cql-1.4.0/cql/cassandra/Cassandra.py", line 476, in recv_login
cql.cassandra.ttypes.AuthenticationException: AuthenticationException(why='Username and/or password are incorrect')

4 个答案:

答案 0 :(得分:1)

错误消息“某些节点未准备好”有点误导,因为似乎原因是群集中有两个其他节点启动并运行但配置为仍然使用AllowAllAuthenticator。关闭其他节点并使用PasswordAuthentitor启动其他节点后,创建默认用户成功:

 INFO [NonPeriodicTasks:1] 2013-10-09 14:44:57,028 PasswordAuthenticator.java (line 237) PasswordAuthenticator created default user 'cassandra'
 INFO [NonPeriodicTasks:1] 2013-10-09 14:44:57,760 Auth.java (line 218) Created default superuser 'cassandra'

答案 1 :(得分:1)

在我的情况下,这是因为数据中心名称已更改,然后由于Puppet而推广到配置文件(cassandra-topology.properties)。因此,已为system_auth配置的NetworkTopologyStrategy失败。

答案 2 :(得分:0)

第一次使用这些选项启动节点时,您必须不串行地更改“authenticator:”和“authorizer:”。当遇到上述错误时,这种方式对我有用。

答案 3 :(得分:0)

如果您使用conf/cassandra-topology.properties,还应检查 PropertyFileSnitch。它应该在所有节点上相同