Authentication in Cassandra
Authentication in Cassandra
Authentication in Cassandra is disabled by default. Which allows any one on your network to connect to the database.
To enable authentication we must make changes in the main configuration file in Cassandra, the "Cassandra.yaml" file.
The default file:
Changes to perform in cassandra.yaml file in order to enable authentication:
Make the above changes and save the file. The changes to make effect on the node we must restart the node.
Command used for restarting the node:
nodetool drain; nodetool stopdaemon; cassandra
Now if we try to connect with the database. It throws the following error.
Now it is asking for username and password. The default username and password after enabling authentication is
username = cassandra
password = cassandra
cqlsh -u cassandra -p cassandra
Every one who uses Cassandra knows about this default username and password. So, if we continue with the same user and password then there is no need of enabling authentication.
For that we can follow two steps:
- Create a new user and password.
- Change the password of Cassandra user.
Comments
Post a Comment