How can I install sjk into cassandra / nodetool? - cassandra

I found interesting page in cassandra documentation:
https://docs.datastax.com/en/cassandra/3.0/cassandra/tools/toolsSjk.html
However, when I try it, I get
# nodetool sjk --commands
nodetool: Found unexpected parameters: [sjk, --commands]
See 'nodetool help' or 'nodetool help <command>'.
I suppose it's because in my standard cassandra 3.11.3 debian instalation the sjk is not installed. However, it seems the sjk is free tool:
https://github.com/aragozin/jvm-tools
Is it possible to install it in way it integrates with nodetool? How? Or is sjk already integrated and was it just renamed?

While still no idea how to integrate it with nodetool, for case someone who knows even less than me finds this, note that it can be used by downloading as sjk-plus-0.12.jar for example, then run like
java -jar sjk-plus-0.12.jar mxdump -s 127.0.01:7199 -q 'java.lang:type=GarbageCollector,name=*'

In Apache Cassandra sjk is not available with nodetool utility but available in datastax. you need to use sjk jar for the metrix and details.

Related

How to install Cassandra?

How do I download and install Apache Cassandra?
Assuming that you've already done this, but here's the Apache Cassandra download page: https://cassandra.apache.org/_/download.html
Following the links to download the current GA release should put an Apache Cassandra tarball in your ~/Downloads directory. I'd recommend moving that:
cd ~
mv ~/Downloads/apache-cassandra-4.0.6-bin.tar.gz .
Next, untar it:
tar -zxvf apache-cassandra-4.0.6-bin.tar.gz
That will create a directory containing Apache Cassandra. To start Cassandra cd into that directory and execute the cassandra binary.
cd apache-cassandra-4.0.6
bin/cassandra -p cassandra.pid
You should see several messages, but this indicates a successful start:
StorageService.java:2785 - Node localhost/127.0.0.1:7000 state jump to NORMAL
Running Cassandra like this with the -p option will put the process ID into the cassandra.pid file and run it in the background. To stop Cassandra, simply run a kill on the contents of the file.
kill `cat cassandra.pid`
Powershell script execution unavailable. Please use 'powershell Set-ExecutionPolicy Unrestricted' on this user-account to run cassandra with fully featured functionality on this platform. Starting with legacy startup options JAVA_HOME environment variable must be set!
Ahh... You're trying to run Cassandra on Windows! That's an important detail to mention. Cassandra used to ship with Powershell scripts for this purpose...which were removed with version 4.0. Your options:
Run Apache Cassandra 3.11, which still has the Powershell scripts.
Run Apache Cassandra 4.0 using local virtualization/containerization.
Last year I posted a video on how run Cassandra 4.0 locally on Windows using Minikube: Setting up Cassandra 4.0 locally on a Windows Machine
You can also use the official Cassandra container image on Docker Hub, assuming your company allows it, and you don't mind it missing important things like security.

Datastax CE Cassandra migrate to Apache Cassandra

I have Datastax community edition 2.2.11 Cassandra with 90 nodes in a cluster.
I am trying to migrate to Apache Cassandra 2.2.11
First I would like to try in my test environment but couldn't find any documentation Is there a pattern or a way that I should do the migration?
Anybody who has experience?
Steps:
Alter the keyspaces using "EverywhereStrategy" to "SimpleStrategy". "EverywhereStrategy" is not supported by Apache cassandra.
There's one or two keyspaces that uses it, dse_system is one of them.
Run nodetool drain before shutting down the existing Cassandra service.
Stop cassandra services.
Back up your Cassandra configuration files from the old installation.
Update java version if needed.
Install the binaries (via tarball, apt-get, yum, etc...) for the apache Cassandra.
Configure the new product.
Compare, merge and update any modifications you have previously made into the new configuration files for the apache version (cassandra.yaml, cassandra-env.sh, etc.).
Start the cassandra services.
Check the logs for warnings, errors, and exceptions.
tail -f /var/logs/cassandra/system.log # or path where you set your logs.
Run nodetool upgradesstables
"nodetool upgradesstables"
(The upgradesstables step can be run on each node after the nodes done with migration.)
Check the logs for warnings, errors, and exceptions.
tail -f /var/logs/cassandra/system.log # or path where you set your logs.
Check the status of the cluster
nodetool status
Repeat theses upgrade steps on each node in the cluster.

How to use OpsCenter with CCM?

I'm new to Cassandra and want to run OpsCenter on my development cluster which I created with CCM.
I see CCM has a -o option for configuring OpsCenter as mention here. However, it is not clear how to use this option.
Here is what I've attempted thus far:
ccm create test_cluster -v 2.1.2 -o OPSCENTER
ccm populate -n 3
ccm start -v
When I open OpsCenter I see: 3 agents failed to connect
ccm create -h for -o OPSCENTER shows: Download and use provided opscenter version to install with DSE. Will have no effect on cassandra installs)
It's not clear to me how to proceed.
The '-o' option specifies what version of Opscenter to download and install. As far as I can tell, it only works if you provide '--dse' when you create your CCM cluster. DSE and Opscenter support was only recently added, so it may be that no one has done the work to make it work for non-DSE setups.
Here's an example:
$ ccm create --dse -v 4.6.0 --dse-username=myusername --dse-password=mypassword -o 5.0.2 -n 3 dse460
Downloading http://downloads.datastax.com/community/opscenter-5.0.2.tar.gz to /var/folders/nw/5f2tsw817ln2smczw1hx_tx00000gn/T/ccm-NwRIFb.tar.gz (68.589MB)
71920484 [100.00%]
Extracting /var/folders/nw/5f2tsw817ln2smczw1hx_tx00000gn/T/ccm-NwRIFb.tar.gz as version opsc5.0.2 ...
Downloading http://downloads.datastax.com/enterprise/dse-4.6.0-bin.tar.gz to /var/folders/nw/5f2tsw817ln2smczw1hx_tx00000gn/T/ccm-1_ON_p.tar.gz (511.738MB)
536595851 [100.00%]
Extracting /var/folders/nw/5f2tsw817ln2smczw1hx_tx00000gn/T/ccm-1_ON_p.tar.gz as version 4.6.0 ...
Current cluster is now: dse460
$ ccm start
After my cluster starts Opscenter is running at http://localhost:8888 with all 3 agents connected.
Since CCM downloads and installs Opscenter Community Edition, it probably can be made to work without the requirement to run DSE. Since ccm is open source, that might be a nice feature that someone can add. I think it's useful so I may look into it unless someone else is already on it.
I used this alternative approach:
Use CCM to create nodes
Manually install OpsCenter
Manually install and configure Agents for each Node as explained in this documentation.

Cassandra Nodetool can't find NodeCmd from Git Bash

I'm running Cassandra 2.0.9 with Java 1.7.0 on Windows. I can run nodetool normally from the Windows command line, but I'm not able to run it from the Git Bash (directly from terminal or through a sh script) or Cygwin when running .sh files that call NodeTool (but otherwise can run it).
The exact error I get is:
Error: Could not find or load main class org.apache.cassandra.tools.NodeCmd
I haven't done any kind of extra configuration outside of the recommended changes Datastax recommends, and I haven't had any other issues with Cassandra. I don't think I have any environment screw ups (but who knows what could be wrong). Has anyone else run into this issue before? Thanks!

Cassandra RandomPartitioner on version 1.2.3

Im installing Cassandra 1.2.3 on debian using apt, I was previously using a tarball 1.1.7 install. After install i'm changing the partitioner from Murmur3Partitioner to RandomPartitioner in cassandra.yaml as follows:
partitioner: org.apache.cassandra.dht.RandomPartitioner
Then on starting i'm seeing incompatible system keyspace errors as follows:
ERROR 18:22:11,465 Cannot open /var/lib/cassandra/data/system/schema_keyspaces/system-schema_keyspaces-ib-1; partitioner org.apache.cassandra.dht.Murmur3Partitioner does not match system partitioner org.apache.cassandra.dht.RandomPartitioner. Note that the default partitioner starting with Cassandra 1.2 is Murmur3Partitioner, so you will need to edit that to match your old partitioner if upgrading.
Service exit with a return value of 1
How can I set the system keyspace to be RandomPartitioner? I have tried purging the data folder, apt-get remove, also apt-get purge then re-installing, changing to RandomPartitioner then starting cassandra but it is still failing. I've also replicated this on my ubuntu desktop so im thinking im doing something wrong here.
Any help is appreciated!
Cheers
Sam
The partitioner cannot be changed once Cassandra has started for the first time. This error is showing that the data directory was initialized with Murmur3Partitioner but you're starting it using RandomPartitioner.
If you're trying to upgrade your data from your 1.1 install, Cassandra isn't reading from the right place. Adjust your data directory to use your 1.1 directory and it should start with partitioner set to RandomPartitioner.
If you're trying to start with no data, stop Cassandra, remove /var/lib/cassandra/* and start it again. Note you need to remove the commitlog directory as well as the data directory.
I got a similar error as reported by Sam when I did a
[root#fedora user]# dse cassandra.
To correct the problem I did:
[root#fedora user]# vi /etc/dse/cassandra/cassandra.yaml
In the cassandra.yaml file made the following change
Commented out "# partitioner: org.apache.cassandra.dht.Murmur3Partitioner" and replaced it with "partitioner: org.apache.cassandra.dht.RandomPartitioner"
3. Saved the change in cassandra.yaml
Hope this helps.
Mayukh.

Resources