nodetool version
Displays the Cassandra version running on the node.
Synopsis
Section titled “Synopsis”nodetool [connection_options] versionSee connection options for connection options.
Description
Section titled “Description”nodetool version returns the release version of the Cassandra instance running on the connected node. This is essential for:
- Verifying deployment consistency across nodes
- Confirming successful upgrades
- Troubleshooting compatibility issues
- Documentation and audit purposes
Output
Section titled “Output”Standard Output
Section titled “Standard Output”ReleaseVersion: 4.1.3The version follows semantic versioning: MAJOR.MINOR.PATCH
| Component | Meaning |
|---|---|
| MAJOR | Significant changes, may include breaking changes |
| MINOR | New features, backward compatible |
| PATCH | Bug fixes, backward compatible |
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”nodetool versionOutput:
ReleaseVersion: 4.1.3Cluster-Wide Version Check
Section titled “Cluster-Wide Version Check”#!/bin/bash# Check versions across all nodes using SSH
for node in node1 node2 node3 node4 node5; do echo -n "$node: " ssh "$node" "nodetool version"doneOutput:
node1: ReleaseVersion: 4.1.3node2: ReleaseVersion: 4.1.3node3: ReleaseVersion: 4.1.3node4: ReleaseVersion: 4.1.3node5: ReleaseVersion: 4.1.3Version Only (Scripting)
Section titled “Version Only (Scripting)”nodetool version | awk '{print $2}'Output:
4.1.3When to Use
Section titled “When to Use”Pre-Upgrade Verification
Section titled “Pre-Upgrade Verification”Document current versions before upgrading:
#!/bin/bashecho "=== Pre-Upgrade Versions ==="for node in $(nodetool status | grep -E "^UN|^DN" | awk '{print $2}'); do version=$(ssh "$node" 'nodetool version' | awk '{print $2}') echo "$node: $version"done > pre_upgrade_versions.txtPost-Upgrade Verification
Section titled “Post-Upgrade Verification”Confirm all nodes upgraded successfully:
#!/bin/bashecho "=== Post-Upgrade Verification ==="expected="4.1.4"for node in $(nodetool status | grep -E "^UN|^DN" | awk '{print $2}'); do actual=$(ssh "$node" 'nodetool version' | awk '{print $2}') if [ "$actual" = "$expected" ]; then echo "$node: $actual ✓" else echo "$node: $actual ✗ (expected $expected)" fidoneMixed Version Detection
Section titled “Mixed Version Detection”Identify nodes running different versions:
#!/bin/bash# Collect all versions via SSHnodetool status | grep -E "^UN|^DN" | awk '{print $2}' | while read node; do ssh "$node" 'nodetool version'done | sort | uniq -cOutput showing mixed versions:
3 ReleaseVersion: 4.1.3 2 ReleaseVersion: 4.1.2Compatibility Checking
Section titled “Compatibility Checking”Before connecting tools or drivers:
version=$(nodetool version | awk '{print $2}')major=$(echo $version | cut -d. -f1)
if [ "$major" -ge 5 ]; then echo "Cassandra 5.x features available"else echo "Running Cassandra 4.x"fiVersion Compatibility
Section titled “Version Compatibility”Major Version Features
Section titled “Major Version Features”| Version | Key Features |
|---|---|
| 5.0 | Accord, Vector Search, Unified Compaction |
| 4.1 | Guardrails, Pluggable memtable |
| 4.0 | Virtual tables, Audit logging, Full query logging |
| 3.11 | Last 3.x release, LTS |
| 3.0 | Materialized views, SASI indexes |
Upgrade Path Considerations
Section titled “Upgrade Path Considerations”| From | To | Notes |
|---|---|---|
| 3.11.x | 4.0.x | Supported direct upgrade |
| 3.0.x | 4.0.x | Upgrade to 3.11.x first |
| 4.0.x | 4.1.x | Supported direct upgrade |
| 4.1.x | 5.0.x | Supported direct upgrade |
Mixed Versions
Running mixed versions should only be temporary during rolling upgrades. All nodes should run the same version in steady state.
Detailed Version Information
Section titled “Detailed Version Information”For more comprehensive version and build details:
# Version onlynodetool version
# Full node information including versionnodetool info | head -10Additional Version Details from info
Section titled “Additional Version Details from info”nodetool infoShows:
ID : 12345678-1234-1234-1234-123456789012Gossip active : trueNative Transport active: trueLoad : 256.5 GiBGeneration No : 1699876543Uptime (seconds) : 864000Heap Memory (MB) : 4096.00 / 8192.00...Version Verification Script
Section titled “Version Verification Script”#!/bin/bash# check_cluster_versions.sh - Verify all nodes run expected version
EXPECTED_VERSION="${1:-}"
if [ -z "$EXPECTED_VERSION" ]; then echo "Usage: $0 <expected_version>" echo "Example: $0 4.1.3" exit 1fi
echo "Checking cluster for version: $EXPECTED_VERSION"echo "============================================="
# Get all nodes from local nodetool statusnodes=$(nodetool status | grep -E "^UN|^DN|^UJ|^UL" | awk '{print $2}')mismatch=0unreachable=0
for node in $nodes; do actual=$(ssh "$node" 'nodetool version' 2>/dev/null | awk '{print $2}')
if [ -z "$actual" ]; then echo "$node: UNREACHABLE" ((unreachable++)) elif [ "$actual" = "$EXPECTED_VERSION" ]; then echo "$node: $actual ✓" else echo "$node: $actual ✗ (expected $EXPECTED_VERSION)" ((mismatch++)) fidone
echo "============================================="echo "Summary:"echo " Expected version: $EXPECTED_VERSION"echo " Version mismatches: $mismatch"echo " Unreachable nodes: $unreachable"
if [ $mismatch -gt 0 ] || [ $unreachable -gt 0 ]; then exit 1fiecho "All nodes running expected version"Monitoring Integration
Section titled “Monitoring Integration”Prometheus/Metrics
Section titled “Prometheus/Metrics”# Export version as metricversion=$(nodetool version | awk '{print $2}')echo "cassandra_version{version=\"$version\"} 1"Health Check Script
Section titled “Health Check Script”#!/bin/bash# Include version in health check output (run locally on each node)
health_check() { local version=$(nodetool version 2>/dev/null | awk '{print $2}') local status=$(nodetool status 2>/dev/null | grep "$(hostname -i)" | awk '{print $1}')
echo "{\"node\": \"$(hostname)\", \"version\": \"$version\", \"status\": \"$status\"}"}
health_checkTroubleshooting
Section titled “Troubleshooting”Cannot Connect to Node
Section titled “Cannot Connect to Node”nodetool version# Error: Failed to connect to '127.0.0.1:7199'Causes:
- Cassandra not running
- JMX not enabled
- Firewall blocking JMX port
Resolution:
# Check if Cassandra is runningpgrep -f CassandraDaemon
# Check JMX portnetstat -tlnp | grep 7199
# Check logstail /var/log/cassandra/system.logVersion Mismatch After Upgrade
Section titled “Version Mismatch After Upgrade”If nodes show different versions after upgrade:
# Verify package versiondpkg -l | grep cassandra # Debian/Ubunturpm -qa | grep cassandra # RHEL/CentOS
# Verify running versionnodetool version
# If mismatch, may need restartsystemctl restart cassandraRelated Information
Section titled “Related Information”Version in Logs
Section titled “Version in Logs”Cassandra logs the version on startup:
grep -i "cassandra version" /var/log/cassandra/system.log | tail -1Version in System Tables
Section titled “Version in System Tables”-- CQL query for versionSELECT release_version FROM system.local;Build Information
Section titled “Build Information”For detailed build info:
# Check build info in logsgrep -i "build" /var/log/cassandra/system.log | head -5
# Or from cassandra binarycassandra -vBest Practices
Section titled “Best Practices”Version Management Guidelines
- Document versions - Maintain records of deployed versions
- Verify after upgrades - Always check all nodes post-upgrade
- Minimize mixed time - Complete rolling upgrades promptly
- Monitor for drift - Include version in monitoring
- Test compatibility - Verify driver/tool compatibility with version
- Follow upgrade paths - Don't skip major versions
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| info | Detailed node information |
| describecluster | Cluster-wide information |
| status | Cluster status overview |
| upgradesstables | Upgrade SSTable format |