nodetool reloadssl
Reloads SSL certificates without restarting Cassandra.
Introduced in: Cassandra 4.0
Synopsis
Section titled “Synopsis”nodetool [connection_options] reloadsslSee connection options for connection options.
Description
Section titled “Description”nodetool reloadssl reloads the SSL/TLS certificates configured for client and inter-node encryption. This allows certificate rotation without downtime—essential for maintaining security while keeping the cluster operational.
When to Use
Section titled “When to Use”Certificate Renewal
Section titled “Certificate Renewal”# 1. Copy new certificates to configured locationcp /new/certs/keystore.jks /etc/cassandra/conf/cp /new/certs/truststore.jks /etc/cassandra/conf/
# 2. Reload certificatesnodetool reloadsslCertificate Rotation
Section titled “Certificate Rotation”During security certificate rotation:
# On each node, one at a timenodetool reloadsslAfter Updating Truststore
Section titled “After Updating Truststore”When adding new CA certificates:
# Update truststorekeytool -import -alias newca -file /path/to/new-ca.crt -keystore /etc/cassandra/truststore.jks
# Reloadnodetool reloadsslPrerequisites
Section titled “Prerequisites”Certificate Files
Section titled “Certificate Files”SSL configuration in cassandra.yaml:
server_encryption_options: keystore: /etc/cassandra/conf/keystore.jks keystore_password: changeit truststore: /etc/cassandra/conf/truststore.jks truststore_password: changeit
client_encryption_options: enabled: true keystore: /etc/cassandra/conf/keystore.jks keystore_password: changeit truststore: /etc/cassandra/conf/truststore.jks truststore_password: changeitFile Permissions
Section titled “File Permissions”# Certificates must be readable by Cassandra userchown cassandra:cassandra /etc/cassandra/conf/*.jkschmod 640 /etc/cassandra/conf/*.jksWhat Gets Reloaded
Section titled “What Gets Reloaded”| Component | Reloaded |
|---|---|
| Server keystore | Yes |
| Server truststore | Yes |
| Client keystore | Yes |
| Client truststore | Yes |
| Internode encryption | Yes |
Certificate Rotation Workflow
Section titled “Certificate Rotation Workflow”Complete Rotation Process
Section titled “Complete Rotation Process”# Phase 1: Update truststore with new CA (on all nodes)keytool -import -alias newca -file new-ca.crt -keystore truststore.jks
# On each node:nodetool reloadssl
# Phase 2: Update keystore with new cert (on each node)# Copy new keystorecp new-keystore.jks /etc/cassandra/conf/keystore.jks
nodetool reloadssl
# Phase 3: Remove old CA from truststore (after all nodes updated)keytool -delete -alias oldca -keystore truststore.jks
nodetool reloadsslRolling Update
Section titled “Rolling Update”#!/bin/bash# rotate_certs.sh - Rotate certificates across cluster
NODES="node1 node2 node3"
for node in $NODES; do echo "Updating certificates on $node..."
# Copy new certs (implement your copy mechanism) scp keystore.jks $node:/etc/cassandra/conf/ scp truststore.jks $node:/etc/cassandra/conf/
# Reload on node ssh $node "nodetool reloadssl"
echo "Completed $node, waiting 30s..." sleep 30doneVerification
Section titled “Verification”Before Reload
Section titled “Before Reload”# Check certificate expirationkeytool -list -v -keystore /etc/cassandra/conf/keystore.jks | grep "Valid"After Reload
Section titled “After Reload”# Test SSL connectionopenssl s_client -connect localhost:9042 -showcerts
# Test CQL connectioncqlsh --ssl localhostCheck Logs
Section titled “Check Logs”tail -f /var/log/cassandra/system.log | grep -i sslCommon Issues
Section titled “Common Issues”Certificate File Not Found
Section titled “Certificate File Not Found”ERROR: FileNotFoundException: /etc/cassandra/conf/keystore.jksSolution:
# Verify file exists and permissionsls -la /etc/cassandra/conf/*.jkschown cassandra:cassandra /etc/cassandra/conf/*.jksWrong Password
Section titled “Wrong Password”ERROR: Keystore was tampered with, or password was incorrectSolution:
- Verify password in
cassandra.yamlmatches keystore password - Recreate keystore with correct password
Certificate Chain Invalid
Section titled “Certificate Chain Invalid”ERROR: PKIX path building failedSolution:
- Ensure truststore contains the CA that signed the certificate
- Check certificate chain is complete
Existing Connections
Section titled “Existing Connections”Connection Behavior
After reloadssl:
- New connections use new certificates
- Existing connections continue with old certificates
- Full rotation requires client reconnection
Best Practices
Section titled “Best Practices”Certificate Rotation
- Test in staging first - Verify certificates work
- Update truststore before keystore - Prevent connection failures
- One node at a time - Rolling update approach
- Monitor after reload - Check for SSL errors
- Keep backups - Save old certificates until verified
- Document expiration - Track when to rotate next
Automation Example
Section titled “Automation Example”#!/bin/bash# check_cert_expiry.sh - Alert on expiring certificates
DAYS_WARNING=30KEYSTORE="/etc/cassandra/conf/keystore.jks"
expiry=$(keytool -list -v -keystore $KEYSTORE -storepass changeit 2>/dev/null | \ grep "Valid from" | head -1 | sed 's/.*until: //')
expiry_epoch=$(date -d "$expiry" +%s)now_epoch=$(date +%s)days_left=$(( (expiry_epoch - now_epoch) / 86400 ))
if [ $days_left -lt $DAYS_WARNING ]; then echo "WARNING: Certificate expires in $days_left days" echo "Run certificate rotation procedure"fiRelated Configuration
Section titled “Related Configuration”| Setting | File | Description |
|---|---|---|
server_encryption_options | cassandra.yaml | Internode SSL |
client_encryption_options | cassandra.yaml | Client SSL |
native_transport_port_ssl | cassandra.yaml | SSL-only CQL port (removed in 5.0) |
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| info | Node information including SSL status |
| status | Cluster status |