SUPERUSER不会传播到其他地区

时间:2016-12-13 10:15:41

标签: cassandra cqlsh

我使用Cassandra 3.9。

我在AWS上有两个数据中心。

每个数据中心包含3个节点作为我的数据库服务器。

当我通过执行CREATE USER 'hello' WITH PASSWORD 'world' SUPERUSER在一个节点中创建超级用户时,我收到以下错误。

NoHostAvailable:

但是,有趣的是,当我执行LIST USERS时,用户hello被列为超级用户,我可以使用此用户和密码登录cqlsh。

我可以在同一数据中心的其他两个节点中登录cqlsh,但我无法在其他数据中心的任何节点中登录cqlsh。这对我来说很奇怪,因为一切都应该通过这两个数据中心传播。我想强调的是,每个数据用户输入都在这些数据中心内传播而没有任何问题。那么为什么超级用户不会传播?

当我尝试在其他数据中心登录cqlsh时,收到以下错误。

Connection error: ('Unable to connect to any servers', {'172.51.11.232': AuthenticationFailed('Failed to authenticate to 172.51.11.232: Error from server: code=0100 [Bad credentials] message="org.apache.cassandra.exceptions.UnavailableException: Cannot achieve consistency level LOCAL_ONE"',)})

我没有特别改变这些数据中心之间的任何内容。

我确保在每个cassandra.yaml文件中将authenticator设置为PasswordAuthenticator并将authorizer设置为CassandraAuthorizer,然后通过这两个数据中心重新启动每个节点中的cassandra。< / p>

我感谢任何建议。

更新 以下是执行DESCRIBE KEYSPACE system_auth

的结果
CREATE KEYSPACE system_auth WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

1 个答案:

答案 0 :(得分:2)

系统密钥空间的复制策略(保持用户数据等)是错误的:

CREATE KEYSPACE system_auth WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;

应该更改它以匹配“常规”键空间的复制策略,至少对于数据中心部分,可能每个数据中心具有更高的复制因子。