Cassandra賬號設置

1、配置文件修改


cd apache-cassandra-3.7/conf/

vim cassandra.yaml 

#默認是不需要賬號即可訪問的

authenticator: PasswordAuthenticator #默認AllowAllAuthenticator 

authorizer: CassandraAuthorizer             #默認AllowAllAuthorizer


重啓,令配置生效。

2、設置賬號


1、經過前面修改cassandra.yaml 後,authenticator和authorizer的配置會驗證訪客,默認有個cassandra@cassandra賬號

2、用cassandra@cassandra賬號登錄

#cqlsh -u cassandra -p cassandra 192.168.30.229

賬戶類型有兩種,一個是superuser,一種是nosuperuser,顧名思義就可以知道是什麼意思。

添加一個密碼爲"111111"的superuser賬號ershixiong

cqlsh>CREATE USER ershixiong WITH PASSWORD '111111' SUPERUSER;
Ctrl+d 退出cqlsh
用ershixiong賬號登錄
#cqlsh -u ershixiong -p 111111 spark129 9042
刪除原有賬號cassandra
cqlsh>drop user cassandra;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章