如何在不更改源代码的情况下重置默认的Cassandra凭据?
我检查过类似的问题,例如如何重置丢失的Cassandra管理员用户的密码?.我有三个Datastax Cassandra 2.0.8节点集群,我正在尝试实现身份验证.我在所有节点中设置了cassandra.yaml并重新启动它们.问题是我仍然无法登录到cqlsh.
我还尝试在cqlsh中为cassandra用户重置密码(我已禁用身份验证):
update system_auth.credentials set salted_hash='$2a$10$vbfmLdkQdUz3Rmw.fF7Ygu6GuphqHndpJKTvElqAciUJ4SZ3pwquu' where username='cassandra';
Run Code Online (Sandbox Code Playgroud)
在日志中有关于创建cassandra超级用户的信息.我检查了密钥空间system_auth,它包括凭据,权限和用户.凭证列系列确实包含用户cassandra:
cqlsh> use system_auth;
cqlsh:system_auth> select * from credentials;
username | options | salted_hash
-----------+---------+---------------------------------------------------------- ----
cassandra | null | $2a$10$vbfmLdkQdUz3Rmw.fF7Ygu6GuphqHndpJKTvElqAciUJ4SZ3pw quu
(1 rows)
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试时:
./cqlsh -u cassandra -p cassandra
Run Code Online (Sandbox Code Playgroud)
我得到例外,该用户不存在,但我没有权限创建一个.
cql.cassandra.ttypes.AuthenticationException: AuthenticationException(why="User cassandra doesn't exist - create it with CREATE USER query first")
Run Code Online (Sandbox Code Playgroud)