2017년 9월 20일 수요일

[Cassandra] allowing remote access and security setting

allowing remote access

As default, cassandra is not allowing remote access from the other client outside.
To allow the access from the other client, we can change the setting in cassandra.yaml file.

Open the cassandra setting file.

sudo vi /etc/cassandra/cassandra.yaml

Change the setting related in rpc_address and broadcast_rpc_address.

rpc_address : 0.0.0.0
broadcast_rpc_address : 1.2.3.4

The default value of rpc_address is 'localhost',so we can change this value as 0.0.0.0 that means wild card.
broadcast_rpc_address is remarked as default, if you set the rpc_address as 0.0.0.0 , you should remove that remark.

Now cassandra is allowing the access from the client outside.
However, that client can control this cassandra without any authentication.
So you should set securty setting for your cassandra.


setting security

In cassandra setting file, change the value of authenticator.

authenticator: PasswordAuthenticator

The default value of authenticator is AllowAllAuthenticator, and we change the value to 'PasswordAuthenticator'.
As default, the administrator account is set by cassandra/cassandra.
For security, we will remove that account ,and create new super user.

Login cassandra as administrator.

cqlsh -u cassandra -p cassandra

Add new super user.

create user root with password 'password' superuser;

After log in by super user, and remove the account of cassandra.

cqlsh -u root -p password
drop user cassandra;

Check the setting is applied correctly.

list users;

reference : http://www.bloger.kr/54

댓글 없음 :

댓글 쓰기