Oracle by Example brandingChanging Apache Cassandra Administrator Password in Oracle Data Hub Cloud Service

section 0Before 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?


section 2Reset Apache Cassandra Administrator Password

Perform the following steps on ALL the nodes in the cluster, node-by-node:

  1. In the active SSH command prompt, make sure that you are logged in as the oracle user. To login as the oracle user, enter the following at command prompt as the opc user:
    $ sudo su oracle
    $ whoami
    # oracle

    If the output of whoami is oracle, it means that you have successfully logged in as the oracle user.

  2. 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:

  3. Edit the /u01/data/conf/cassandra/cassandra.yaml file and replace the following lines:
    authenticator: PasswordAuthenticator
    authorizer: CassandraAuthorizer
    with:
    authenticator: AllowAllAuthenticator
    authorizer: AllowAllAuthorizer
  4. Reboot the VM.
    $ exit
    $ reboot

    Reboot may take a couple of minutes.

  5. After the reboot is complete, restart the SSH session and login as the oracle user:
    $ sudo su oracle
  6. Now, connect to the cqlsh command 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>
  7. Reset your password to cassandra by executing the following commands:
    cqlsh> UPDATE system_auth.roles SET salted_hash = '$2a$10$1gMPBy9zSkDzKxdbU2v/gOslcMRPDcXVqmwQYBmi8MVgYvNdRZw/.' WHERE role = '';
    cqlsh> exit
  8. Undo the changes made in the /u01/data/conf/cassandra/cassandra.yaml file by replacing the following lines:
    authenticator: AllowAllAuthenticator
    authorizer: AllowAllAuthorizer
    with:
    authenticator: PasswordAuthenticator
    authorizer: CassandraAuthorizer
  9. Reboot the VM again and login as the oracle user.
    $ exit
    $ reboot
    $ sudo su oracle

    Reboot may take a couple of minutes.

  10. 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> 
  11. Exit the cqlsh prompt.
    @cqlsh> exit

    Now 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 cassandra is unsecure.


section 1Change Apache Cassandra Administrator Password

Perform the following steps on ALL the nodes in the cluster, node-by-node:

  1. Make sure you are logged in as the oracle user, and connect to the cqlsh command 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 cassandra by 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>
  2. Alter the password for the user by entering the following query in the cqlsh prompt:
    @cqlsh> ALTER user  with PASSWORD '';

    If you don't receive an error, the password is changed successfully.

  3. Exit the cqlsh prompt.
    @cqlsh> exit
  4. 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>
  5. Exit the cqlsh prompt.
    @cqlsh> exit

more informationWant to Learn More?