设置cassandra用户名和密码

参考http://zhaoyanblog.com/archives/307.html

 

修改cassandra.yaml配置文件

把默认的

authenticator: AllowAllAuthenticator

改成

authenticator: PasswordAuthenticator

 

如果你需要登陆进去以后查看修改权限之类,需要修改

authorizer: AllowAllAuthorizer

authorizer: CassandraAuthorizer

 

启动cassandra

cql连接,cassandra是默认账户和密码

./cqlsh -u cassandra -p cassandra ip port

 

创建用户

CREATE USER myusername WITH PASSWORD 'mypassword' SUPERUSER ;

这里用户有两种,一个是superuser,一种是nosuperuser

 

cqlsh退出以后,用新用户登陆

drop user cassandra;

 

注意,如果是集群模式,只需要在一台机器上配置就可以了,会自动同步过去

posted @ 2015-02-22 15:32  自由出土文物  阅读(4394)  评论(0编辑  收藏  举报