【发布时间】:2022-01-06 22:13:54
【问题描述】:
我以默认 cassandra 用户身份登录时尝试在 Cassandra 中创建角色,但弹出此错误:
[root@node1 ~]# cqlsh -u admin -p admin@123
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.0.0 | Cassandra 4.0.1 | CQL spec 3.4.5 | Native protocol v5]
Use HELP for help.
admin@cqlsh> CREATE ROLE cassweb WITH PASSWORD = 'Cassweb@1234' AND SUPERUSER = true AND LOGIN = true;
Unauthorized: Error from server: code=2100 [Unauthorized] message="Only superusers can create a role with superuser status"
我还应该注意,我已在 cassandra.yaml 文件中将 authenticator: AllowAllAuthenticator 更改为 authenticator: PasswordAuthenticator 和 authorizer: AllowAllAuthorizer 为 authorizer: CassandraAuthorizer 并在进行这些更改后重新启动了 Cassandra 服务,但错误仍然弹出。
【问题讨论】:
-
只是一个观察,但 Cassandra 并没有要求它或 cqlsh 以“root”用户身份运行。事实上,创建一个特殊的“cassandra”用户应该是您部署过程的一部分。