フォロワー データベース機能により、別のクラスターにあるデータベースを Azure Data Explorer クラスターにアタッチできます。
フォロワー データベースは "読み取り専用" モードでアタッチされるため、データを表示したり、リーダー データベースに取り込まれたデータに対してクエリを実行したりできます。 フォロワー データベースには、リーダー データベースの変更が同期されます。 この同期により、データが利用可能になるまでに数秒から数分のデータ遅延が発生します。 遅延の長さは、リーダー データベースのメタデータ全体のサイズに応じて異なります。 リーダー データベースとフォロワー データベースでは、データをフェッチするために同じストレージ アカウントが使用されます。 リーダー データベースはストレージを所有します。 フォロワー データベースでは、データを取り込むことなくデータを表示できます。 アタッチされたデータベースは読み取り専用のデータベースであるため、データベース内のデータ、テーブル、およびポリシーの変更はできませんが、キャッシュ ポリシー、プリンシパル、およびアクセス許可の変更は可能です。 アタッチされたデータベースは削除できません。 リーダーまたはフォロワーは、削除前にデータベースをデタッチする必要があります。
フォロワー機能を使った別のクラスターへのデータベースのアタッチは、組織とチームの間でデータを共有するためのインフラストラクチャとして使用されます。 この機能は、非運用環境のユース ケースから運用環境を保護するためにコンピューティング リソースを分離するのに役立ちます。 また、フォロワーを使うことで、Azure Data Explorer クラスターのコストを、そのデータに対してクエリを実行するパーティーに関連付けることができます。
注
以前の SDK バージョンに基づくサンプル コードについては、アーカイブ記事を参照してください。
フォロー対象データベース
クラスターには次の内容が適用されます。
- クラスターでは、1 つのデータベース、複数のデータベース、またはリーダー クラスターのすべてのデータベースをフォローできます。
- 単一のクラスターでは、複数のリーダー クラスターのデータベースをフォローできます。
- クラスターには、フォロワー データベースとリーダー データベースの両方を含めることができます。
前提条件
データベースのアタッチ
データベースのアタッチにはさまざまな方法があります。 この記事では、C#、Python、PowerShell、または Azure Resource Manager テンプレートを使用してデータベースをアタッチする方法について説明します。
データベースをアタッチするには、リーダー クラスターとフォロワー クラスターに対して少なくとも共同作成者ロールを持つユーザー、グループ、サービス プリンシパル、またはマネージド ID が必要です。
Azure portal、PowerShell、Azure CLI、ARM テンプレートを使用して、ロールの割り当てを追加または削除します。 詳細については、Azure のロールベースのアクセス制御 (Azure RBAC) および各種ロールに関する記事をご覧ください。
注
フォロワー データベースは、添付ファイルの処理中に作成されるため、事前に作成しておく必要はありません。
テーブル レベルの共有
データベースをアタッチすると、すべてのテーブル、外部テーブル、マテリアライズド ビューもフォローされます。 'TableLevelSharingProperties' を構成することで、特定のテーブル、外部テーブル、具体化されたビューを共有できます。
'TableLevelSharingProperties' には、tablesToInclude、tablesToExclude、externalTablesToInclude、externalTablesToExclude、materializedViewsToInclude、materializedViewsToExclude、functionsToInclude、functionsToExclude の 8 つの文字列の配列が含まれます。 すべての配列の最大エントリ数は合計で 100 です。
注
- すべてのデータベース表記で '*' を使用する場合、テーブル レベルの共有はサポートされません。
- 具体化されたビューを含める場合は、それらのソース テーブルも含まれます。
例
次の例には、すべてのテーブルが含まれています。 既定では、すべてのテーブルは '*' 表記を使用せずにフォローされます。
tablesToInclude = []
次の例には、すべての関数が含まれています。 既定では、すべての関数は '*' 表記を使用せずにフォローされます。
functionsToInclude = []
次の例には、"Logs" で始まる名前を持つすべてのテーブルが含まれています。
tablesToInclude = ["Logs*"]
次の例には、すべての外部テーブルが含まれています。
externalTablesToExclude = ["*"]
次の例には、具体化されたすべてのビューが含まれています。
materializedViewsToExclude=["*"]
データベース名のオーバーライド
必要に応じて、フォロワー クラスターのデータベース名をリーダー クラスターとは異なる名前にすることができます。 たとえば、複数のリーダー クラスターからフォロワー クラスターに同じデータベース名をアタッチしたい場合などです。 別のデータベース名を指定するには、'DatabaseNameOverride' プロパティまたは 'DatabaseNamePrefix' プロパティを構成します。
C# を使用したデータベースのアタッチ
必要な NuGet パッケージ
C# の例
var followerClusterId = KustoClusterResource.CreateResourceIdentifier(subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "followerResourceGroup", clusterName: "follower");
var leaderClusterId = KustoClusterResource.CreateResourceIdentifier(subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "leaderResourceGroup", clusterName: "leader");
var attachedDatabaseConfigurationName = "attachedDatabaseConfiguration";
var credentials = new ManagedIdentityCredential();
var resourceManagementClient = new ArmClient(credentials);
var followerCluster = resourceManagementClient.GetKustoClusterResource(followerClusterId);
var attachedDatabaseConfigurations = followerCluster.GetKustoAttachedDatabaseConfigurations();
var attachedDatabaseConfigurationData = new KustoAttachedDatabaseConfigurationData
{
ClusterResourceId = leaderClusterId,
DatabaseName = "<databaseName>", // Can be a specific database name in a leader cluster or * for all databases
DefaultPrincipalsModificationKind = KustoDatabaseDefaultPrincipalsModificationKind.Union,
Location = AzureLocation.NorthCentralUS
};
// Table level sharing properties are not supported when using '*' all databases notation.
if (attachedDatabaseConfigurationData.DatabaseName != "*")
{
// Set up the table level sharing properties - the following is just an example.
attachedDatabaseConfigurationData.TableLevelSharingProperties = new KustoDatabaseTableLevelSharingProperties();
attachedDatabaseConfigurationData.TableLevelSharingProperties.TablesToInclude.Add("table1");
attachedDatabaseConfigurationData.TableLevelSharingProperties.TablesToExclude.Add("table2");
attachedDatabaseConfigurationData.TableLevelSharingProperties.ExternalTablesToExclude.Add("exTable1");
attachedDatabaseConfigurationData.TableLevelSharingProperties.ExternalTablesToInclude.Add("exTable2");
attachedDatabaseConfigurationData.TableLevelSharingProperties.MaterializedViewsToInclude.Add("matTable1");
attachedDatabaseConfigurationData.TableLevelSharingProperties.MaterializedViewsToExclude.Add("matTable2");
attachedDatabaseConfigurationData.TableLevelSharingProperties.FunctionsToInclude.Add("func1");
attachedDatabaseConfigurationData.TableLevelSharingProperties.FunctionsToExclude.Add("func2");
}
await attachedDatabaseConfigurations.CreateOrUpdateAsync(WaitUntil.Completed, attachedDatabaseConfigurationName, attachedDatabaseConfigurationData);
Python を使用したデータベースのアタッチ
前提条件モジュール
pip install azure-identity
pip install azure-mgmt-kusto
Python の例
from azure.mgmt.kusto import KustoManagementClient
from azure.mgmt.kusto.models import AttachedDatabaseConfiguration, TableLevelSharingProperties
from azure.identity import ClientSecretCredential
import datetime
#Directory (tenant) ID
tenant_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Application ID
client_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Client Secret
client_secret = "xxxxxxxxxxxxxx"
follower_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
leader_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
credentials = ClientSecretCredential(
tenant_id=tenant_id,
client_id=client_id,
client_secret=client_secret
)
kusto_management_client = KustoManagementClient(credentials, follower_subscription_id)
follower_resource_group_name = "followerResourceGroup"
leader_resource_group_name = "leaderResourceGroup"
follower_cluster_name = "follower"
leader_cluster_name = "leader"
attached_database_Configuration_name = "uniqueNameForAttachedDatabaseConfiguration"
database_name = "db" # Can be a specific database name in a leader cluster or * for all databases
default_principals_modification_kind = "Union"
location = "North Central US"
cluster_resource_id = "/subscriptions/" + leader_subscription_id + "/resourceGroups/" + leader_resource_group_name + "/providers/Microsoft.Kusto/Clusters/" + leader_cluster_name
table_level_sharing_properties = None
if (database_name != "*"):
#Set up the table level sharing properties - the following is just an example.
tables_to_include = ["table1", "table2", "table3"]
external_tables_to_exclude = ["Logs*"]
table_level_sharing_properties = TableLevelSharingProperties(tables_to_include = tables_to_include, external_tables_to_exclude = external_tables_to_exclude)
attached_database_configuration_properties = AttachedDatabaseConfiguration(cluster_resource_id = cluster_resource_id, database_name = database_name, default_principals_modification_kind = default_principals_modification_kind, location = location, table_level_sharing_properties = table_level_sharing_properties)
#Returns an instance of LROPoller, see https://learn.microsoft.com/python/api/msrest/msrest.polling.lropoller?view=azure-python
poller = kusto_management_client.attached_database_configurations.begin_create_or_update(follower_resource_group_name, follower_cluster_name, attached_database_Configuration_name, attached_database_configuration_properties)
PowerShell を使用してデータベースをアタッチする
前提条件モジュール
Install : Az.Kusto
PowerShell の例
$FollowerClustername = 'follower'
$FollowerClusterSubscriptionID = 'xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx'
$FollowerResourceGroupName = 'followerResourceGroup'
$DatabaseName = "db" ## Can be a specific database name in a leader cluster or * for all databases
$FollowerDatabaseName = 'followerdbname' ## Use this option if the follower database requires a different name than the leader database.
$LeaderClustername = 'leader'
$LeaderClusterSubscriptionID = 'xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx'
$LeaderClusterResourceGroup = 'leaderResourceGroup'
$DefaultPrincipalsModificationKind = 'Union'
##Construct the LeaderClusterResourceId and Location
$getleadercluster = Get-AzKustoCluster -Name $LeaderClustername -ResourceGroupName $LeaderClusterResourceGroup -SubscriptionId $LeaderClusterSubscriptionID -ErrorAction Stop
$LeaderClusterResourceid = $getleadercluster.Id
$Location = $getleadercluster.Location
## Handle the config name if all databases need to be followed. The config name can be given any unique name
if($DatabaseName -eq '*') {
$configname = $FollowerClustername + 'config'
}
else {
$configname = $DatabaseName
}
##Table level sharing is not supported when using '*' all databases notation. If you use the all database notation please remove all table level sharing lines from the powershell command.
New-AzKustoAttachedDatabaseConfiguration -ClusterName $FollowerClustername `
-Name $configname `
-ResourceGroupName $FollowerResourceGroupName `
-SubscriptionId $FollowerClusterSubscriptionID `
-DatabaseName $DatabaseName ` ## Leader database name.
-DatabaseNameOverride $FollowerDatabaseName ` ## Use this option if the follower database requires a different name than the leader database. Otherwise, this parameter can be removed.
-ClusterResourceId $LeaderClusterResourceid `
-DefaultPrincipalsModificationKind $DefaultPrincipalsModificationKind `
-Location $Location `
-TableLevelSharingPropertyTablesToInclude "table1", "table2", "table3" `
-TableLevelSharingPropertyExternalTablesToExclude "Logs*" `
-ErrorAction Stop
Azure Resource Manager テンプレートを使用したデータベースのアタッチ
Azure Resource Manager を使用してデータベースを既存のクラスターにアタッチできます。
データベースをアタッチするには、次の手順に従います。
次の表にある情報を使用してテンプレートを作成すると、テンプレートの構成に役立ちます。
|
パラメーター |
説明 |
例 |
|
followerClusterName |
フォロワー クラスターの名前。テンプレートがデプロイされている場所。 |
|
|
attachedDatabaseConfigurationsName |
アタッチされたデータベースの構成オブジェクトの名前。 クラスター レベルで一意であれば、名前には任意の文字列を指定できます。 |
|
|
databaseName |
フォローするデータベースの名前。 リーダーのデータベースをすべてフォローする場合は、'*' を使用します。 |
|
|
leaderClusterResourceId |
リーダー クラスターのリソース ID。 |
|
|
デフォルト主体変更種別 |
既定のプリンシパル変更の種類。 |
Union、Replace、または None を指定できます。 既定のプリンシパル変更の種類について詳しくは、「プリンシパル変更の種類の管理コマンド」をご覧ください。 |
|
tablesToInclude |
含めるテーブルの一覧です。 'Logs' で始まるすべてのテーブルを含めるには、["Logs*"] を使用します。 |
["table1ToInclude", "table2ToInclude"] |
|
除外するテーブル |
除外するテーブルの一覧です。 すべてのテーブルを除外するには、["*"] を使用します。 |
["table1ToExclude", "table2ToExclude"] |
|
externalTablesToInclude(含める外部テーブル) |
含めるテーブルの一覧です。 'Logs' で始まるすべての外部テーブルを含めるには、["Logs*"] を使用します。 |
["ExternalTable1ToInclude", "ExternalTable2ToInclude"] |
|
除外する外部テーブル |
除外するテーブルの一覧です。 すべての外部テーブルを除外するには、["*"] を使用します。 |
["ExternalTable1ToExclude", "ExternalTable2ToExclude"] |
|
インクルードするマテリアライズドビュー |
含める具体化されたビューの一覧です。 'Logs' で始まる具体化されたビューをすべて含めるには、["Logs*"] を使用します。 |
["Mv1ToInclude", "Mv2ToInclude"] |
|
除外するマテリアライズドビュー |
除外する具体化されたビューの一覧です。 すべての具体化されたビューを除外するには、["*"] を使用します。 |
["Mv11ToExclude", "Mv22ToExclude"] |
|
含める関数 |
含める関数の一覧。 |
["FunctionToInclude"] |
|
除外する機能 |
除外する関数の一覧。 |
["FunctionToExclude"] |
|
場所 |
すべてのリソースの場所。 リーダーとフォロワーは同じ場所にある必要があります。 |
|
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"followerClusterName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Name of the cluster to which the database will be attached."
}
},
"attachedDatabaseConfigurationsName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Name of the attached database configurations to create."
}
},
"databaseName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The name of the database to follow. You can follow all databases by using '*'."
}
},
"leaderClusterResourceId": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The resource ID of the leader cluster."
}
},
"defaultPrincipalsModificationKind": {
"type": "string",
"defaultValue": "Union",
"metadata": {
"description": "The default principal modification kind."
}
},
"tablesToInclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of tables to include. Not supported when following all databases."
}
},
"tablesToExclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of tables to exclude. Not supported when following all databases."
}
},
"externalTablesToInclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of external tables to include. Not supported when following all databases."
}
},
"externalTablesToExclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of external tables to exclude. Not supported when following all databases."
}
},
"materializedViewsToInclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of materialized views to include. Not supported when following all databases."
}
},
"materializedViewsToExclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of materialized views to exclude. Not supported when following all databases."
}
},
"functionsToInclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of functions to include."
}
},
"functionsToExclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of functions to exclude."
}
},
"location": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {},
"resources": [
{
"name": "[concat(parameters('followerClusterName'), '/', parameters('attachedDatabaseConfigurationsName'))]",
"type": "Microsoft.Kusto/clusters/attachedDatabaseConfigurations",
"apiVersion": "2021-01-01",
"location": "[parameters('location')]",
"properties": {
"databaseName": "[parameters('databaseName')]",
"clusterResourceId": "[parameters('leaderClusterResourceId')]",
"defaultPrincipalsModificationKind": "[parameters('defaultPrincipalsModificationKind')]",
"tableLevelSharingProperties":{
"tablesToInclude": "[parameters('tablesToInclude')]",
"tablesToExclude": "[parameters('tablesToExclude')]",
"externalTablesToInclude": "[parameters('externalTablesToInclude')]",
"externalTablesToExclude": "[parameters('externalTablesToExclude')]",
"materializedViewsToInclude": "[parameters('materializedViewsToInclude')]",
"materializedViewsToExclude": "[parameters('materializedViewsToExclude')]",
"functionsToInclude": "[parameters('functionsToInclude')]",
"functionsToExclude": "[parameters('functionsToExclude')]"
}
}
}
]
}
Azure portal または PowerShell を使用して Azure Resource Manager テンプレートをデプロイします。
データベースが正常にアタッチされたことを確認する
データベースが正常にアタッチされたことを確認するには、Azure portal でアタッチされたデータベースを見つけます。
フォロワーまたはリーダー のクラスターでデータベースが正常にアタッチされたことを確認できます。
フォロワー クラスターを確認する
フォロワー クラスターを参照し、[データベース] を選択します。
データベースの一覧で、新しい読み取り専用データベースを検索します。
データベースの概要ページで、この一覧を表示することもできます。
リーダー クラスターを確認する
リーダー クラスターを参照し、[データベース] を選択します。
関連するデータベースの [他のユーザーと共有]> が [はい] に設定されていることを確認します。
リレーションシップ リンクを切り替えて、詳細を表示します。
これは、データベースの概要ページでも確認できます。
フォロワー データベースをデタッチする
注
フォロワー側またはリーダー側からデータベースをデタッチするには、データベースをデタッチするクラスターで、少なくとも共同作成者ロールを持つユーザー、グループ、サービス プリンシパル、またはマネージド ID が必要です。 下の例では、サービス プリンシパルを使用します。
C#** を使用して、フォロワー クラスターにアタッチされたフォロワー データベースをデタッチする
フォロワー クラスターにアタッチされたフォロワー データベースは、次の方法でデタッチできます。
var attachedDatabaseConfigurationId = KustoAttachedDatabaseConfigurationResource.CreateResourceIdentifier(
subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "testrg", clusterName: "follower",
attachedDatabaseConfigurationName: "attachedDatabaseConfiguration");
var credentials = new ManagedIdentityCredential();
var resourceManagementClient = new ArmClient(credentials);
var attachedDatabaseConfiguration = resourceManagementClient.GetKustoAttachedDatabaseConfigurationResource(attachedDatabaseConfigurationId);
await attachedDatabaseConfiguration.DeleteAsync(WaitUntil.Completed);
C# を使用して、リーダー クラスターにアタッチされたフォロワー データベースをデタッチする
リーダー クラスターにアタッチされたデータベースは、次の方法でデタッチできます。
var leaderClusterId = KustoClusterResource.CreateResourceIdentifier(subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "testrg", clusterName: "leader");
var followerClusterId = KustoClusterResource.CreateResourceIdentifier(subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "followerResourceGroup", clusterName: "follower");
var followerDatabaseDefinition = new KustoFollowerDatabaseDefinition(
clusterResourceId: followerClusterId,
attachedDatabaseConfigurationName: "attachedDatabaseConfiguration"
);
var credentials = new ManagedIdentityCredential();
var resourceManagementClient = new ArmClient(credentials);
var leaderCluster = resourceManagementClient.GetKustoClusterResource(leaderClusterId);
await leaderCluster.DetachFollowerDatabasesAsync(WaitUntil.Completed, followerDatabaseDefinition);
Python を使用して、フォロワー クラスターにアタッチされたフォロワー データベースをデタッチする
フォロワー クラスターにアタッチされたデータベースは、次の方法でデタッチできます。
from azure.mgmt.kusto import KustoManagementClient
from azure.common.credentials import ServicePrincipalCredentials
import datetime
#Directory (tenant) ID
tenant_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Application ID
client_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Client Secret
client_secret = "xxxxxxxxxxxxxx"
follower_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
credentials = ServicePrincipalCredentials(
client_id=client_id,
secret=client_secret,
tenant=tenant_id
)
kusto_management_client = KustoManagementClient(credentials, follower_subscription_id)
follower_resource_group_name = "followerResourceGroup"
follower_cluster_name = "follower"
attached_database_configurationName = "uniqueName"
#Returns an instance of LROPoller, see https://learn.microsoft.com/python/api/msrest/msrest.polling.lropoller?view=azure-python
poller = kusto_management_client.attached_database_configurations.delete(follower_resource_group_name, follower_cluster_name, attached_database_configurationName)
Python を使用して、リーダー クラスターにアタッチされたフォロワー データベースをデタッチする
リーダー クラスターにアタッチされたデータベースは、次の方法でデタッチできます。
from azure.mgmt.kusto import KustoManagementClient
from azure.mgmt.kusto.models import FollowerDatabaseDefinition
from azure.common.credentials import ServicePrincipalCredentials
import datetime
#Directory (tenant) ID
tenant_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Application ID
client_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Client Secret
client_secret = "xxxxxxxxxxxxxx"
follower_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
leader_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
credentials = ServicePrincipalCredentials(
client_id=client_id,
secret=client_secret,
tenant=tenant_id
)
kusto_management_client = KustoManagementClient(credentials, follower_subscription_id)
follower_resource_group_name = "followerResourceGroup"
leader_resource_group_name = "leaderResourceGroup"
follower_cluster_name = "follower"
leader_cluster_name = "leader"
attached_database_configuration_name = "uniqueName"
location = "North Central US"
cluster_resource_id = "/subscriptions/" + follower_subscription_id + "/resourceGroups/" + follower_resource_group_name + "/providers/Microsoft.Kusto/Clusters/" + follower_cluster_name
#Returns an instance of LROPoller, see https://learn.microsoft.com/python/api/msrest/msrest.polling.lropoller?view=azure-python
poller = kusto_management_client.clusters.detach_follower_databases(resource_group_name = leader_resource_group_name, cluster_name = leader_cluster_name, cluster_resource_id = cluster_resource_id, attached_database_configuration_name = attached_database_configuration_name)
PowerShell を使用してデータベースをデタッチする
前提条件モジュール
Install : Az.Kusto
例
$FollowerClustername = 'follower'
$FollowerClusterSubscriptionID = 'xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx'
$FollowerResourceGroupName = 'followerResourceGroup'
$DatabaseName = "sanjn" ## Can be specific database name or * for all databases
##Construct the Configuration name
$confignameraw = (Get-AzKustoAttachedDatabaseConfiguration -ClusterName $FollowerClustername -ResourceGroupName $FollowerResourceGroupName -SubscriptionId $FollowerClusterSubscriptionID) | Where-Object {$_.DatabaseName -eq $DatabaseName }
$configname =$confignameraw.Name.Split("/")[1]
Remove-AzKustoAttachedDatabaseConfiguration -ClusterName $FollowerClustername -Name $configname -ResourceGroupName $FollowerResourceGroupName -SubscriptionId $FollowerClusterSubscriptionID
プリンシパル、アクセス許可、キャッシュ ポリシーの管理
プリンシパルの管理
データベースをアタッチするときは、"既定のプリンシパル変更の種類" を指定します。 既定では、オーバーライドの承認されたプリンシパルと、承認されたプリンシパルのリーダー データベース コレクションを組み合わせます。
|
親切 |
説明 |
|
Union (結合) |
アタッチされたデータベース プリンシパルには、元のデータベース プリンシパルと、フォロワー データベースに追加されたその他の新しいプリンシパルが常に含まれます。 |
|
取り替える |
元のデータベースから継承されるプリンシパルはありません。 アタッチされたデータベース用に新しいプリンシパルを作成する必要があります。 |
|
なし |
アタッチされたデータベース プリンシパルには、元のデータベースのプリンシパルのみが含まれます。その他のプリンシパルはありません。 |
管理コマンドを使用して承認されたプリンシパルを構成する方法について詳しくは、「フォロワー クラスターを管理するための管理コマンド」をご覧ください。
アクセス許可の管理
読み取り専用データベースのアクセス許可は、他のデータベースの種類と同じ方法で管理できます。 アクセス許可を割り当てるには、「Azure portal でのデータベースの管理アクセス許可」を参照するか、管理コマンドを使用してデータベース セキュリティ ロールを 管理します。
フォロワー データベースの管理者は、ホスティング クラスター上でアタッチされたデータベースまたはその任意のテーブルのキャッシュ ポリシー を変更できます。 既定では、リーダー クラスター データベースのソース データベースとテーブルレベルのキャッシュ ポリシーは、データベースで定義されているポリシーとテーブルレベルのオーバーライド ポリシーと組み合わされます。 たとえば、リーダー データベースでは月次レポートを実行するために 30 日間のキャッシュ ポリシーを設定し、フォロワー データベースでは、トラブルシューティング用に最新のデータのみのクエリを実行するため、3 日間のキャッシュ ポリシーを設定することができます。 管理コマンドを使用してフォロワー データベースやテーブルのキャッシュ ポリシーを構成する方法について詳しくは、「フォロワー クラスターを管理するための管理コマンド」をご覧ください。
メモ
次の注意事項を確認します。
- リーダー/フォロワー クラスターのデータベース間に競合がある場合、フォロワー クラスターがすべてのデータベースをフォローすると、次のように解決されます。
- フォロワー クラスターで作成された DB という名前のデータベースは、リーダー クラスターで作成された同じ名前のデータベースよりも優先されます。 そのため、フォロワー クラスターでリーダーのデータベース DB を含めるために、フォロワー クラスターのデータベース DB を削除または名前変更する必要があります。
- 2 つ以上のリーダー クラスターからフォローされる DB という名前のデータベースは、リーダー クラスターの "いずれか" から任意に選択され、複数回フォローされなくなります。
- フォロワー クラスターで実行された クラスター アクティビティ ログと履歴 を示すコマンドは、フォロワー クラスターのアクティビティと履歴を示し、その結果セットにはリーダー クラスターまたはクラスターの結果は含まれません。
- たとえば、フォロワー クラスターで実行される
.show queries コマンドでは、データベースに対して実行されたクエリとその後のフォロワー クラスターのみが表示され、リーダー クラスター内の同じデータベースに対して実行されるクエリは表示されません。
制限事項
次の制限事項を確認します。
- フォロワー クラスターとリーダー クラスターは、同じリージョンに存在する必要があります。
- フォロー対象のデータベースでストリーミング インジェストが使用されている場合は、ストリーミング インジェスト データをフォローできるように、フォロワー クラスターでストリーミング インジェストを有効にする必要があります。
-
カスタマー マネージド キー (CMK) を使用したデータ暗号化のクラスターのフォローには、次の制限があります。
- フォロワー クラスターまたはリーダー クラスターが他のクラスターをフォローしていません。
- フォロワー クラスターが CMK が有効になっているリーダー クラスターをフォローしていて、そのキーへのリーダーのアクセスが取り消された場合、リーダークラスターとフォロワー クラスターの両方が一時停止されます。 このような場合は、CMK の問題を解決してからフォロワー クラスターを再開するか、フォロワー クラスターからフォロワー データベースをデタッチしてリーダー クラスターから独立して再開することができます。
- 別のクラスターにアタッチされているデータベースは、デタッチ前に削除することはできません。
- 別のクラスターにアタッチされているデータベースを持つクラスターは、デタッチ前に削除することはできません。
- すべてのデータベースをフォローしている場合、テーブル レベルの共有プロパティはサポートされません。
- フォロワー データベースでは、認証方法としてマネージド ID を使用する外部テーブルに対してクエリを実行するには、マネージド ID をフォロワー クラスターに追加する必要があります。 リーダー クラスターとフォロワー クラスターが異なるテナントにプロビジョニングされている場合、この機能は動作しません。
次のステップ