Commandes CLI Cassandra, gestion de keyspaces, tables, clusters et requêtes CQL. Guide pratique pour développeurs, DevOps et data engineers travaillant sur des bases distribuées et des architectures haute disponibilité.
cassandra
Démarre le serveur Cassandra (foreground)
-f-p--pidfile-D--jmx-R--help
cassandra -f
Démarre en foreground (logs dans la console)
-f
cassandra -p /var/run/cassandra.pid
Démarre avec fichier PID
-p--pidfile
cassandra -R
Démarre en tant que root (déconseillé)
-R
nodetool
Outil d'administration Cassandra
-h--host-p--port-u--username-pw--password-pwf--password-file--help
nodetool status
Affiche l'état du cluster (nœuds, load, tokens)
-r--resolve-ip
nodetool info
Informations sur le nœud local
nodetool ring
Affiche l'anneau de tokens
-r--resolve-ipkeyspace
nodetool describecluster
Décrit le cluster (name, snitch, partitioner)
nodetool version
Affiche la version de Cassandra
nodetool gossipinfo
Informations du protocole Gossip
nodetool tpstats
Statistiques des pools de threads
nodetool netstats
Statistiques réseau
nodetool cfstats
Statistiques des colonnes familles (tables)
-H--human-readable-i--ignorekeyspace.table
nodetool cfstats -H mon_keyspace.ma_table
Statistiques d'une table spécifique (format lisible)
-H--human-readable
nodetool tablestats
Alias de cfstats (statistiques des tables)
-Hkeyspace.table
nodetool compactionstats
Statut des compactions en cours
-H--human-readable
nodetool netstats
Statistiques des connexions réseau
nodetool proxyhistograms
Histogrammes des latences
nodetool tablehistograms mon_keyspace ma_table
Histogrammes de latence pour une table
nodetool flush
Flushe les memtables vers le disque
keyspacetable
nodetool flush mon_keyspace ma_table
Flushe une table spécifique
nodetool compact
Force une compaction
-s--split-output-t--tokenskeyspacetable
nodetool compact mon_keyspace ma_table
Compacte une table spécifique
nodetool cleanup
Nettoie les données qui n'appartiennent plus au nœud
-j--jobskeyspacetable
nodetool cleanup mon_keyspace ma_table
Nettoie une table spécifique
-j--jobs
nodetool repair
Répare les données incohérentes
-pr--partitioner-range-seq--sequential-local--in-local-dc-dc--in-dc-hosts--in-hosts-j--jobs-st--start-token-et--end-token-full--full-inc--incremental-v--validatekeyspacetable
nodetool repair -pr mon_keyspace
Répare uniquement les ranges primaires
-pr--partitioner-range
nodetool repair -full mon_keyspace ma_table
Répare complètement une table
-full
nodetool repair -inc mon_keyspace
Répare de manière incrémentale
-inc--incremental
nodetool scrub
Nettoie les données corrompues
-j--jobs-s--skip-corrupted-ns--no-snapshotkeyspacetable
nodetool scrub -ns mon_keyspace ma_table
Scrub sans créer de snapshot
-ns--no-snapshot
nodetool clearsnapshot
Supprime les snapshots
-t--tagkeyspace
nodetool clearsnapshot -t mon_tag
Supprime un snapshot spécifique
-t--tag
nodetool snapshot
Prend un snapshot des données
-t--tag-kt--kt-list-sf--skip-flushkeyspacetable
nodetool snapshot -t backup_2024 mon_keyspace
Snapshot avec tag personnalisé
-t--tag
nodetool listsnapshots
Liste tous les snapshots
nodetool refresh
Recharge les SSTables nouvellement ajoutées
keyspacetable
nodetool drain
Vide les memtables et arrête les écritures (avant arrêt)
nodetool stopdaemon
Arrête le démon Cassandra
nodetool decommission
Retire le nœud du cluster (streaming des données)
-f--force
nodetool removenode
Force la suppression d'un nœud mort
host_id-s--status
nodetool removenode 12345678-1234-1234-1234-123456789abc
Supprime un nœud par son Host ID
nodetool removenode status
Affiche le statut des suppressions de nœuds
status
nodetool assassinate
Tue un nœud mort (sans streamer les données)
address
nodetool assassinate 192.168.1.10
Assassine le nœud à cette adresse
nodetool rebuild
Reconstruit les données d'un datacenter
-ks--keyspace-t--tokenssource_dc
nodetool rebuild -- datacenter2
Reconstruit depuis datacenter2
nodetool rebuild_index
Reconstruit les index secondaires
keyspacetableindex_name
nodetool rebuild_index mon_keyspace ma_table idx_name
Reconstruit un index spécifique
nodetool setlogginglevel
Change le niveau de log dynamiquement
classlevel
nodetool setlogginglevel org.apache.cassandra DEBUG
Met les logs Cassandra en DEBUG
nodetool getlogginglevels
Affiche les niveaux de log actuels
nodetool settraceprobability
Définit la probabilité de tracing
probability
nodetool settraceprobability 0.1
Trace 10% des requêtes
nodetool gettraceprobability
Affiche la probabilité de tracing
nodetool setstreamthroughput
Définit le débit de streaming (Mb/s)
throughput
nodetool setstreamthroughput 200
Définit le streaming à 200 Mb/s
nodetool getstreamthroughput
Affiche le débit de streaming
nodetool setcompactionthroughput
Définit le débit de compaction (Mb/s)
throughput
nodetool setcompactionthroughput 64
Définit la compaction à 64 Mb/s
nodetool getcompactionthroughput
Affiche le débit de compaction
nodetool setconcurrentcompactors
Définit le nombre de compacteurs concurrents
number
nodetool getconcurrentcompactors
Affiche le nombre de compacteurs
nodetool enablebackup
Active la sauvegarde incrémentale
nodetool disablebackup
Désactive la sauvegarde incrémentale
nodetool statusbackup
Affiche l'état de la sauvegarde incrémentale
nodetool enableauditlog
Active l'audit log
nodetool disableauditlog
Désactive l'audit log
nodetool enablefullquerylog
Active le full query log
nodetool disablefullquerylog
Désactive le full query log
nodetool enablegossip
Active le protocole Gossip
nodetool disablegossip
Désactive le protocole Gossip
nodetool enablethrift
Active le serveur Thrift (déprécié)
nodetool disablethrift
Désactive le serveur Thrift
nodetool enablebinary
Active le protocole binaire natif (CQL)
nodetool disablebinary
Désactive le protocole binaire natif
nodetool enablehandoff
Active le hinted handoff
nodetool disablehandoff
Désactive le hinted handoff
nodetool statushandoff
Affiche l'état du hinted handoff
nodetool pausehandoff
Met en pause le hinted handoff
nodetool resumehandoff
Reprend le hinted handoff
nodetool failuredetector
Affiche les informations du détecteur de pannes
nodetool toppartitions
Affiche les partitions les plus actives
-k--keyspace-t--table-d--duration-s--size-a--capacity
nodetool toppartitions -k mon_keyspace -t ma_table -d 10000 -s 5
Top 5 partitions sur 10 secondes
-k-t-d-s
nodetool sjk
Swiss Java Knife - outils de diagnostic JVM
mxgcstcaphhttophelp
nodetool sjk mx
Affiche les informations MBeans
-b--bean-a--all-f--full
nodetool sjk gc
Informations sur le Garbage Collector
nodetool verify
Vérifie les checksums des SSTables
-e--extendedkeyspacetable
nodetool verify -e mon_keyspace ma_table
Vérification étendue d'une table
-e--extended
nodetool upgradesstables
Met à niveau les SSTables vers le format actuel
-a--include-all-sstableskeyspacetable
nodetool upgradesstables -a mon_keyspace
Met à niveau toutes les SSTables
-a--include-all-sstables
nodetool resetlocalschema
Réinitialise le schéma local et le resynchronise
-f--force
nodetool reloadlocalschema
Recharge le schéma local depuis le disque
nodetool reloadseeds
Recharge la liste des seeds depuis la config
nodetool reloadtriggers
Recharge les triggers
nodetool move
Déplace le token du nœud
new_token
nodetool move 3074457345618258602
Déplace vers un nouveau token
nodetool setcachecapacity
Définit la capacité du cache
-k--keyspace-t--tablekey_cache_capacityrow_cache_capacity
nodetool setcachecapacity -k mon_keyspace -t ma_table 100 200
Définit key cache à 100 MB, row cache à 200 MB
-k-t
nodetool getcachecapacity
Affiche la capacité des caches
-k--keyspace-t--table
nodetool setcachekeystosave
Définit le nombre de clés de cache à sauvegarder
-k--keyspace-t--tablekey_cache_keysrow_cache_keys
nodetool getcachekeystosave
Affiche les paramètres de sauvegarde des caches
-k--keyspace-t--table
nodetool invalidatekeycache
Invalide le key cache
-k--keyspace-t--table
nodetool invalidaterowcache
Invalide le row cache
-k--keyspace-t--table
nodetool invalidatecountercache
Invalide le counter cache
nodetool viewbuildstatus
Statut de construction des vues matérialisées
-k--keyspace-v--view
nodetool stop
Arrête la compaction, le repair ou le cleanup
COMPACTIONREPAIRCLEANUPSCRUBUPGRADEVIEW_BUILDtype
nodetool stop COMPACTION
Arrête toutes les compactions
nodetool stop REPAIR
Arrête toutes les réparations
cqlsh
Shell interactif CQL (Cassandra Query Language)
-h--host-p--port-u--username-p--password-k--keyspace-f--file-e--execute--ssl--cqlshrc--cqlversion--connect-timeout--request-timeout-t--tty--no-color--debug--version--help
cqlsh -h localhost -p 9042 -u cassandra -p cassandra
Connexion avec authentification
-h-p-u-p
cqlsh -k mon_keyspace
Connexion directe à un keyspace
-k--keyspace
cqlsh -e "SELECT * FROM ma_table"
Exécute une commande et quitte
-e--execute
cqlsh -f script.cql
Exécute un fichier CQL
-f--file
cqlsh --ssl
Connexion SSL
--ssl
DESCRIBE CLUSTER
[CQL] Décrit le cluster
DESCRIBE KEYSPACES
[CQL] Liste tous les keyspaces
DESCRIBE KEYSPACE mon_keyspace
[CQL] Décrit un keyspace
DESCRIBE TABLES
[CQL] Liste les tables du keyspace courant
DESCRIBE TABLE ma_table
[CQL] Décrit une table
DESCRIBE TYPES
[CQL] Liste les types définis par l'utilisateur
DESCRIBE FUNCTIONS
[CQL] Liste les fonctions définies par l'utilisateur
DESCRIBE AGGREGATES
[CQL] Liste les agrégats définis par l'utilisateur
DESCRIBE MATERIALIZED VIEWS
[CQL] Liste les vues matérialisées
DESCRIBE INDEX
[CQL] Liste les index secondaires
DESC
[CQL] Alias de DESCRIBE
SHOW VERSION
[CQL] Affiche la version de Cassandra
SHOW HOST
[CQL] Affiche l'hôte de connexion
SHOW SESSION
[CQL] Affiche les informations de session
keyspaceusertracing
USE mon_keyspace
[CQL] Change de keyspace
CREATE KEYSPACE mon_keyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}
[CQL] Crée un keyspace avec SimpleStrategy
AND durable_writes = true
CREATE KEYSPACE mon_keyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': 3, 'DC2': 2}
[CQL] Crée un keyspace avec NetworkTopologyStrategy
ALTER KEYSPACE mon_keyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}
[CQL] Modifie un keyspace
DROP KEYSPACE mon_keyspace
[CQL] Supprime un keyspace
IF EXISTS
CREATE TABLE ma_table (id UUID PRIMARY KEY, name text, age int, email text)
[CQL] Crée une table
WITH CLUSTERING ORDER BYWITH compactionWITH compressionWITH cachingWITH commentWITH read_repairWITH gc_grace_secondsWITH default_time_to_live
CREATE TABLE ma_table (id UUID, created_at timestamp, name text, PRIMARY KEY (id, created_at)) WITH CLUSTERING ORDER BY (created_at DESC)
[CQL] Table avec clé composite et ordre de clustering
WITH CLUSTERING ORDER BY
CREATE TABLE ma_table (id UUID PRIMARY KEY, name text) WITH compaction = {'class': 'LeveledCompactionStrategy'}
[CQL] Table avec LeveledCompactionStrategy
WITH compaction
CREATE TABLE ma_table (id UUID PRIMARY KEY, name text) WITH compression = {'sstable_compression': 'LZ4Compressor'}
[CQL] Table avec compression LZ4
WITH compression
CREATE TABLE ma_table (id UUID PRIMARY KEY, name text) WITH default_time_to_live = 86400
[CQL] Table avec TTL par défaut (24h)
WITH default_time_to_live
ALTER TABLE ma_table ADD email text
[CQL] Ajoute une colonne
ALTER TABLE ma_table DROP email
[CQL] Supprime une colonne
ALTER TABLE ma_table RENAME name TO full_name
[CQL] Renomme une colonne (clé primaire non modifiable)
ALTER TABLE ma_table WITH compaction = {'class': 'SizeTieredCompactionStrategy'}
[CQL] Modifie la stratégie de compaction
ALTER TABLE ma_table WITH gc_grace_seconds = 864000
[CQL] Modifie le gc_grace_seconds (10 jours)
DROP TABLE ma_table
[CQL] Supprime une table
IF EXISTS
TRUNCATE TABLE ma_table
[CQL] Vide une table
CREATE INDEX ON ma_table (email)
[CQL] Crée un index secondaire
IF NOT EXISTSindex_name
CREATE INDEX idx_email ON ma_table (email)
[CQL] Crée un index avec nom personnalisé
CREATE CUSTOM INDEX ON ma_table (email) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'CONTAINS'}
[CQL] Crée un index SASI (recherche full-text)
DROP INDEX idx_email
[CQL] Supprime un index
IF EXISTS
CREATE MATERIALIZED VIEW mv_users_by_email AS SELECT email, id, name FROM ma_table WHERE email IS NOT NULL PRIMARY KEY (email, id)
[CQL] Crée une vue matérialisée
WITH CLUSTERING ORDER BYWITH compaction
ALTER MATERIALIZED VIEW mv_users_by_email WITH compaction = {'class': 'LeveledCompactionStrategy'}
[CQL] Modifie une vue matérialisée
DROP MATERIALIZED VIEW mv_users_by_email
[CQL] Supprime une vue matérialisée
IF EXISTS
CREATE TYPE address (street text, city text, zip text)
[CQL] Crée un type défini par l'utilisateur (UDT)
ALTER TYPE address ADD country text
[CQL] Ajoute un champ à un UDT
DROP TYPE address
[CQL] Supprime un UDT
IF EXISTS
CREATE TABLE users (id UUID PRIMARY KEY, addr frozen<address>)
[CQL] Table utilisant un UDT
CREATE FUNCTION avg_state (state tuple<int, int>, val int) RETURNS NULL ON NULL INPUT RETURNS tuple<int, int> LANGUAGE java AS '...'
[CQL] Crée une fonction définie par l'utilisateur (UDF)
CALLED ON NULL INPUTRETURNS NULL ON NULL INPUT
DROP FUNCTION avg_state
[CQL] Supprime une UDF
IF EXISTS
CREATE AGGREGATE average(int) SFUNC avg_state STYPE tuple<int, int> FINALFUNC avg_final INITCOND (0, 0)
[CQL] Crée un agrégat défini par l'utilisateur (UDA)
DROP AGGREGATE average
[CQL] Supprime un UDA
IF EXISTS
CREATE TRIGGER mon_trigger ON ma_table USING 'org.apache.cassandra.triggers.AuditTrigger'
[CQL] Crée un trigger
DROP TRIGGER mon_trigger ON ma_table
[CQL] Supprime un trigger
IF EXISTS
INSERT INTO ma_table (id, name, age) VALUES (uuid(), 'John', 30)
[CQL] Insère un document
USING TTLUSING TIMESTAMPIF NOT EXISTS
INSERT INTO ma_table (id, name, age) VALUES (uuid(), 'John', 30) USING TTL 86400
[CQL] Insère avec TTL de 24h
USING TTL
INSERT INTO ma_table (id, name, age) VALUES (uuid(), 'John', 30) IF NOT EXISTS
[CQL] Insère seulement si n'existe pas (lightweight transaction)
IF NOT EXISTS
UPDATE ma_table SET age = 31 WHERE id = 123e4567-e89b-12d3-a456-426614174000
[CQL] Met à jour un document
USING TTLUSING TIMESTAMPIF EXISTSIF age = 30
UPDATE ma_table SET age = 31 WHERE id = ... IF age = 30
[CQL] Mise à jour conditionnelle (LWT)
IF
UPDATE ma_table SET emails = emails + {'new@example.com'} WHERE id = ...
[CQL] Ajoute à une collection (set)
+
UPDATE ma_table SET phones = phones - {'old'} WHERE id = ...
[CQL] Retire d'une collection (set)
-
UPDATE ma_table SET counters = counters + 1 WHERE id = ...
[CQL] Incrémente un compteur
+-
DELETE FROM ma_table WHERE id = ...
[CQL] Supprime une ligne
USING TIMESTAMPIF EXISTS
DELETE age FROM ma_table WHERE id = ...
[CQL] Supprime une colonne spécifique
DELETE emails['old@example.com'] FROM ma_table WHERE id = ...
[CQL] Supprime un élément d'une map
BATCH BEGIN INSERT INTO ma_table (id, name) VALUES (uuid(), 'John') INSERT INTO ma_table (id, name) VALUES (uuid(), 'Jane') APPLY BATCH
[CQL] Exécute un batch d'opérations
UNLOGGEDCOUNTERUSING TIMESTAMP
SELECT * FROM ma_table
[CQL] Sélectionne toutes les colonnes
LIMITALLOW FILTERINGPER PARTITION LIMITTIMESTAMP
SELECT name, age FROM ma_table WHERE id = ...
[CQL] Sélectionne des colonnes spécifiques
SELECT * FROM ma_table WHERE id IN (uuid1, uuid2, uuid3)
[CQL] Sélectionne par liste d'IDs
IN
SELECT * FROM ma_table WHERE id = ... AND created_at > '2024-01-01'
[CQL] Requête sur clé de partition et clustering
>>=<<=
SELECT * FROM ma_table WHERE name = 'John' ALLOW FILTERING
[CQL] Requête sur colonne non indexée (à éviter)
ALLOW FILTERING
SELECT * FROM ma_table WHERE email CONTAINS 'example.com' ALLOW FILTERING
[CQL] Requête CONTAINS sur collection
CONTAINSCONTAINS KEY
SELECT * FROM ma_table LIMIT 10
[CQL] Limite le nombre de résultats
LIMIT
SELECT * FROM ma_table PER PARTITION LIMIT 1
[CQL] Limite par partition
PER PARTITION LIMIT
SELECT token(id) FROM ma_table
[CQL] Affiche le token d'une clé de partition
token
SELECT * FROM ma_table WHERE token(id) > token(uuid()) LIMIT 100
[CQL] Pagination par token
token
SELECT JSON * FROM ma_table
[CQL] Retourne les résultats en JSON
JSON
INSERT INTO ma_table JSON '{"id": "...", "name": "John"}'
[CQL] Insère depuis JSON
JSON
SELECT COUNT(*) FROM ma_table
[CQL] Compte les lignes
LIMIT
SELECT WRITETIME(name) FROM ma_table WHERE id = ...
[CQL] Affiche le timestamp d'écriture
WRITETIME
SELECT TTL(name) FROM ma_table WHERE id = ...
[CQL] Affiche le TTL restant
TTL
TRACING ON
[CQL] Active le tracing des requêtes
TRACING OFF
[CQL] Désactive le tracing
PAGING ON
[CQL] Active la pagination
PAGING OFF
[CQL] Désactive la pagination
PAGING 100
[CQL] Définit la taille de page à 100
size
EXPAND ON
[CQL] Affiche les résultats verticalement
EXPAND OFF
[CQL] Affiche les résultats en tableau
CONSISTENCY
[CQL] Affiche le niveau de cohérence courant
CONSISTENCY QUORUM
[CQL] Définit la cohérence à QUORUM
ANYONETWOTHREEQUORUMALLLOCAL_QUORUMEACH_QUORUMSERIALLOCAL_SERIALLOCAL_ONE
SERIAL CONSISTENCY
[CQL] Affiche la cohérence série
SERIAL CONSISTENCY LOCAL_SERIAL
[CQL] Définit la cohérence série
SERIALLOCAL_SERIAL
LOGIN cassandra
[CQL] Se connecter avec un autre utilisateur
password
LIST USERS
[CQL] Liste les utilisateurs
CREATE USER monuser WITH PASSWORD 'monmotdepasse'
[CQL] Crée un utilisateur
SUPERUSERNOSUPERUSER
CREATE USER monuser WITH PASSWORD 'monmotdepasse' SUPERUSER
[CQL] Crée un superutilisateur
SUPERUSER
ALTER USER monuser WITH PASSWORD 'nouveau'
[CQL] Change le mot de passe
SUPERUSERNOSUPERUSER
DROP USER monuser
[CQL] Supprime un utilisateur
IF EXISTS
LIST ROLES
[CQL] Liste les rôles
CREATE ROLE monrole
[CQL] Crée un rôle
WITH LOGINWITH PASSWORDWITH SUPERUSERWITH OPTIONS
GRANT SELECT ON KEYSPACE mon_keyspace TO monrole
[CQL] Donne le droit SELECT sur un keyspace
GRANT ALL PERMISSIONS ON KEYSPACE mon_keyspace TO monrole
[CQL] Donne tous les droits sur un keyspace
GRANT MODIFY ON TABLE ma_table TO monrole
[CQL] Donne le droit MODIFY sur une table
SELECTMODIFYAUTHORIZEDROPCREATEALTERDESCRIBEEXECUTEUNMASKSELECT_MASKED
REVOKE SELECT ON KEYSPACE mon_keyspace FROM monrole
[CQL] Révoque un droit
LIST PERMISSIONS OF monrole
[CQL] Liste les permissions d'un rôle
ON KEYSPACEON TABLE
GRANT monrole TO monuser
[CQL] Assigne un rôle à un utilisateur
REVOKE monrole FROM monuser
[CQL] Retire un rôle
LIST ROLES OF monuser
[CQL] Liste les rôles d'un utilisateur
CREATE ROLE IF NOT EXISTS monrole WITH LOGIN = true AND PASSWORD = 'secret'
[CQL] Crée un rôle avec login
COPY ma_table (id, name, age) TO 'export.csv' WITH HEADER = true
[CQL] Exporte une table en CSV
WITH HEADERWITH DELIMITERWITH QUOTEWITH ESCAPEWITH NULLWITH ENCODINGWITH MAXREQUESTSWITH PAGESIZEWITH PAGETIMEOUTWITH RATEFILE
COPY ma_table (id, name, age) FROM 'import.csv' WITH HEADER = true
[CQL] Importe un CSV dans une table
WITH HEADERWITH DELIMITERWITH QUOTEWITH ESCAPEWITH NULLWITH ENCODINGWITH MAXREQUESTSWITH PAGESIZEWITH PAGETIMEOUTWITH RATEFILEWITH MAXBATCHSIZEWITH MINBATCHSIZEWITH CHUNKSIZEWITH MAXPARSEERRORSWITH MAXINSERTERRORSWITH ERRFILE
COPY ma_table TO STDOUT
[CQL] Exporte vers la sortie standard
COPY ma_table FROM STDIN
[CQL] Importe depuis l'entrée standard
SOURCE 'script.cql'
[CQL] Exécute un fichier CQL
CAPTURE 'output.txt'
[CQL] Capture la sortie dans un fichier
CAPTURE OFF
[CQL] Arrête la capture
CLEAR
[CQL] Efface l'écran
EXIT
[CQL] Quitte cqlsh
QUIT
[CQL] Alias de EXIT
HELP
[CQL] Affiche l'aide
commande
sstableloader
Charge des SSTables dans un cluster
-d--nodes-u--username-pw--password-t--throttle-f--conf-path-v--verbose--no-progress--help
sstableloader -d 192.168.1.10,192.168.1.11 /path/to/sstables
Charge des SSTables vers les nœuds spécifiés
-d--nodes
sstableloader -d localhost -u cassandra -pw cassandra /data/sstables
Charge avec authentification
-d-u-pw
sstableutil
Utilitaire de manipulation des SSTables
-c--cleanup-d--debug-s--snapshot-v--verboselistmovescrubverifyhelp
sstableutil list /var/lib/cassandra/data/mon_keyspace/ma_table
Liste les SSTables d'une table
list
sstableutil verify /var/lib/cassandra/data/mon_keyspace/ma_table
Vérifie l'intégrité des SSTables
verify
sstabledump
Affiche le contenu d'une SSTable
-e--enumerate-keys-k--key-x--exclude-key-t--timestamp-l--limit-d--debug-f--output-format-o--output-file-c--clustering-s--stats--help
sstabledump /path/to/sstable.db
Affiche le contenu d'une SSTable
-fjson
sstabledump -f json /path/to/sstable.db > dump.json
Exporte en JSON
-f--output-format
sstabledump -e /path/to/sstable.db
Énumère toutes les clés
-e--enumerate-keys
sstablemetadata
Affiche les métadonnées d'une SSTable
-u--units-c--compact-s--scan-t--tokens-v--validation--help
sstablemetadata /path/to/sstable.db
Affiche les métadonnées
sstablemetadata -u /path/to/sstable.db
Affiche avec tailles en unités lisibles
-u--units
sstablelevelreset
Réinitialise les niveaux de compaction (LCS)
-s--really-silentkeyspacetable
sstablelevelreset --really-silent mon_keyspace ma_table
Réinitialise silencieusement
-s--really-silent
sstableofflinerelevel
Re-nivelle les SSTables pour LCS (offline)
-s--really-silent-v--verbosekeyspacetable
sstableverify
Vérifie les checksums des SSTables
-v--verbosekeyspacetable
sstableverify -v mon_keyspace ma_table
Vérifie avec logs verbeux
-v--verbose
sstableexpiredblockers
Trouve les SSTables bloquant l'expiration
keyspacetable
auditlogviewer
Visualise les logs d'audit Cassandra
-f--file-s--start-e--end-t--type-u--user-o--output--help
auditlogviewer -f /var/log/cassandra/audit.log
Affiche les logs d'audit
-f--file
auditlogviewer -f audit.log -u monuser
Filtre par utilisateur
-u--user
fqltool
Full Query Log tool - analyse les logs de requêtes
dumpreplaycompare--help
fqltool dump /var/lib/cassandra/fql.log
Affiche le contenu du FQL
dump
fqltool replay --keyspace mon_keyspace --target localhost /var/lib/cassandra/fql.log
Rejoue les requêtes FQL
replay--keyspace--target
fqltool compare fql1.log fql2.log
Compare deux fichiers FQL
compare
cassandra-stress
Outil de benchmark Cassandra
writereadmixedcounter_writecounter_readuserhelp-n--num-keys-c--columns-C--cardinality-S--schema-d--duration-t--threads-r--rate-p--port-node--host-pop--population-log--log-level-mode--transport-graph--graph-file-tokenrange--help
cassandra-stress write n=100000 -rate threads=50
Test d'écriture (100k écritures, 50 threads)
n=-rate-schema
cassandra-stress read n=100000 -rate threads=100
Test de lecture (100k lectures, 100 threads)
n=-rate
cassandra-stress mixed ratio(write=1,read=3) n=100000 -rate threads=50
Test mixte (25% écriture, 75% lecture)
mixedratio
cassandra-stress user profile=/path/to/profile.yaml ops(insert=1,query1=3) n=100000
Test avec profil personnalisé
userprofileops
cassandra-stress write -schema replication(factor=3) -pop seq=1..1000000
Test avec population séquentielle
-schema-pop
cassandra-stress write -graph file=graph.html title=MonTest
Génère un graphique des résultats
-graph