Add Apache Cassandra Database

You can add Apache Cassandra Database entities using the Add Entity UI or using the cloud agent command line interface (omcli) with the appropriate JSON files.

Step 1: Prepare Apache Cassandra Database for monitoring.

Prerequisites
The default settings for Cassandra make JMX accessible only from the local host. If you want to enable remote JMX connections, change the LOCAL_JMX setting in cassandra-env.sh and enable authentication and/or SSL. To do this, perform the following procedure:
  1. Open the cassandra-env.sh file for editing and update or add these lines:
    JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=true"
    JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.password.file=/etc/cassandra/jmxremote.password"
    
    If the LOCAL_JMX setting is in your file, set it to no:
    LOCAL_JMX=no
  2. Depending on whether the JDK or JRE is installed:

    • Copy the jmxremote.password.template from /jdk_install_location/jre/lib/management/ to /etc/cassandra/ and rename it to jmxremote.password

      $ cp /jdk_install_dir/lib/management/jmxremote.password.template /etc/cassandra/jmxremote.password

    • Copy the jmxremote.password.template from /jre_install_location/lib/management/ to /etc/cassandra/ and rename it to jmxremote.password

      $ cp /jre_install_dir/lib/management/jmxremote.password.template /etc/cassandra/jmxremote.password

  3. Change the ownership of the jmxremote.password to the user you use to run Cassandra and change permission to read-only:
    $ chown cassandra:cassandra /etc/cassandra/jmxremote.password
    $ chmod 400 /etc/cassandra/jmxremote.password
  4. Edit jmxremote.password and add the user and password for JMX-compliant utilities:
    monitorRole QED
    controlRole R&D
    cassandra cassandrapassword

    Note:

    The Cassandra user and Cassandra password shown in the above sample are examples. Specify the user and password for your environment.
  5. Add the Cassandra user with read and write permission to /jre_install_location/lib/management/jmxremote.access
    monitorRole readonly
    cassandra readwrite
    controlRole readwrite \
    create javax.management.monitor.,javax.management.timer. \
    unregister
  6. Restart Cassandra.

Step 2: Decide how you want to add the Apache Cassandra Database.

You can add Apache Cassandra Database entities using one of two ways:

  • Add them from UI
  • Use the agent's omcli add_entity command with the appropriate JSON files

Adding Entities from the UI

  1. From the Management Cloud main menu, select Administration, Discovery, and then Add Entity. The Add Entity page displays.
  2. Select the Apache Cassandra Database Entity Type.
  3. Enter the following UI properties.
    Apache Cassandra DB UI Fields
    • Entity Name: Name of this entity displayed in the Oracle Management Cloud console.
    • Host Name: Fully-qualified Host Name where Cassandra database is installed.
    • Port: Apache Cassandra Database port.
    • Cloud Agent: Cloud agent monitoring the host where the Apache Cassandra DB is installed.

    Monitoring Credentials (Cassandra JMX Credentials)

    • Username: Cassandra DB username.
    • Password: Password used for authentication.

See Add Entities from the Console for detailed instructions on using the Add Entity UI.

Using omcli and the Appropriate JSON Files

  1. Download and extract the required JSON file(s) from the master JSON zip file. See the table below for the specific JSON files you'll need.
  2. Edit the file(s) and specify the requisite properties shown below.
    Apache Cassandra DB JSON Files and Properties

    Definition File: omc_cassandra_db.json

    • displayName: This is Apache Cassandra Database Entity Display Name which is displayed in the Oracle Infrastructure Monitoring UI
    • timezoneRegion: Time Zone Example: PDT, GMT
    • omc_url: connection url to connect to the installed Apache Cassandra database; host:port
    • host_name : Fully-qualified Host Name where Cassandra database is installed.
    • omc_port : Apache Cassandra Database port.
    • cassandra_home: Location of the Cassandra Installation directory.

    Credential File: omc_cassandra_db_creds.json

    • DBUserName: Cassandra DB username.
    • DBPassword: Cassandra DB user password.
  3. Add the entity using omcli.
    omcli add_entity agent DEFINITION_FILE [-credential_file CREDENTIAL_FILE [-encryption_method_gpg]] 
  4. Verify the status of the newly added entity.
    omcli status_entity agent DEFINITION_FILE

See step 4. Adding Entities to Your Service of Add Entities Using JSON Files for more information.

Step 3: (Optional but recommended) Set up alerts.

To enable lights-out monitoring, you can set up alert rules to generate alerts and send notifications if your entities have performance issues.

See Set Up Alert Rules and Set Up Alert Thresholds and Notifications.

Troubleshooting

If you run into any issues regarding discovery or monitoring of Apache Cassandra Database, see the following: