我目前正在运行一个节点。我正在尝试为 Cassandra 启用密码身份验证。
我正在遵循本指南:http://cassandra.apache.org/doc/latest/operating/security.html#password-authentication
我会注意到我没有改变 system_auth
的复制,因为它是一个单节点集群。
我编辑了 cassandra.yaml
使用 authenticator: PasswordAuthenticator
.
然后我重新启动了 cassandra 并尝试了命令 cqlsh -u cassandra -p cassandra
,但这给了我错误:
Connection error: ('Unable to connect to any servers',
{'127.0.0.1': AuthenticationFailed(u'Failed to authenticate to 127.0.0.1:
code=0100 [Bad credentials] message="org.apache.cassandra.exceptions.
UnavailableException: Cannot achieve consistency level QUORUM"',)})
我试过运行
nodetool repair
但它说:Replication factor is 1. No repair is needed for keyspace 'system_auth'
我该如何解决这个问题?
最佳答案
我设法解决了这个问题。
我不得不跑 ALTER KEYSPACE system_auth WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
因为它被设置为 {'class': 'NetworkTopologyStrategy', 'DC1': '1', 'DC2': '1'}
以前,即使它是一个单节点集群。
这就是它无法达到 QUORUM 的原因。
关于Cassandra - 无法达到一致性级别 QUORUM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44883940/