Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Istanza gestita di Azure per Apache Cassandra è un servizio completamente gestito per cluster Apache Cassandra open source puri. Il servizio consente anche di eseguire l'override delle configurazioni, a seconda delle esigenze specifiche di ogni carico di lavoro. Questa funzionalità consente la massima flessibilità e controllo, se necessario. Questo articolo descrive come eseguire manualmente i comandi DBA in caso di necessità.
Importante
Nodetool
e sstable
sono in anteprima pubblica.
Questa funzionalità viene fornita senza un contratto di servizio. Questa funzionalità non è consigliata per i carichi di lavoro di produzione. Per altre informazioni, vedere le Condizioni supplementari per l'uso delle anteprime di Microsoft Azure.
Supporto dei comandi DBA
Istanza gestita di Azure per Apache Cassandra consente di eseguire i comandi nodetool
e sstable
utilizzando Azure CLI per l'amministrazione di routine di database. Non tutti i comandi sono supportati e esistono alcune limitazioni. Per i comandi supportati, vedere le sezioni seguenti.
Avviso
Alcuni di questi comandi possono destabilizzare il cluster Cassandra. È consigliabile usare questi comandi con attenzione e dopo il test in ambienti non di produzione. Se possibile, distribuire prima un'opzione --dry-run
. Microsoft non offre alcun contratto di servizio o supporto per problemi relativi all'esecuzione di comandi che modificano la configurazione predefinita del database e/o le tabelle.
Come eseguire un nodetool
comando
Azure Istanza gestita per Apache Cassandra fornisce il comando dell'interfaccia della riga di comando di Azure seguente per eseguire i comandi DBA:
az managed-cassandra cluster invoke-command --resource-group <rg> \
--cluster-name <cluster> --host <ip of data node> --command-name nodetool \
--arguments "<nodetool-subcommand>"="" "paramerter1"=""
Il sottocomando deve trovarsi nella --arguments
sezione con un valore vuoto.
Nodetool
i flag senza un valore sono nel formato : "<flag>"=""
. Se il flag ha un valore, è nel formato : "<flag>"="value"
.
Ecco un esempio di come eseguire un nodetool
comando senza flag, in questo caso il nodetool status
comando :
az managed-cassandra cluster invoke-command --resource-group <rg> --cluster-name <cluster> \
--host <ip of data node> --command-name nodetool --arguments "status"=""
Ecco un esempio di come eseguire un nodetool
comando con un flag, in questo caso il nodetool compact
comando :
az managed-cassandra cluster invoke-command --resource-group <rg> --cluster-name <cluster> \
--host <ip of data node> --command-name nodetool --arguments "compact"="" "-st"="65678794"
Entrambi restituiscono un json del formato seguente:
{
"commandErrorOutput": "",
"commandOutput": "<result>",
"exitCode": 0
}
Nella maggior parte dei casi, hai bisogno solo del commandOutput
o del exitCode
. Ecco un esempio per ottenere solo il commandOutput
:
az managed-cassandra cluster invoke-command --query "commandOutput" --resource-group $resourceGroupName \
--cluster-name $clusterName --host $host --command-name nodetool --arguments getstreamthroughput=""
Come eseguire un sstable
comando
I sstable
comandi richiedono l'accesso in lettura/scrittura alla directory dei dati Cassandra e al database Cassandra da arrestare. Per soddisfare questo requisito, specificare questi due parametri: --cassandra-stop-start true
e --readwrite true
.
az managed-cassandra cluster invoke-command --resource-group <test-rg> \
--cluster-name <test-cluster> --host <ip> --cassandra-stop-start true --readwrite true \
--command-name sstableutil --arguments "system"="peers"
{
"commandErrorOutput": "",
"commandOutput": "Listing files...\n/var/lib/cassandra/data/system/peers-37f71aca7dc2383ba70672528af04d4f/me-1-big-CompressionInfo.db\n/var/lib/cassandra/data/system/peers-37f71aca7dc2383ba70672528af04d4f/me-1-big-Data.db\n/var/lib/cassandra/data/system/peers-37f71aca7dc2383ba70672528af04d4f/me-1-big-Digest.crc32\n/var/lib/cassandra/data/system/peers-37f71aca7dc2383ba70672528af04d4f/me-1-big-Filter.db\n/var/lib/cassandra/data/system/peers-37f71aca7dc2383ba70672528af04d4f/me-1-big-Index.db\n/var/lib/cassandra/data/system/peers-37f71aca7dc2383ba70672528af04d4f/me-1-big-Statistics.db\n/var/lib/cassandra/data/system/peers-37f71aca7dc2383ba70672528af04d4f/me-1-big-Summary.db\n/var/lib/cassandra/data/system/peers-37f71aca7dc2383ba70672528af04d4f/me-1-big-TOC.txt\n",
"exitCode": 0
}
Come eseguire altri comandi
Il cassandra-reset-password
comando consente a un utente di modificare la password per l'utente Cassandra.
az managed-cassandra cluster invoke-command --resource-group <rg> --cluster-name <cluster> \
--host <ip of data node> --command-name cassandra-reset-password --arguments password="<password>"
Importante
La password è con codifica URL (UTF-8) in questo comando, ovvero si applicano le regole seguenti:
The alphanumeric characters "a" through "z", "A" through "Z" and "0" through "9" remain the same.
The special characters ".", "-", "*", and "_" remain the same.
The space character " " is converted into a plus sign "+".
All other characters are unsafe and are first converted into one or more bytes using some encoding scheme. Then each byte is represented by the 3-character string "%xy", where xy is the two-digit hexadecimal representation of the byte.
Il cassandra-reset-auth-replication
comando consente a un utente di modificare lo schema per l'utente Cassandra. Separare i nomi dei data center in base allo spazio.
az managed-cassandra cluster invoke-command --resource-group <rg> --cluster-name <cluster> \
--host <ip of data node> --command-name cassandra-reset-auth-replication \
--arguments password="<datacenters>"
Importante
I data center sono codificati con URL (UTF-8) quando vengono passati a questo comando, ovvero si applicano le regole seguenti:
The alphanumeric characters "a" through "z", "A" through "Z" and "0" through "9" remain the same.
The special characters ".", "-", "*", and "_" remain the same.
The space character " " is converted into a plus sign "+".
All other characters are unsafe and are first converted into one or more bytes using some encoding scheme. Then each byte is represented by the 3-character string "%xy", where xy is the two-digit hexadecimal representation of the byte.
Il sstable-tree
comando consente a un utente di visualizzare gli instabili.
az managed-cassandra cluster invoke-command --resource-group <rg> --cluster-name <cluster> \
--host <ip of data node> --command-name sstable-tree
Il sstable-delete
comando consente a un utente di eliminare gli instabili eseguiti prima di un determinato momento.
az managed-cassandra cluster invoke-command --resource-group <rg> --cluster-name <cluster> \
--host <ip of data node> --command-name sstable-delete --arguments datetime="<YYYY-MM-DD hh:mm:ss>"
L'argomento datetime
deve essere formattato come illustrato nell'esempio. È anche possibile aggiungere --dry-run=""
come argomento per visualizzare i file eliminati dal comando.
Elenco dei comandi supportati sstable
Per altre informazioni su ogni comando, vedere Strumenti SSTable.
sstableverify
sstablescrub
sstablemetadata
sstablelevelreset
sstableutil
sstablesplit
sstablerepairedset
sstableofflinerelevel
sstableexpiredblockers
Elenco dei comandi supportati nodetool
Per altre informazioni su ogni comando, vedere Usare Nodetool.
status
cleanup
clearsnapshot
compact
compactionhistory
compactionstats
describecluster
describering
disableautocompaction
disablehandoff
disablehintsfordc
drain
enableautocompaction
enablehandoff
enablehintsfordc
failuredetector
flush
garbagecollect
gcstats
getcompactionthreshold
getcompactionthroughput
getconcurrentcompactors
getendpoints
getinterdcstreamthroughput
getlogginglevels
getsstables
getstreamthroughput
gettimeout
gettraceprobability
gossipinfo
info
invalidatecountercache
invalidatekeycache
invalidaterowcache
listsnapshots
netstats
pausehandoff
proxyhistograms
rangekeysample
rebuild
-
rebuild_index
- per gli argomenti usare"keyspace"="table indexname..."
refresh
refreshsizeestimates
reloadlocalschema
replaybatchlog
resetlocalschema
resumehandoff
ring
scrub
-
setcachecapacity
- per gli argomenti usare"key-cache-capacity" = "<row-cache-capacity> <counter-cache-capacity>"
-
setcachekeystosave
- per gli argomenti usare"key-cache-keys-to-save":"<row-cache-keys-to-save> <counter-cache-keys-to-save>"
-
setcompactionthreshold
- per gli argomenti usare"<keyspace>"="<table> <minthreshold> <maxthreshold>
setcompactionthroughput
setconcurrentcompactors
sethintedhandoffthrottlekb
setinterdcstreamthroughput
setstreamthroughput
settimeout
settraceprobability
statusbackup
statusbinary
statusgossip
statushandoff
stop
tablehistograms
tablestats
toppartitions
tpstats
truncatehints
verify
version
viewbuildstatus