Azure Managed Instance for Apache Cassandra는 순수 오픈 소스 Apache Cassandra 클러스터를 위한 완전 관리형 서비스입니다. 또한 서비스는 각 워크로드의 특정 요구 사항에 따라 구성을 재정의할 수 있습니다. 이 기능을 사용하면 필요한 경우 유연성을 극대화하고 제어할 수 있습니다. 이 문서에서는 필요할 때 DBA 명령을 수동으로 실행하는 방법을 설명합니다.
중요합니다
Nodetool
및 sstable
명령은 공개 미리 보기로 제공됩니다.
해당 기능은 별도의 서비스 수준 규약 없이 이용할 수 있습니다. 프로덕션 워크로드에는 이 기능을 사용하지 않는 것이 좋습니다. 자세한 내용은 Microsoft Azure Preview에 대한 추가 사용 약관을 참조하세요.
DBA 명령 지원
Apache Cassandra용 Azure Managed Instance를 사용하면 Azure CLI를 통해 일상적인 DBA 관리를 위한 nodetool
및 sstable
명령을 실행할 수 있습니다. 모든 명령이 지원되는 것은 아니며 몇 가지 제한 사항이 있습니다. 지원되는 명령은 다음 섹션을 참조하세요.
경고
이러한 명령 중 일부는 Cassandra 클러스터를 불안정하게 만들 수 있습니다. 이러한 명령은 비프로덕션 환경에서 테스트한 후에만 신중하게 사용해야 합니다. 가능하면 --dry-run
옵션을 먼저 배포합니다. Microsoft는 기본 데이터베이스 구성 및/또는 테이블을 변경하는 실행 명령과 관련된 문제에 대한 SLA 또는 지원을 제공하지 않습니다.
nodetool
명령을 실행하는 방법
Azure Managed Instance DBA for Apache Cassandra는 DBA 명령을 실행하기 위해 다음 Azure CLI 명령을 제공합니다.
az managed-cassandra cluster invoke-command --resource-group <rg> \
--cluster-name <cluster> --host <ip of data node> --command-name nodetool \
--arguments "<nodetool-subcommand>"="" "paramerter1"=""
하위 명령은 빈 값이 --arguments
있는 섹션에 있어야 합니다. 값이 없는 Nodetool
플래그는 "<flag>"=""
형식입니다. 플래그에 값이 있으면 다음과 같은 형식 "<flag>"="value"
입니다.
다음은 플래그 없이 nodetool
명령을 실행하는 방법의 예입니다. 이 경우 nodetool status
명령은 다음과 같습니다.
az managed-cassandra cluster invoke-command --resource-group <rg> --cluster-name <cluster> \
--host <ip of data node> --command-name nodetool --arguments "status"=""
다음은 플래그를 사용하여 nodetool
명령을 실행하는 방법의 예입니다. 이 경우 nodetool compact
명령은 다음과 같습니다.
az managed-cassandra cluster invoke-command --resource-group <rg> --cluster-name <cluster> \
--host <ip of data node> --command-name nodetool --arguments "compact"="" "-st"="65678794"
둘 다 다음 형식의 json을 반환합니다.
{
"commandErrorOutput": "",
"commandOutput": "<result>",
"exitCode": 0
}
대부분의 경우 commandOutput
또는 exitCode
만 필요합니다. 다음은 commandOutput
만 가져오는 예제입니다.
az managed-cassandra cluster invoke-command --query "commandOutput" --resource-group $resourceGroupName \
--cluster-name $clusterName --host $host --command-name nodetool --arguments getstreamthroughput=""
sstable
명령을 실행하는 방법
sstable
명령을 사용하려면 Cassandra 데이터 디렉터리 및 Cassandra 데이터베이스에 대한 읽기/쓰기 액세스가 중지되어야 합니다. 이 요구 사항을 수용하려면 다음 두 매개 변수 --cassandra-stop-start true
를 지정합니다 --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
}
다른 명령을 실행하는 방법
cassandra-reset-password
명령을 사용하면 사용자가 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>"
중요합니다
암호는 이 명령에서 URL 인코딩(UTF-8)입니다. 즉, 다음 규칙이 적용됩니다.
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.
cassandra-reset-auth-replication
명령을 사용하면 사용자가 Cassandra 사용자의 스키마를 변경할 수 있습니다. 데이터 센터 이름을 공백으로 구분합니다.
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>"
중요합니다
데이터 센터는 이 명령에 전달될 때 URL로 인코딩됩니다(UTF-8). 즉, 다음 규칙이 적용됩니다.
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.
sstable-tree
명령을 사용하면 사용자가 자신의 sstable을 볼 수 있습니다.
az managed-cassandra cluster invoke-command --resource-group <rg> --cluster-name <cluster> \
--host <ip of data node> --command-name sstable-tree
sstable-delete
명령을 사용하면 사용자가 특정 시간 전에 만든 자신의 sstable을 삭제할 수 있습니다.
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>"
datetime
예제와 같이 인수의 서식을 지정해야 합니다. 인수로 추가하여 --dry-run=""
명령이 삭제하는 파일을 확인할 수도 있습니다.
지원되는 sstable
명령 목록
각 명령에 대한 자세한 내용은 SSTable 도구를 참조하세요.
sstableverify
sstablescrub
sstablemetadata
sstablelevelreset
sstableutil
sstablesplit
sstablerepairedset
sstableofflinerelevel
sstableexpiredblockers
지원되는 nodetool
명령 목록
각 명령에 대한 자세한 내용은 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
- 인수의 경우"keyspace"="table indexname..."
사용 refresh
refreshsizeestimates
reloadlocalschema
replaybatchlog
resetlocalschema
resumehandoff
ring
scrub
-
setcachecapacity
- 인수의 경우"key-cache-capacity" = "<row-cache-capacity> <counter-cache-capacity>"
사용 -
setcachekeystosave
- 인수의 경우"key-cache-keys-to-save":"<row-cache-keys-to-save> <counter-cache-keys-to-save>"
사용 -
setcompactionthreshold
- 인수의 경우"<keyspace>"="<table> <minthreshold> <maxthreshold>
사용 setcompactionthroughput
setconcurrentcompactors
sethintedhandoffthrottlekb
setinterdcstreamthroughput
setstreamthroughput
settimeout
settraceprobability
statusbackup
statusbinary
statusgossip
statushandoff
stop
tablehistograms
tablestats
toppartitions
tpstats
truncatehints
verify
version
viewbuildstatus