Before You Begin
This 10-minute tutorial shows you how to change or reset your Apache Cassandra Administrator password in Oracle Data Hub Cloud Service.
Note that changing Apache Cassandra Administrator password also changes the password for the Management Console (also known as Service Console).
Background
Oracle Data Hub Cloud Service enables you to consistently provision and manage NoSQL database clusters such as Apache Cassandra on Oracle Cloud.
Oracle Data Hub Cloud Service leverages Oracle’s Infrastructure Cloud Services to deliver a secure and elastic integrated platform.
What Do You Need?
- A running cluster in Oracle Data Hub Cloud Service. See Getting Started with Oracle Data Hub Cloud Service.
- Active SSH connection to a node in the cluster. See Connecting to a Cluster Node Through Secure Shell (SSH).
Reset Apache Cassandra Administrator Password
Perform the following steps on ALL the nodes in the cluster, node-by-node:
- In the active SSH command prompt, make sure that you are logged in as the
oracleuser. To login as theoracleuser, enter the following at command prompt as theopcuser:$ sudo su oracle $ whoami # oracleIf the output of
whoamiisoracle,it means that you have successfully logged in as the oracle user. -
If you remember you current password, skip to the Change Apache Cassandra Administrator Password section of this tutorial.
If you don't remember your current password, enter the following values and continue:
Field Value Administrator Username: Node IP Address: - Edit the
/u01/data/conf/cassandra/cassandra.yamlfile and replace the following lines:
with:authenticator: PasswordAuthenticator authorizer: CassandraAuthorizerauthenticator: AllowAllAuthenticator authorizer: AllowAllAuthorizer - Reboot the VM.
$ exit $ rebootReboot may take a couple of minutes.
- After the reboot is complete, restart the SSH session and login as the
oracleuser:$ sudo su oracle - Now, connect to the
cqlshcommand line by entering the following command:$ cqlsh Connected to cluster_name at :9042. [cqlsh 5.0.1 | Cassandra 3.11 | CQL spec 3.4.4 | Native protocol v4] Use HELP for help. cqlsh> - Reset your password to
cassandraby executing the following commands:cqlsh> UPDATE system_auth.roles SET salted_hash = '$2a$10$1gMPBy9zSkDzKxdbU2v/gOslcMRPDcXVqmwQYBmi8MVgYvNdRZw/.' WHERE role = ''; cqlsh> exit - Undo the changes made in the
/u01/data/conf/cassandra/cassandra.yamlfile by replacing the following lines:
with:authenticator: AllowAllAuthenticator authorizer: AllowAllAuthorizerauthenticator: PasswordAuthenticator authorizer: CassandraAuthorizer - Reboot the VM again and login as the
oracleuser.$ exit $ reboot $ sudo su oracleReboot may take a couple of minutes.
- Verify that your password is changed by logging in with the default password
cassandra.$ cqlsh -u -p cassandra Connected to cluster_name at :9042. [cqlsh 5.0.1 | Cassandra 3.11 | CQL spec 3.4.4 | Native protocol v4] Use HELP for help. @cqlsh> - Exit the
cqlshprompt.@cqlsh> exitNow change your password by following the steps in the next section.
Note: It is highly recommended that you change your password as the default password
cassandrais unsecure.
Change Apache Cassandra Administrator Password
Perform the following steps on ALL the nodes in the cluster, node-by-node:
- Make sure you are logged in as the
oracleuser, and connect to thecqlshcommand line by entering the following values and using the command that follows.Field Value Administrator Username: Current Administrator Password: New Administrator Password: Node IP Address: If you have forgotten your current password, reset your password to
cassandraby performing the steps in the Reset Apache Cassandra Administrator Password section of this tutorial.$ cqlsh -u -p Connected to cluster_name at :9042. [cqlsh 5.0.1 | Cassandra 3.11 | CQL spec 3.4.4 | Native protocol v4] Use HELP for help. @cqlsh> - Alter the password for the user by entering the following query in the
cqlshprompt:@cqlsh> ALTER user with PASSWORD '';If you don't receive an error, the password is changed successfully.
- Exit the
cqlshprompt.@cqlsh> exit - Verify that your password is changed by logging in with your new password.
$ cqlsh -u -p Connected to cluster_name at :9042. [cqlsh 5.0.1 | Cassandra 3.11 | CQL spec 3.4.4 | Native protocol v4] Use HELP for help. @cqlsh> - Exit the
cqlshprompt.@cqlsh> exit
Want to Learn More?
- Creating an Apache Cassandra Cluster in Oracle Data Hub Cloud Service
- Typical Workflow for Oracle Data Hub Cloud Service
- Oracle Help Center page for Oracle Data Hub Cloud Service
Changing Apache Cassandra Administrator Password in Oracle Data Hub Cloud Service