Cassandra 2.0 cluster's PasswordAuthenticator fails to init default user: "some nodes were not ready"

StackOverflow https://stackoverflow.com/questions/19246533

Question

How to setup this? I have a three node cluster with replication factor 3, and getting the following errors at startup:

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

No default user is created, and trying to log in with e.g. cqlsh fails:

$ 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')
Était-ce utile?

La solution

The error message "some nodes were not ready" is somewhat misguiding, as it seems that the reason was having two other nodes in the cluster up and running but configured to still use the AllowAllAuthenticator. After bringing down the other nodes and starting up the one with PasswordAuthentitor, creating default user succeeds:

 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'

Autres conseils

In my case it was because the datacenter name was changed and then rolled out to the config files (cassandra-topology.properties) thanks to Puppet. Therefore the already configured NetworkTopologyStrategy for system_auth failed.

You have to change "authenticator:" and "authorizer:" in serial not in parallel when starting the node first time with these options. This way worked for me when struggling with above error.

You should also check conf/cassandra-topology.properties if you are using PropertyFileSnitch. It should be same across all the nodes

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top