system_auth 复制而不改变 replication_factor,为什么要改变它?
system_auth replicates without changing replication_factor, so why change it?
我有一个 PasswordAuthenticator
登录名,用户 = cassandra
,system_auth
RF = 1 和 2 个非种子节点。当我更改密码时,即使 RF = 1,它也会传播到非种子节点。那么为什么要更改 RF? (The reason I ask is: I noticed if I change it to 3 before the other nodes are up --> I can't login: QUORUM error, so this is a bootstrapping question)
cassandra@cqlsh:system_auth> SELECT * FROM system_schema.keyspaces;
keyspace_name | durable_writes | replication
--------------------+----------------+---------------------------------------------------------------------------------------
system_auth | True | {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1'}
如果不进行更改,可能会出现两个问题:
- 在多节点集群中,如果负责您的 user/role 数据的节点崩溃,您将无法登录。
- 在多 DC 集群中,如果您尝试使用“本地”数据中心连接您的应用程序,您将只能连接到包含您的 user/role 数据的 DC 中的节点。这是因为
SimpleStrategy
不 DC 感知。不改变它也只会在集群中存储一个副本,它只会在一个 DC 中。在其他 DC 上的登录尝试将失败。
总之,我推荐:
- 永远不要使用
SimpleStrategy
。对生产MDHA(多数据中心高可用)没有用,为什么要用它搭建下层环境?
- 将
system_auth
上的 RF 设置为节点数,但不要超过 3 个。
- 正在创建一个额外的超级用户,并更改 cassandra/cassandra 用户的密码...不再使用它。默认情况下,cassandra/cassandra 用户会在
QUORUM
触发 cqlsh 内部的一些特殊操作。如果节点崩溃,您不希望出现额外的问题。
这是一个相关的答案,应该会有所帮助:Replication Factor to use for system_auth
我有一个 PasswordAuthenticator
登录名,用户 = cassandra
,system_auth
RF = 1 和 2 个非种子节点。当我更改密码时,即使 RF = 1,它也会传播到非种子节点。那么为什么要更改 RF? (The reason I ask is: I noticed if I change it to 3 before the other nodes are up --> I can't login: QUORUM error, so this is a bootstrapping question)
cassandra@cqlsh:system_auth> SELECT * FROM system_schema.keyspaces;
keyspace_name | durable_writes | replication
--------------------+----------------+---------------------------------------------------------------------------------------
system_auth | True | {'class': 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '1'}
如果不进行更改,可能会出现两个问题:
- 在多节点集群中,如果负责您的 user/role 数据的节点崩溃,您将无法登录。
- 在多 DC 集群中,如果您尝试使用“本地”数据中心连接您的应用程序,您将只能连接到包含您的 user/role 数据的 DC 中的节点。这是因为
SimpleStrategy
不 DC 感知。不改变它也只会在集群中存储一个副本,它只会在一个 DC 中。在其他 DC 上的登录尝试将失败。
总之,我推荐:
- 永远不要使用
SimpleStrategy
。对生产MDHA(多数据中心高可用)没有用,为什么要用它搭建下层环境? - 将
system_auth
上的 RF 设置为节点数,但不要超过 3 个。 - 正在创建一个额外的超级用户,并更改 cassandra/cassandra 用户的密码...不再使用它。默认情况下,cassandra/cassandra 用户会在
QUORUM
触发 cqlsh 内部的一些特殊操作。如果节点崩溃,您不希望出现额外的问题。
这是一个相关的答案,应该会有所帮助:Replication Factor to use for system_auth