欢迎投稿

今日深度:

cassandra如何设置用户名和密码,cassandra用户名

cassandra如何设置用户名和密码,cassandra用户名


转自http://zhaoyanblog.com/archives/307.html

1、首先修改配置文件 cassandra.yaml

把默认的authenticator: AllowAllAuthenticator运行所有人登录设置为用密码登录:

authenticator: PasswordAuthenticator

2、登录cassandra创建用户

使用默认账户登录cassandra

在bin目录下执行

./cqlsh -ucassandra -pcassandra

创建用户

CREATE USER myusername WITH PASSWORD 'mypassword' SUPERUSER ;

3、使用新用户登录

删除默认帐号:

DROP USER cassandra ;
4、java使用用户名密码访问cassandra

Cluster cluster = Cluster.builder()
.addContactPoint("192.168.22.161")
.withCredentials("myusername", "mypassword")
.build();



www.htsjk.Com true http://www.htsjk.com/cassandra/28545.html NewsArticle cassandra如何设置用户名和密码,cassandra用户名 转自 : http://zhaoyanblog.com/archives/307.html 1、首先修改配置文件 cassandra.yaml 把默认的authenticator: AllowAllAuthenticator运行所有人登录设置为用密码...
相关文章
    暂无相关文章
评论暂时关闭