This section describes the installation of Foglight for Cassandra. Follow the steps in the order specified below:
To enable full monitoring of Cassandra, the agent requires a user account with sufficient privileges to execute system queries. For JMX monitoring, remote JMX connections must be enabled on each node.
Using a superuser role or a role with permission to create users, connect to a node in the cluster using cqlsh, and create a new user for the Foglight Agent as follows:
Cassandra version 2.2 or later
For Cassandra version 2.2 or later, or DSE version 5.0 or later, create a user as follows:
CREATE ROLE IF NOT EXISTS <username> WITH PASSWORD = '<your-password>' AND LOGIN = true AND SUPERUSER = false;
There are then two ways to set permissions. The simpler way is to use the following single permission:
GRANT SELECT ON ALL KEYSPACES to <username>;
It is also possible to use more specific permissions:
GRANT SELECT ON TABLE system.local to <username>;
GRANT SELECT ON TABLE system.peers to <username>;
GRANT SELECT ON TABLE system_traces.events to <username>;
GRANT SELECT ON TABLE system_traces.sessions to <username>;
GRANT SELECT ON TABLE system_auth.roles to <username>;
Using specific permissions, there is one version-dependent permission. For Cassandra version 3.0 or later:
GRANT SELECT ON TABLE system_schema.tables to <username>;
For Cassandra versions 2.2 through 2.x (but earlier than 3.0):
GRANT SELECT ON TABLE system.schema_columnfamilies to <username>;
If you are using DataStax Enterprise (DSE) on version 2.2 or later, use the following permissions:
GRANT SELECT ON TABLE dse_perf.node_slow_log to <username>;
Cassandra versions earlier than 2.2
For Cassandra versions earlier than 2.2 or DSE version 4.8 and earlier:
CREATE USER IF NOT EXISTS <username> WITH PASSWORD '<your-password>' NOSUPERUSER;
GRANT SELECT ON ALL KEYSPACES TO <username>;
Enable remote JMX authentication as per the instructions at either of the following links:
Only a single user needs to be added to the jmxremote.password and jmxremote.access files for Foglight monitoring and administration. The following is the full (template) content of a sample jmxremote.password file:
<your-JMX-username> <your-JMX-password>
The following is the full (template) content of a sample jmxremote.access file:
<your-JMX-username> readwrite
You can select between two JMX access permission options:
The following instructions outline common steps to configure a TLS/SSL connection from the Cassandra Agent client. A comprehensive discussion of TLS/SSL keys, certificates, and certificate authorities (CAs) is beyond the scope of this document. These instructions assume familiarity with TLS/SSL concepts and related tools. Ensure that the required client and CA certificates are available before proceeding.
To use SSL, your Cassandra cluster must support SSL and be configured to allow secure client connections. Multiple configuration options are available for client authentication. Refer to the official Cassandra documentation to confirm that your server configuration supports the intended authentication method.
As a database client, the Foglight Agent requires access to the following:
The client key and certificate must be imported into a Java KeyStore (JKS), and the CA certificate must be imported into a separate truststore.
To create a JKS keystore for use with Foglight, you can use tools such as openssl and keytool. When generating the keystore, specify the appropriate filenames for the key and certificate, the alias name, and the keystore password.
openssl pkcs12 \
-export \
-in ${CERT_NAME}.crt \
-inkey ${CERT_NAME}.key \
-name $CERT_NAME \
-out temp-keystore.p12 \
-passout pass:${KEYPASS}
keytool -importkeystore \
-srckeystore temp-keystore.p12 \
-srcstoretype PKCS12 \
-srcstorepass $KEYPASS \
-destkeystore keystore \
-deststoretype JKS \
-deststorepass $KEYPASS
Regardless of how the keystore is constructed, it must list the client certificate as a ‘PrivateKeyEntry’, indicating that it also contains the private key, not just the signed certificate.
Separately, import the CA certificate into a truststore:
keytool -importcert \
-keystore truststore \
-alias $CA_NAME \
-file ${CA_NAME}.crt \
-keypass $TRUSTPASS \
-storepass $TRUSTPASS \
-storetype JKS \
-noprompt
Next, edit the baseline.jvmargs.config file in the <FglAM-install-root>/state/default/config directory and add the following parameters with file paths and passwords appropriate for your system.
vmparameter.0 = "-Djavax.net.ssl.keyStore=/path/to/keystore";
vmparameter.1 = "-Djavax.net.ssl.keyStorePassword=changeit";
vmparameter.2 = "-Djavax.net.ssl.trustStore=/path/to/truststore";
vmparameter.3 = "-Djavax.net.ssl.trustStorePassword=changeit";
Escape any quotes with a backslash (‘\’). On an Agent Manager installed on Windows, use forward slashes in the file paths, like so:
vmparameter.0 = "-Djavax.net.ssl.keyStore=\\"C:/path/to/keystore\\"";
Then, restart the FglAM and continue with the agent configuration, setting the Use TLS/SSL? option in the Agent Properties to true for the driver and/or JMX connections, depending on the Cassandra server configuration.
Agents can be created in one of two ways:
The Agent Installer Wizard simplifies the agent creation and configuration process and can be accessed from the Databases dashboard. For advanced configuration or modification of agent properties post-creation, use the Agent Status dashboard.
Foglight for Cassandra offers a graphical, intuitive interface for creating and configuring agents. This method serves as an alternative to Foglight’s default approach, which involves creating agents and editing their properties through the Agent Status dashboard.
With Foglight for Cassandra, you can use a wizard that provides a unified entry point for adding database instances and configuring them for monitoring.
To run the instance installation wizard:
The database instance gets created and appears in the list of all instances.
If the agent is created successfully but data does not appear, navigate to Administration > Agents > Agent Status and click the icon in the Log File column for the agent you created. In most cases, the reason for the failure will be obvious. You can also refer to the Foglight for Cassandra Installation and Troubleshooting document for common errors and solutions. If the solution requires reconfiguring the agent properties, follow steps 7-11 of the Using the Agent Status Dashboard section.
The Agent Status page can be used to create new agents and configure and manage existing agents. To access the page from the navigation pane, click Administration > Agents > Agent Status.
To create a new agent instance:
Deploy the Cassandra agent package to the FglAM before creating the agent if it has not been deployed yet. Click Deploy Agent Package on the Agent Status or Agent Managers page to perform this.
Considerations for this may include physical or virtual locality to the monitored instance, allocated resources, or grouping with other agents of the same type or monitored environment.
To modify the properties of an existing agent, follow steps 7-11.
This is a full list and explanation of the configurable properties of the Foglight for Cassandra agent. The Agent Installer Wizard provides access to the essential subset of available properties. To modify other properties or modify the agent configuration after creation, use the Agent Status dashboard.
This section includes the following key areas:
The agent requires a connection to the cluster in order to gather information about the cluster and data structure. The agent may be referred to other nodes than the one specified.
The agent requires JMX access to individual nodes in the cluster to gather most operational metrics.
The Collection Periods field list in the agent properties is used to set the sample frequencies. You can disable a collection by setting its collection interval to 0. The defaults are set based on the type of data being collected for relevancy.
SELECT host_id FROM system.local WHERE key='local';
Deleting a monitored Cassandra instance removes both the monitoring agents and all associated historical data.
To remove only the agents without deleting collected data, go to Administration > Agents > Agent Status, and delete the agents from there.
The Databases dashboard displays only actively monitored databases. To view databases that are no longer monitored, navigate directly to the Cassandra dashboard.
Two roles, Cassandra User and Cassandra Administrator, are installed with the cartridge. Viewing Cassandra dashboards requires that a user be assigned one of these or have the core Administrator role. The Set Trace Probability function on the Traces Sample dashboard requires the Cassandra Administrator role.