This section describes the installation of Foglight for Cassandra. Follow the steps in the order specified below:
In order to allow full monitoring of Cassandra, the agent will require a user with sufficient privilege to execute system queries. For JMX monitoring, remote JMX connections must also be enabled on each node.
Using a superuser role or a role with user creation permissions, connect via cqlsh to a node on the cluster and create a new user for the Foglight Agent as follows:
For versions of Cassandra >= 2.2 or DSE >= 5.0, 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 versions of Cassandra >= 3.0:
GRANT SELECT ON TABLE system_schema.tables to <username>;
For versions of Cassandra >= 2.2 but less than 3.0:
GRANT SELECT ON TABLE system.schema_columnfamilies to <username>;
Using the more specific permissions on any version >=2.2 use the following if running DSE:
GRANT SELECT ON TABLE dse_perf.node_slow_log to <username>;
For versions of Cassandra < 2.2 or DSE <= 4.8:
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
There are two JMX access permissions to choose between:
The below instructions cover common steps used to configure a TLS/SSL connection from the Cassandra Agent client. A full treatment of TLS/SSL keys, certificates, and certificate authorities (CA) is beyond the scope of this document. The following instructions assume familiarity with TLS/SSL concepts and tools. Client and certificate authority certificates must be available prior to proceeding.
In order to use SSL, your Cassandra cluster must include SSL support and allow SSL connections. There are various configurations options for client connections. Refer to the Cassandra documentation and verify that the current Cassandra server configuration parameters support the desired authentication.
The Foglight agent, in its capacity as a database client, requires access to a private key, its signed certificate, and the signing CA’s certificate. The client key and certificate must be imported into a keystore, and the CA certificate must be imported into a separate truststore.
One example method for generating a JKS keystore for use with Foglight utilizes openssl and keytool. Set the key and certificate filenames, alias name, and keystore password as appropriate.
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-10 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, go to step 7, deactivate the agent, update the configuration, and then reactivate the agent.
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. A collection can be turned off by setting its period 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';
Note: Doing this will remove the monitoring agents as well as the historical data already collected. If you wish to delete only the agents, you can do that on the Administration > Agents > Agent Status page. Because the Databases dashboard only shows databases which are being actively monitored, you will only be able to view these databases by going 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.