Azure Managed Instance for Apache Cassandra는 순수 오픈 소스 Apache Cassandra 클러스터를 위한 완전 관리형 서비스입니다. 또한 서비스는 각 워크로드의 특정 요구 사항에 따라 구성을 재정의할 수 있습니다. 이 기능을 사용하면 필요한 경우 유연성을 극대화하고 제어할 수 있습니다. 이 문서에서는 필요한 경우 DBA(데이터베이스 관리자) 명령을 수동으로 실행하는 방법을 설명합니다.
중요합니다
nodetool 및 sstable 명령은 공개 미리 보기로 제공됩니다.
이 기능은 SLA(서비스 수준 계약) 없이 제공됩니다. 프로덕션 워크로드에는 이 기능을 사용하지 않는 것이 좋습니다. 자세한 내용은 Microsoft Azure Preview에 대한 추가 사용 약관을 참조하세요.
DBA 명령 지원
Apache Cassandra용 Azure Managed Instance를 사용하면 일상적인 DBA 관리에 Azure CLI를 사용하여 실행하고 nodetoolsstable 명령할 수 있습니다. 일부 명령이 지원되는 것은 아니며 몇 가지 제한 사항이 있습니다. 지원되는 명령은 다음 섹션을 참조하세요.
경고
이러한 명령 중 일부는 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)입니다. 즉, 다음 규칙이 적용됩니다.
- 영숫자 문자
a부터z,A부터Z, 그리고0부터9까지 동일하게 유지됩니다. - 특수 문자
.,-및*_동일하게 유지합니다. - 공백 문자가 더하기 기호(
+)로 변환됩니다. - 다른 모든 문자는 안전하지 않으며 먼저 일부 인코딩 체계를 사용하여 하나 이상의 바이트로 변환됩니다. 3자 문자열
%xy은 각 바이트를 나타내며, 여기서xy바이트의 2자리 16진수 표현입니다.
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). 즉, 다음 규칙이 적용됩니다.
- 영숫자 문자
a에서z,A에서Z, 그리고0에서9는 동일하게 유지됩니다. - 특수 문자
.,-및*_동일하게 유지합니다. - 공백 문자가 더하기 기호(
+)로 변환됩니다. - 다른 모든 문자는 안전하지 않으며 먼저 일부 인코딩 체계를 사용하여 하나 이상의 바이트로 변환됩니다. 3자 문자열
%xy은 각 바이트를 나타내며, 여기서xy바이트의 2자리 16진수 표현입니다.
이 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 도구를 참조하세요.
sstableverifysstablescrubsstablemetadatasstablelevelresetsstableutilsstablesplitsstablerepairedsetsstableofflinerelevelsstableexpiredblockers
지원되는 nodetool 명령 목록
각 명령에 대한 자세한 내용은 nodetool 사용을 참조하세요.
statuscleanupclearsnapshotcompactcompactionhistorycompactionstatsdescribeclusterdescriberingdisableautocompactiondisablehandoffdisablehintsfordcdrainenableautocompactionenablehandoffenablehintsfordcfailuredetectorflushgarbagecollectgcstatsgetcompactionthresholdgetcompactionthroughputgetconcurrentcompactorsgetendpointsgetinterdcstreamthroughputgetlogginglevelsgetsstablesgetstreamthroughputgettimeoutgettraceprobabilitygossipinfoinfoinvalidatecountercacheinvalidatekeycacheinvalidaterowcachelistsnapshotsnetstatspausehandoffproxyhistogramsrangekeysamplerebuildrebuild_index: 인수에는"keyspace"="table indexname..."를 사용하세요.refreshrefreshsizeestimatesreloadlocalschemareplaybatchlogresetlocalschemaresumehandoffringscrubsetcachecapacity: 인수에는"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>를 사용합니다.setcompactionthroughputsetconcurrentcompactorssethintedhandoffthrottlekbsetinterdcstreamthroughputsetstreamthroughputsettimeoutsettraceprobabilitystatusbackupstatusbinarystatusgossipstatushandoffstoptablehistogramstablestatstoppartitionstpstatstruncatehintsverifyversionviewbuildstatus