Catalogue des Commandes 03/03/2026 22:00:00 angularforall.com

- Apache Cassandra : CLI, keyspaces et clusters

Cassandra Apache-Cassandra Cassandra-Cli Cql Cassandra-Admin Cassandra-Cluster Cassandra-Keyspace Nosql Distributed-Database High-Availability Devops Data-Engineer Big-Data Scalabilite Replication

Commandes CLI Cassandra : gestion des keyspaces, tables, clusters et requêtes CQL pour bases distribuées et architectures haute disponibilité.

cassandra
Description :

Démarre le serveur Cassandra (foreground)

Options :
  • -f ⚠️
  • -p
  • --pidfile
  • -D
  • --jmx
  • -R ⚠️
  • --help
cassandra -f
Description :

Démarre en foreground (logs dans la console)

Options :
  • -f ⚠️
cassandra -p /var/run/cassandra.pid
Description :

Démarre avec fichier PID

Options :
  • -p
  • --pidfile
cassandra -R
Description :

Démarre en tant que root (déconseillé)

Options :
  • -R ⚠️
nodetool
Description :

Outil d'administration Cassandra

Options :
  • -h
  • --host
  • -p
  • --port
  • -u
  • --username
  • -pw
  • --password
  • -pwf
  • --password-file ⚠️
  • --help
nodetool status
Description :

Affiche l'état du cluster (nœuds, load, tokens)

Options :
  • -r ⚠️
  • --resolve-ip ⚠️
nodetool info
Description :

Informations sur le nœud local

nodetool ring
Description :

Affiche l'anneau de tokens

Options :
  • -r ⚠️
  • --resolve-ip ⚠️
  • keyspace
nodetool describecluster
Description :

Décrit le cluster (name, snitch, partitioner)

nodetool version
Description :

Affiche la version de Cassandra

nodetool gossipinfo
Description :

Informations du protocole Gossip

nodetool tpstats
Description :

Statistiques des pools de threads

nodetool netstats
Description :

Statistiques réseau

nodetool cfstats
Description :

Statistiques des colonnes familles (tables)

Options :
  • -H
  • --human-readable ⚠️
  • -i
  • --ignore
  • keyspace.table
nodetool cfstats -H mon_keyspace.ma_table
Description :

Statistiques d'une table spécifique (format lisible)

Options :
  • -H
  • --human-readable ⚠️
nodetool tablestats
Description :

Alias de cfstats (statistiques des tables)

Options :
  • -H
  • keyspace.table
nodetool compactionstats
Description :

Statut des compactions en cours

Options :
  • -H
  • --human-readable ⚠️
nodetool netstats
Description :

Statistiques des connexions réseau

nodetool proxyhistograms
Description :

Histogrammes des latences

nodetool tablehistograms mon_keyspace ma_table
Description :

Histogrammes de latence pour une table

nodetool flush
Description :

Flushe les memtables vers le disque

Options :
  • keyspace
  • table
nodetool flush mon_keyspace ma_table
Description :

Flushe une table spécifique

nodetool compact
Description :

Force une compaction

Options :
  • -s
  • --split-output
  • -t
  • --tokens
  • keyspace
  • table
nodetool compact mon_keyspace ma_table
Description :

Compacte une table spécifique

nodetool cleanup
Description :

Nettoie les données qui n'appartiennent plus au nœud

Options :
  • -j
  • --jobs
  • keyspace
  • table
nodetool cleanup mon_keyspace ma_table
Description :

Nettoie une table spécifique

Options :
  • -j
  • --jobs
nodetool repair
Description :

Répare les données incohérentes

Options :
  • -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
  • --validate
  • keyspace
  • table
nodetool repair -pr mon_keyspace
Description :

Répare uniquement les ranges primaires

Options :
  • -pr
  • --partitioner-range ⚠️
nodetool repair -full mon_keyspace ma_table
Description :

Répare complètement une table

Options :
  • -full ⚠️
nodetool repair -inc mon_keyspace
Description :

Répare de manière incrémentale

Options :
  • -inc
  • --incremental
nodetool scrub
Description :

Nettoie les données corrompues

Options :
  • -j
  • --jobs
  • -s
  • --skip-corrupted
  • -ns
  • --no-snapshot
  • keyspace
  • table
nodetool scrub -ns mon_keyspace ma_table
Description :

Scrub sans créer de snapshot

Options :
  • -ns
  • --no-snapshot
nodetool clearsnapshot
Description :

Supprime les snapshots

Options :
  • -t
  • --tag
  • keyspace
nodetool clearsnapshot -t mon_tag
Description :

Supprime un snapshot spécifique

Options :
  • -t
  • --tag
nodetool snapshot
Description :

Prend un snapshot des données

Options :
  • -t
  • --tag
  • -kt
  • --kt-list
  • -sf
  • --skip-flush ⚠️
  • keyspace
  • table
nodetool snapshot -t backup_2024 mon_keyspace
Description :

Snapshot avec tag personnalisé

Options :
  • -t
  • --tag
nodetool listsnapshots
Description :

Liste tous les snapshots

nodetool refresh
Description :

Recharge les SSTables nouvellement ajoutées

Options :
  • keyspace
  • table
nodetool drain
Description :

Vide les memtables et arrête les écritures (avant arrêt)

nodetool stopdaemon
Description :

Arrête le démon Cassandra

nodetool decommission
Description :

Retire le nœud du cluster (streaming des données)

Options :
  • -f ⚠️
  • --force ⚠️
nodetool removenode
Description :

Force la suppression d'un nœud mort

Options :
  • host_id
  • -s
  • --status
nodetool removenode 12345678-1234-1234-1234-123456789abc
Description :

Supprime un nœud par son Host ID

nodetool removenode status
Description :

Affiche le statut des suppressions de nœuds

Options :
  • status
nodetool assassinate
Description :

Tue un nœud mort (sans streamer les données)

Options :
  • address
nodetool assassinate 192.168.1.10
Description :

Assassine le nœud à cette adresse

nodetool rebuild
Description :

Reconstruit les données d'un datacenter

Options :
  • -ks
  • --keyspace
  • -t
  • --tokens
  • source_dc
nodetool rebuild -- datacenter2
Description :

Reconstruit depuis datacenter2

nodetool rebuild_index
Description :

Reconstruit les index secondaires

Options :
  • keyspace
  • table
  • index_name
nodetool rebuild_index mon_keyspace ma_table idx_name
Description :

Reconstruit un index spécifique

nodetool setlogginglevel
Description :

Change le niveau de log dynamiquement

Options :
  • class
  • level
nodetool setlogginglevel org.apache.cassandra DEBUG
Description :

Met les logs Cassandra en DEBUG

nodetool getlogginglevels
Description :

Affiche les niveaux de log actuels

nodetool settraceprobability
Description :

Définit la probabilité de tracing

Options :
  • probability
nodetool settraceprobability 0.1
Description :

Trace 10% des requêtes

nodetool gettraceprobability
Description :

Affiche la probabilité de tracing

nodetool setstreamthroughput
Description :

Définit le débit de streaming (Mb/s)

Options :
  • throughput
nodetool setstreamthroughput 200
Description :

Définit le streaming à 200 Mb/s

nodetool getstreamthroughput
Description :

Affiche le débit de streaming

nodetool setcompactionthroughput
Description :

Définit le débit de compaction (Mb/s)

Options :
  • throughput
nodetool setcompactionthroughput 64
Description :

Définit la compaction à 64 Mb/s

nodetool getcompactionthroughput
Description :

Affiche le débit de compaction

nodetool setconcurrentcompactors
Description :

Définit le nombre de compacteurs concurrents

Options :
  • number
nodetool getconcurrentcompactors
Description :

Affiche le nombre de compacteurs

nodetool enablebackup
Description :

Active la sauvegarde incrémentale

nodetool disablebackup
Description :

Désactive la sauvegarde incrémentale

nodetool statusbackup
Description :

Affiche l'état de la sauvegarde incrémentale

nodetool enableauditlog
Description :

Active l'audit log

nodetool disableauditlog
Description :

Désactive l'audit log

nodetool enablefullquerylog
Description :

Active le full query log

nodetool disablefullquerylog
Description :

Désactive le full query log

nodetool enablegossip
Description :

Active le protocole Gossip

nodetool disablegossip
Description :

Désactive le protocole Gossip

nodetool enablethrift
Description :

Active le serveur Thrift (déprécié)

nodetool disablethrift
Description :

Désactive le serveur Thrift

nodetool enablebinary
Description :

Active le protocole binaire natif (CQL)

nodetool disablebinary
Description :

Désactive le protocole binaire natif

nodetool enablehandoff
Description :

Active le hinted handoff

nodetool disablehandoff
Description :

Désactive le hinted handoff

nodetool statushandoff
Description :

Affiche l'état du hinted handoff

nodetool pausehandoff
Description :

Met en pause le hinted handoff

nodetool resumehandoff
Description :

Reprend le hinted handoff

nodetool failuredetector
Description :

Affiche les informations du détecteur de pannes

nodetool toppartitions
Description :

Affiche les partitions les plus actives

Options :
  • -k
  • --keyspace
  • -t
  • --table
  • -d
  • --duration
  • -s
  • --size
  • -a
  • --capacity
nodetool toppartitions -k mon_keyspace -t ma_table -d 10000 -s 5
Description :

Top 5 partitions sur 10 secondes

Options :
  • -k
  • -t
  • -d
  • -s
nodetool sjk
Description :

Swiss Java Knife - outils de diagnostic JVM

Options :
  • mx
  • gc
  • stcap
  • hh
  • ttop
  • help
nodetool sjk mx
Description :

Affiche les informations MBeans

Options :
  • -b
  • --bean
  • -a
  • --all
  • -f ⚠️
  • --full ⚠️
nodetool sjk gc
Description :

Informations sur le Garbage Collector

nodetool verify
Description :

Vérifie les checksums des SSTables

Options :
  • -e
  • --extended
  • keyspace
  • table
nodetool verify -e mon_keyspace ma_table
Description :

Vérification étendue d'une table

Options :
  • -e
  • --extended
nodetool upgradesstables
Description :

Met à niveau les SSTables vers le format actuel

Options :
  • -a
  • --include-all-sstables
  • keyspace
  • table
nodetool upgradesstables -a mon_keyspace
Description :

Met à niveau toutes les SSTables

Options :
  • -a
  • --include-all-sstables
nodetool resetlocalschema
Description :

Réinitialise le schéma local et le resynchronise

Options :
  • -f ⚠️
  • --force ⚠️
nodetool reloadlocalschema
Description :

Recharge le schéma local depuis le disque

nodetool reloadseeds
Description :

Recharge la liste des seeds depuis la config

nodetool reloadtriggers
Description :

Recharge les triggers

nodetool move
Description :

Déplace le token du nœud

Options :
  • new_token
nodetool move 3074457345618258602
Description :

Déplace vers un nouveau token

nodetool setcachecapacity
Description :

Définit la capacité du cache

Options :
  • -k
  • --keyspace
  • -t
  • --table
  • key_cache_capacity
  • row_cache_capacity
nodetool setcachecapacity -k mon_keyspace -t ma_table 100 200
Description :

Définit key cache à 100 MB, row cache à 200 MB

Options :
  • -k
  • -t
nodetool getcachecapacity
Description :

Affiche la capacité des caches

Options :
  • -k
  • --keyspace
  • -t
  • --table
nodetool setcachekeystosave
Description :

Définit le nombre de clés de cache à sauvegarder

Options :
  • -k
  • --keyspace
  • -t
  • --table
  • key_cache_keys
  • row_cache_keys
nodetool getcachekeystosave
Description :

Affiche les paramètres de sauvegarde des caches

Options :
  • -k
  • --keyspace
  • -t
  • --table
nodetool invalidatekeycache
Description :

Invalide le key cache

Options :
  • -k
  • --keyspace
  • -t
  • --table
nodetool invalidaterowcache
Description :

Invalide le row cache

Options :
  • -k
  • --keyspace
  • -t
  • --table
nodetool invalidatecountercache
Description :

Invalide le counter cache

nodetool viewbuildstatus
Description :

Statut de construction des vues matérialisées

Options :
  • -k
  • --keyspace
  • -v
  • --view
nodetool stop
Description :

Arrête la compaction, le repair ou le cleanup

Options :
  • COMPACTION
  • REPAIR
  • CLEANUP
  • SCRUB
  • UPGRADE
  • VIEW_BUILD
  • type
nodetool stop COMPACTION
Description :

Arrête toutes les compactions

nodetool stop REPAIR
Description :

Arrête toutes les réparations

cqlsh
Description :

Shell interactif CQL (Cassandra Query Language)

Options :
  • -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
Description :

Connexion avec authentification

Options :
  • -h
  • -p
  • -u
  • -p
cqlsh -k mon_keyspace
Description :

Connexion directe à un keyspace

Options :
  • -k
  • --keyspace
cqlsh -e "SELECT * FROM ma_table"
Description :

Exécute une commande et quitte

Options :
  • -e
  • --execute
cqlsh -f script.cql
Description :

Exécute un fichier CQL

Options :
  • -f ⚠️
  • --file ⚠️
cqlsh --ssl
Description :

Connexion SSL

Options :
  • --ssl
DESCRIBE CLUSTER
Description :

[CQL] Décrit le cluster

DESCRIBE KEYSPACES
Description :

[CQL] Liste tous les keyspaces

DESCRIBE KEYSPACE mon_keyspace
Description :

[CQL] Décrit un keyspace

DESCRIBE TABLES
Description :

[CQL] Liste les tables du keyspace courant

DESCRIBE TABLE ma_table
Description :

[CQL] Décrit une table

DESCRIBE TYPES
Description :

[CQL] Liste les types définis par l'utilisateur

DESCRIBE FUNCTIONS
Description :

[CQL] Liste les fonctions définies par l'utilisateur

DESCRIBE AGGREGATES
Description :

[CQL] Liste les agrégats définis par l'utilisateur

DESCRIBE MATERIALIZED VIEWS
Description :

[CQL] Liste les vues matérialisées

DESCRIBE INDEX
Description :

[CQL] Liste les index secondaires

DESC
Description :

[CQL] Alias de DESCRIBE

SHOW VERSION
Description :

[CQL] Affiche la version de Cassandra

SHOW HOST
Description :

[CQL] Affiche l'hôte de connexion

SHOW SESSION
Description :

[CQL] Affiche les informations de session

Options :
  • keyspace
  • user
  • tracing
USE mon_keyspace
Description :

[CQL] Change de keyspace

CREATE KEYSPACE mon_keyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}
Description :

[CQL] Crée un keyspace avec SimpleStrategy

Options :
  • AND durable_writes = true
CREATE KEYSPACE mon_keyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': 3, 'DC2': 2}
Description :

[CQL] Crée un keyspace avec NetworkTopologyStrategy

ALTER KEYSPACE mon_keyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}
Description :

[CQL] Modifie un keyspace

DROP KEYSPACE mon_keyspace
Description :

[CQL] Supprime un keyspace

Options :
  • IF EXISTS
CREATE TABLE ma_table (id UUID PRIMARY KEY, name text, age int, email text)
Description :

[CQL] Crée une table

Options :
  • WITH CLUSTERING ORDER BY
  • WITH compaction
  • WITH compression
  • WITH caching
  • WITH comment
  • WITH read_repair
  • WITH gc_grace_seconds
  • WITH 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)
Description :

[CQL] Table avec clé composite et ordre de clustering

Options :
  • WITH CLUSTERING ORDER BY
CREATE TABLE ma_table (id UUID PRIMARY KEY, name text) WITH compaction = {'class': 'LeveledCompactionStrategy'}
Description :

[CQL] Table avec LeveledCompactionStrategy

Options :
  • WITH compaction
CREATE TABLE ma_table (id UUID PRIMARY KEY, name text) WITH compression = {'sstable_compression': 'LZ4Compressor'}
Description :

[CQL] Table avec compression LZ4

Options :
  • WITH compression
CREATE TABLE ma_table (id UUID PRIMARY KEY, name text) WITH default_time_to_live = 86400
Description :

[CQL] Table avec TTL par défaut (24h)

Options :
  • WITH default_time_to_live
ALTER TABLE ma_table ADD email text
Description :

[CQL] Ajoute une colonne

ALTER TABLE ma_table DROP email
Description :

[CQL] Supprime une colonne

ALTER TABLE ma_table RENAME name TO full_name
Description :

[CQL] Renomme une colonne (clé primaire non modifiable)

ALTER TABLE ma_table WITH compaction = {'class': 'SizeTieredCompactionStrategy'}
Description :

[CQL] Modifie la stratégie de compaction

ALTER TABLE ma_table WITH gc_grace_seconds = 864000
Description :

[CQL] Modifie le gc_grace_seconds (10 jours)

DROP TABLE ma_table
Description :

[CQL] Supprime une table

Options :
  • IF EXISTS
TRUNCATE TABLE ma_table
Description :

[CQL] Vide une table

CREATE INDEX ON ma_table (email)
Description :

[CQL] Crée un index secondaire

Options :
  • IF NOT EXISTS
  • index_name
CREATE INDEX idx_email ON ma_table (email)
Description :

[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'}
Description :

[CQL] Crée un index SASI (recherche full-text)

DROP INDEX idx_email
Description :

[CQL] Supprime un index

Options :
  • 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)
Description :

[CQL] Crée une vue matérialisée

Options :
  • WITH CLUSTERING ORDER BY
  • WITH compaction
ALTER MATERIALIZED VIEW mv_users_by_email WITH compaction = {'class': 'LeveledCompactionStrategy'}
Description :

[CQL] Modifie une vue matérialisée

DROP MATERIALIZED VIEW mv_users_by_email
Description :

[CQL] Supprime une vue matérialisée

Options :
  • IF EXISTS
CREATE TYPE address (street text, city text, zip text)
Description :

[CQL] Crée un type défini par l'utilisateur (UDT)

ALTER TYPE address ADD country text
Description :

[CQL] Ajoute un champ à un UDT

DROP TYPE address
Description :

[CQL] Supprime un UDT

Options :
  • IF EXISTS
CREATE TABLE users (id UUID PRIMARY KEY, addr frozen<address>)
Description :

[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 '...'
Description :

[CQL] Crée une fonction définie par l'utilisateur (UDF)

Options :
  • CALLED ON NULL INPUT
  • RETURNS NULL ON NULL INPUT
DROP FUNCTION avg_state
Description :

[CQL] Supprime une UDF

Options :
  • IF EXISTS
CREATE AGGREGATE average(int) SFUNC avg_state STYPE tuple<int, int> FINALFUNC avg_final INITCOND (0, 0)
Description :

[CQL] Crée un agrégat défini par l'utilisateur (UDA)

DROP AGGREGATE average
Description :

[CQL] Supprime un UDA

Options :
  • IF EXISTS
CREATE TRIGGER mon_trigger ON ma_table USING 'org.apache.cassandra.triggers.AuditTrigger'
Description :

[CQL] Crée un trigger

DROP TRIGGER mon_trigger ON ma_table
Description :

[CQL] Supprime un trigger

Options :
  • IF EXISTS
INSERT INTO ma_table (id, name, age) VALUES (uuid(), 'John', 30)
Description :

[CQL] Insère un document

Options :
  • USING TTL
  • USING TIMESTAMP
  • IF NOT EXISTS
INSERT INTO ma_table (id, name, age) VALUES (uuid(), 'John', 30) USING TTL 86400
Description :

[CQL] Insère avec TTL de 24h

Options :
  • USING TTL
INSERT INTO ma_table (id, name, age) VALUES (uuid(), 'John', 30) IF NOT EXISTS
Description :

[CQL] Insère seulement si n'existe pas (lightweight transaction)

Options :
  • IF NOT EXISTS
UPDATE ma_table SET age = 31 WHERE id = 123e4567-e89b-12d3-a456-426614174000
Description :

[CQL] Met à jour un document

Options :
  • USING TTL
  • USING TIMESTAMP
  • IF EXISTS
  • IF age = 30
UPDATE ma_table SET age = 31 WHERE id = ... IF age = 30
Description :

[CQL] Mise à jour conditionnelle (LWT)

Options :
  • IF
UPDATE ma_table SET emails = emails + {'new@example.com'} WHERE id = ...
Description :

[CQL] Ajoute à une collection (set)

Options :
  • +
UPDATE ma_table SET phones = phones - {'old'} WHERE id = ...
Description :

[CQL] Retire d'une collection (set)

Options :
  • -
UPDATE ma_table SET counters = counters + 1 WHERE id = ...
Description :

[CQL] Incrémente un compteur

Options :
  • +
  • -
DELETE FROM ma_table WHERE id = ...
Description :

[CQL] Supprime une ligne

Options :
  • USING TIMESTAMP
  • IF EXISTS
DELETE age FROM ma_table WHERE id = ...
Description :

[CQL] Supprime une colonne spécifique

DELETE emails['old@example.com'] FROM ma_table WHERE id = ...
Description :

[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
Description :

[CQL] Exécute un batch d'opérations

Options :
  • UNLOGGED
  • COUNTER
  • USING TIMESTAMP
SELECT * FROM ma_table
Description :

[CQL] Sélectionne toutes les colonnes

Options :
  • LIMIT
  • ALLOW FILTERING
  • PER PARTITION LIMIT
  • TIMESTAMP
SELECT name, age FROM ma_table WHERE id = ...
Description :

[CQL] Sélectionne des colonnes spécifiques

SELECT * FROM ma_table WHERE id IN (uuid1, uuid2, uuid3)
Description :

[CQL] Sélectionne par liste d'IDs

Options :
  • IN
SELECT * FROM ma_table WHERE id = ... AND created_at > '2024-01-01'
Description :

[CQL] Requête sur clé de partition et clustering

Options :
  • > ⚠️
  • >= ⚠️
  • < ⚠️
  • <= ⚠️
SELECT * FROM ma_table WHERE name = 'John' ALLOW FILTERING
Description :

[CQL] Requête sur colonne non indexée (à éviter)

Options :
  • ALLOW FILTERING
SELECT * FROM ma_table WHERE email CONTAINS 'example.com' ALLOW FILTERING
Description :

[CQL] Requête CONTAINS sur collection

Options :
  • CONTAINS
  • CONTAINS KEY
SELECT * FROM ma_table LIMIT 10
Description :

[CQL] Limite le nombre de résultats

Options :
  • LIMIT
SELECT * FROM ma_table PER PARTITION LIMIT 1
Description :

[CQL] Limite par partition

Options :
  • PER PARTITION LIMIT
SELECT token(id) FROM ma_table
Description :

[CQL] Affiche le token d'une clé de partition

Options :
  • token
SELECT * FROM ma_table WHERE token(id) > token(uuid()) LIMIT 100
Description :

[CQL] Pagination par token

Options :
  • token
SELECT JSON * FROM ma_table
Description :

[CQL] Retourne les résultats en JSON

Options :
  • JSON
INSERT INTO ma_table JSON '{"id": "...", "name": "John"}'
Description :

[CQL] Insère depuis JSON

Options :
  • JSON
SELECT COUNT(*) FROM ma_table
Description :

[CQL] Compte les lignes

Options :
  • LIMIT
SELECT WRITETIME(name) FROM ma_table WHERE id = ...
Description :

[CQL] Affiche le timestamp d'écriture

Options :
  • WRITETIME
SELECT TTL(name) FROM ma_table WHERE id = ...
Description :

[CQL] Affiche le TTL restant

Options :
  • TTL
TRACING ON
Description :

[CQL] Active le tracing des requêtes

TRACING OFF
Description :

[CQL] Désactive le tracing

PAGING ON
Description :

[CQL] Active la pagination

PAGING OFF
Description :

[CQL] Désactive la pagination

PAGING 100
Description :

[CQL] Définit la taille de page à 100

Options :
  • size
EXPAND ON
Description :

[CQL] Affiche les résultats verticalement

EXPAND OFF
Description :

[CQL] Affiche les résultats en tableau

CONSISTENCY
Description :

[CQL] Affiche le niveau de cohérence courant

CONSISTENCY QUORUM
Description :

[CQL] Définit la cohérence à QUORUM

Options :
  • ANY
  • ONE
  • TWO
  • THREE
  • QUORUM
  • ALL
  • LOCAL_QUORUM
  • EACH_QUORUM
  • SERIAL
  • LOCAL_SERIAL
  • LOCAL_ONE
SERIAL CONSISTENCY
Description :

[CQL] Affiche la cohérence série

SERIAL CONSISTENCY LOCAL_SERIAL
Description :

[CQL] Définit la cohérence série

Options :
  • SERIAL
  • LOCAL_SERIAL
LOGIN cassandra
Description :

[CQL] Se connecter avec un autre utilisateur

Options :
  • password
LIST USERS
Description :

[CQL] Liste les utilisateurs

CREATE USER monuser WITH PASSWORD 'monmotdepasse'
Description :

[CQL] Crée un utilisateur

Options :
  • SUPERUSER ⚠️
  • NOSUPERUSER
CREATE USER monuser WITH PASSWORD 'monmotdepasse' SUPERUSER
Description :

[CQL] Crée un superutilisateur

Options :
  • SUPERUSER ⚠️
ALTER USER monuser WITH PASSWORD 'nouveau'
Description :

[CQL] Change le mot de passe

Options :
  • SUPERUSER ⚠️
  • NOSUPERUSER
DROP USER monuser
Description :

[CQL] Supprime un utilisateur

Options :
  • IF EXISTS
LIST ROLES
Description :

[CQL] Liste les rôles

CREATE ROLE monrole
Description :

[CQL] Crée un rôle

Options :
  • WITH LOGIN
  • WITH PASSWORD
  • WITH SUPERUSER
  • WITH OPTIONS
GRANT SELECT ON KEYSPACE mon_keyspace TO monrole
Description :

[CQL] Donne le droit SELECT sur un keyspace

GRANT ALL PERMISSIONS ON KEYSPACE mon_keyspace TO monrole
Description :

[CQL] Donne tous les droits sur un keyspace

GRANT MODIFY ON TABLE ma_table TO monrole
Description :

[CQL] Donne le droit MODIFY sur une table

Options :
  • SELECT
  • MODIFY
  • AUTHORIZE
  • DROP
  • CREATE
  • ALTER
  • DESCRIBE
  • EXECUTE ⚠️
  • UNMASK
  • SELECT_MASKED
REVOKE SELECT ON KEYSPACE mon_keyspace FROM monrole
Description :

[CQL] Révoque un droit

LIST PERMISSIONS OF monrole
Description :

[CQL] Liste les permissions d'un rôle

Options :
  • ON KEYSPACE
  • ON TABLE
GRANT monrole TO monuser
Description :

[CQL] Assigne un rôle à un utilisateur

REVOKE monrole FROM monuser
Description :

[CQL] Retire un rôle

LIST ROLES OF monuser
Description :

[CQL] Liste les rôles d'un utilisateur

CREATE ROLE IF NOT EXISTS monrole WITH LOGIN = true AND PASSWORD = 'secret'
Description :

[CQL] Crée un rôle avec login

COPY ma_table (id, name, age) TO 'export.csv' WITH HEADER = true
Description :

[CQL] Exporte une table en CSV

Options :
  • WITH HEADER
  • WITH DELIMITER
  • WITH QUOTE
  • WITH ESCAPE
  • WITH NULL
  • WITH ENCODING
  • WITH MAXREQUESTS
  • WITH PAGESIZE
  • WITH PAGETIMEOUT
  • WITH RATEFILE
COPY ma_table (id, name, age) FROM 'import.csv' WITH HEADER = true
Description :

[CQL] Importe un CSV dans une table

Options :
  • WITH HEADER
  • WITH DELIMITER
  • WITH QUOTE
  • WITH ESCAPE
  • WITH NULL
  • WITH ENCODING
  • WITH MAXREQUESTS
  • WITH PAGESIZE
  • WITH PAGETIMEOUT
  • WITH RATEFILE
  • WITH MAXBATCHSIZE
  • WITH MINBATCHSIZE
  • WITH CHUNKSIZE
  • WITH MAXPARSEERRORS
  • WITH MAXINSERTERRORS
  • WITH ERRFILE
COPY ma_table TO STDOUT
Description :

[CQL] Exporte vers la sortie standard

COPY ma_table FROM STDIN
Description :

[CQL] Importe depuis l'entrée standard

SOURCE 'script.cql'
Description :

[CQL] Exécute un fichier CQL

CAPTURE 'output.txt'
Description :

[CQL] Capture la sortie dans un fichier

CAPTURE OFF
Description :

[CQL] Arrête la capture

CLEAR
Description :

[CQL] Efface l'écran

EXIT
Description :

[CQL] Quitte cqlsh

QUIT
Description :

[CQL] Alias de EXIT

HELP
Description :

[CQL] Affiche l'aide

Options :
  • commande
sstableloader
Description :

Charge des SSTables dans un cluster

Options :
  • -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
Description :

Charge des SSTables vers les nœuds spécifiés

Options :
  • -d
  • --nodes
sstableloader -d localhost -u cassandra -pw cassandra /data/sstables
Description :

Charge avec authentification

Options :
  • -d
  • -u
  • -pw
sstableutil
Description :

Utilitaire de manipulation des SSTables

Options :
  • -c
  • --cleanup
  • -d
  • --debug
  • -s
  • --snapshot
  • -v
  • --verbose
  • list
  • move
  • scrub
  • verify
  • help
sstableutil list /var/lib/cassandra/data/mon_keyspace/ma_table
Description :

Liste les SSTables d'une table

Options :
  • list
sstableutil verify /var/lib/cassandra/data/mon_keyspace/ma_table
Description :

Vérifie l'intégrité des SSTables

Options :
  • verify
sstabledump
Description :

Affiche le contenu d'une SSTable

Options :
  • -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
Description :

Affiche le contenu d'une SSTable

Options :
  • -f ⚠️
  • json
sstabledump -f json /path/to/sstable.db > dump.json
Description :

Exporte en JSON

Options :
  • -f ⚠️
  • --output-format ⚠️
sstabledump -e /path/to/sstable.db
Description :

Énumère toutes les clés

Options :
  • -e
  • --enumerate-keys
sstablemetadata
Description :

Affiche les métadonnées d'une SSTable

Options :
  • -u
  • --units
  • -c
  • --compact
  • -s
  • --scan
  • -t
  • --tokens
  • -v
  • --validation
  • --help
sstablemetadata /path/to/sstable.db
Description :

Affiche les métadonnées

sstablemetadata -u /path/to/sstable.db
Description :

Affiche avec tailles en unités lisibles

Options :
  • -u
  • --units
sstablelevelreset
Description :

Réinitialise les niveaux de compaction (LCS)

Options :
  • -s
  • --really-silent ⚠️
  • keyspace
  • table
sstablelevelreset --really-silent mon_keyspace ma_table
Description :

Réinitialise silencieusement

Options :
  • -s
  • --really-silent ⚠️
sstableofflinerelevel
Description :

Re-nivelle les SSTables pour LCS (offline)

Options :
  • -s
  • --really-silent ⚠️
  • -v
  • --verbose
  • keyspace
  • table
sstableverify
Description :

Vérifie les checksums des SSTables

Options :
  • -v
  • --verbose
  • keyspace
  • table
sstableverify -v mon_keyspace ma_table
Description :

Vérifie avec logs verbeux

Options :
  • -v
  • --verbose
sstableexpiredblockers
Description :

Trouve les SSTables bloquant l'expiration

Options :
  • keyspace
  • table
auditlogviewer
Description :

Visualise les logs d'audit Cassandra

Options :
  • -f ⚠️
  • --file ⚠️
  • -s
  • --start
  • -e
  • --end
  • -t
  • --type
  • -u
  • --user
  • -o
  • --output
  • --help
auditlogviewer -f /var/log/cassandra/audit.log
Description :

Affiche les logs d'audit

Options :
  • -f ⚠️
  • --file ⚠️
auditlogviewer -f audit.log -u monuser
Description :

Filtre par utilisateur

Options :
  • -u
  • --user
fqltool
Description :

Full Query Log tool - analyse les logs de requêtes

Options :
  • dump
  • replay
  • compare
  • --help
fqltool dump /var/lib/cassandra/fql.log
Description :

Affiche le contenu du FQL

Options :
  • dump
fqltool replay --keyspace mon_keyspace --target localhost /var/lib/cassandra/fql.log
Description :

Rejoue les requêtes FQL

Options :
  • replay
  • --keyspace
  • --target
fqltool compare fql1.log fql2.log
Description :

Compare deux fichiers FQL

Options :
  • compare
cassandra-stress
Description :

Outil de benchmark Cassandra

Options :
  • write
  • read
  • mixed
  • counter_write
  • counter_read
  • user
  • help
  • -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
Description :

Test d'écriture (100k écritures, 50 threads)

Options :
  • n=
  • -rate ⚠️
  • -schema
cassandra-stress read n=100000 -rate threads=100
Description :

Test de lecture (100k lectures, 100 threads)

Options :
  • n=
  • -rate ⚠️
cassandra-stress mixed ratio(write=1,read=3) n=100000 -rate threads=50
Description :

Test mixte (25% écriture, 75% lecture)

Options :
  • mixed
  • ratio
cassandra-stress user profile=/path/to/profile.yaml ops(insert=1,query1=3) n=100000
Description :

Test avec profil personnalisé

Options :
  • user
  • profile
  • ops
cassandra-stress write -schema replication(factor=3) -pop seq=1..1000000
Description :

Test avec population séquentielle

Options :
  • -schema
  • -pop
cassandra-stress write -graph file=graph.html title=MonTest
Description :

Génère un graphique des résultats

Options :
  • -graph

Partager