Skip to content

Commit b3c56a7

Browse files
[O11y][Cassandra] Add documentation for Jolokia setup (#9817)
* Add documentation for Jolokia setup in the README * update changelog.yml * address review comments * update changelog.yml * address review comments * Update packages/cassandra/changelog.yml
1 parent 2f989f5 commit b3c56a7

File tree

4 files changed

+134
-3
lines changed

4 files changed

+134
-3
lines changed

packages/cassandra/_dev/build/docs/README.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,70 @@ This integration periodically fetches metrics from [Cassandra](https://cassandra
66

77
This integration has been tested against `Cassandra version 3.11.11`.
88

9-
### Troubleshooting
9+
## Steps to Setup Jolokia
10+
11+
### Prerequisites
12+
13+
- Java Development Kit (JDK) 1.8 or later
14+
- Apache Cassandra 3.x or 4.x (depending on user's version)
15+
- Jolokia agent JAR file
16+
17+
### Jolokia Setup
18+
19+
Follow these steps to set up Jolokia for monitoring Apache Cassandra:
20+
21+
1. Download the Jolokia JVM Agent:
22+
23+
Visit the [Jolokia official download page](https://repo1.maven.org/maven2/org/jolokia/jolokia-jvm/) to obtain the latest version of the Jolokia JVM agent JAR file. Download the `jolokia-jvm-<jolokia_version>-agent.jar` file.
24+
25+
2. Copy the Jolokia Agent to Cassandra's Library Directory:
26+
27+
Copy the downloaded `jolokia-jvm-<jolokia_version>-agent.jar` file to the Cassandra library directory on the server where Cassandra is installed.
28+
29+
For example:
30+
31+
```bash
32+
cp jolokia-jvm-<jolokia_version>-agent.jar /path/to/cassandra/lib/
33+
```
34+
35+
Replace `/path/to/cassandra/lib/` with the actual path to Cassandra's library directory.
36+
37+
3. Configure Cassandra to use the Jolokia Agent:
38+
39+
Open the `cassandra-env.sh` file, located in the Cassandra configuration directory, using a text editor, and add the following line at the bottom of the file:
40+
41+
```
42+
JVM_OPTS="$JVM_OPTS -javaagent:/path/to/jolokia-jvm-<jolokia_version>-agent.jar=port=<jolokia_port>,host=0.0.0.0"
43+
```
44+
45+
Replace `/path/to/jolokia-jvm-<version>-agent.jar` with the actual path to the Jolokia agent JAR file copied in Step 2. Save the changes and close the `cassandra-env.sh` file.
46+
47+
4. Restart Cassandra:
48+
49+
Restart the Apache Cassandra service to apply the changes made to the configuration.
50+
51+
> Note:
52+
- Restarting the Apache Cassandra service will temporarily disrupt database connectivity. Ensure that dependent services are designed to handle such interruptions gracefully.
53+
- Immediately after a restart, Cassandra's performance may be impacted due to cold caches and commit log replay. Allow some time for the system to stabilize.
54+
- Before restarting Cassandra, ensure that no cluster maintenance tasks are in progress to prevent any unintended consequences.
55+
- The exact steps will vary based on the installation type, the setup process might differ based on the specific deployment method or environment.
56+
- Procedures for restarting Cassandra may vary based on user's specific setup and configuration.
57+
58+
## Verifying the setup
59+
60+
After restarting Cassandra, user can verify that Jolokia is properly set up by accessing the Jolokia endpoint:
61+
62+
```
63+
http://<cassandra-host>:<jolokia_port>/jolokia
64+
```
65+
66+
Replace with the hostname or IP address of user's Cassandra server.
67+
68+
If the setup is successful, user should see a JSON response containing information about the available Jolokia operations and the Cassandra instance.
69+
70+
User can now use Jolokia to monitor and manage Apache Cassandra cluster.
71+
72+
## Troubleshooting
1073

1174
- If `log.flags` appears conflicted under the ``logs-*`` data view, this issue can be resolved by [reindexing](https://www.elastic.co/guide/en/elasticsearch/reference/current/use-a-data-stream.html#reindex-with-a-data-stream) the ``Logs`` data stream.
1275

packages/cassandra/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "1.12.2"
3+
changes:
4+
- description: Add documentation for setting up Jolokia to monitor Apache Cassandra.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/9817
27
- version: "1.12.1"
38
changes:
49
- description: Update README with reindexing steps.

packages/cassandra/docs/README.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,70 @@ This integration periodically fetches metrics from [Cassandra](https://cassandra
66

77
This integration has been tested against `Cassandra version 3.11.11`.
88

9-
### Troubleshooting
9+
## Steps to Setup Jolokia
10+
11+
### Prerequisites
12+
13+
- Java Development Kit (JDK) 1.8 or later
14+
- Apache Cassandra 3.x or 4.x (depending on user's version)
15+
- Jolokia agent JAR file
16+
17+
### Jolokia Setup
18+
19+
Follow these steps to set up Jolokia for monitoring Apache Cassandra:
20+
21+
1. Download the Jolokia JVM Agent:
22+
23+
Visit the [Jolokia official download page](https://repo1.maven.org/maven2/org/jolokia/jolokia-jvm/) to obtain the latest version of the Jolokia JVM agent JAR file. Download the `jolokia-jvm-<jolokia_version>-agent.jar` file.
24+
25+
2. Copy the Jolokia Agent to Cassandra's Library Directory:
26+
27+
Copy the downloaded `jolokia-jvm-<jolokia_version>-agent.jar` file to the Cassandra library directory on the server where Cassandra is installed.
28+
29+
For example:
30+
31+
```bash
32+
cp jolokia-jvm-<jolokia_version>-agent.jar /path/to/cassandra/lib/
33+
```
34+
35+
Replace `/path/to/cassandra/lib/` with the actual path to Cassandra's library directory.
36+
37+
3. Configure Cassandra to use the Jolokia Agent:
38+
39+
Open the `cassandra-env.sh` file, located in the Cassandra configuration directory, using a text editor, and add the following line at the bottom of the file:
40+
41+
```
42+
JVM_OPTS="$JVM_OPTS -javaagent:/path/to/jolokia-jvm-<jolokia_version>-agent.jar=port=<jolokia_port>,host=0.0.0.0"
43+
```
44+
45+
Replace `/path/to/jolokia-jvm-<version>-agent.jar` with the actual path to the Jolokia agent JAR file copied in Step 2. Save the changes and close the `cassandra-env.sh` file.
46+
47+
4. Restart Cassandra:
48+
49+
Restart the Apache Cassandra service to apply the changes made to the configuration.
50+
51+
> Note:
52+
- Restarting the Apache Cassandra service will temporarily disrupt database connectivity. Ensure that dependent services are designed to handle such interruptions gracefully.
53+
- Immediately after a restart, Cassandra's performance may be impacted due to cold caches and commit log replay. Allow some time for the system to stabilize.
54+
- Before restarting Cassandra, ensure that no cluster maintenance tasks are in progress to prevent any unintended consequences.
55+
- The exact steps will vary based on the installation type, the setup process might differ based on the specific deployment method or environment.
56+
- Procedures for restarting Cassandra may vary based on user's specific setup and configuration.
57+
58+
## Verifying the setup
59+
60+
After restarting Cassandra, user can verify that Jolokia is properly set up by accessing the Jolokia endpoint:
61+
62+
```
63+
http://<cassandra-host>:<jolokia_port>/jolokia
64+
```
65+
66+
Replace with the hostname or IP address of user's Cassandra server.
67+
68+
If the setup is successful, user should see a JSON response containing information about the available Jolokia operations and the Cassandra instance.
69+
70+
User can now use Jolokia to monitor and manage Apache Cassandra cluster.
71+
72+
## Troubleshooting
1073

1174
- If `log.flags` appears conflicted under the ``logs-*`` data view, this issue can be resolved by [reindexing](https://www.elastic.co/guide/en/elasticsearch/reference/current/use-a-data-stream.html#reindex-with-a-data-stream) the ``Logs`` data stream.
1275

packages/cassandra/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: "3.0.2"
22
name: cassandra
33
title: Cassandra
4-
version: "1.12.1"
4+
version: "1.12.2"
55
description: This Elastic integration collects logs and metrics from cassandra.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)