diff --git a/tidb-cloud/manage-user-access.md b/tidb-cloud/manage-user-access.md index cfd8f1918d9dc..55f7e609f9465 100644 --- a/tidb-cloud/manage-user-access.md +++ b/tidb-cloud/manage-user-access.md @@ -29,18 +29,20 @@ TiDB Cloudは、組織、プロジェクト、リソースに基づいた階層 以下は階層構造の一例です。 - - Your organization - - TiDB X instances out of any project - - TiDB Cloud Starter instance 1 - - TiDB Cloud Essential instance 1 - - TiDB X project 1 - - TiDB Cloud Starter instance 2 - - TiDB Cloud Starter instance 3 - - TiDB Cloud Essential instance 2 - - TiDB Cloud Premium instance 1 - - TiDB Dedicated project 1 - - TiDB Cloud Dedicated cluster 1 - - TiDB Cloud Dedicated cluster 2 +``` +- Your organization + - TiDB X instances out of any project + - TiDB Cloud Starter instance 1 + - TiDB Cloud Essential instance 1 + - TiDB X project 1 + - TiDB Cloud Starter instance 2 + - TiDB Cloud Starter instance 3 + - TiDB Cloud Essential instance 2 + - TiDB Cloud Premium instance 1 + - TiDB Dedicated project 1 + - TiDB Cloud Dedicated cluster 1 + - TiDB Cloud Dedicated cluster 2 +``` この構造の下では: diff --git a/tidb-cloud/migrate-from-mysql-using-data-migration.md b/tidb-cloud/migrate-from-mysql-using-data-migration.md index 1fe45f9e808e8..98f43dbed4d86 100644 --- a/tidb-cloud/migrate-from-mysql-using-data-migration.md +++ b/tidb-cloud/migrate-from-mysql-using-data-migration.md @@ -219,16 +219,20 @@ SHOW VARIABLES WHERE Variable_name IN 1. `/etc/my.cnf`を開いて、以下を追加します。 - [mysqld] - log_bin = mysql-bin - binlog_format = ROW - binlog_row_image = FULL - binlog_expire_logs_seconds = 604800 # 7 days retention - binlog_transaction_compression = OFF + ``` + [mysqld] + log_bin = mysql-bin + binlog_format = ROW + binlog_row_image = FULL + binlog_expire_logs_seconds = 604800 # 7 days retention + binlog_transaction_compression = OFF + ``` 2. 変更を適用するには、MySQLサービスを再起動してください。 - sudo systemctl restart mysqld + ``` + sudo systemctl restart mysqld + ``` 3. 設定が有効になっていることを確認するには、 `SHOW VARIABLES`ステートメントを再度実行してください。 diff --git a/tidb-cloud/security-concepts.md b/tidb-cloud/security-concepts.md index 4dfedef5c16d0..8623cbe5449a9 100644 --- a/tidb-cloud/security-concepts.md +++ b/tidb-cloud/security-concepts.md @@ -131,17 +131,19 @@ TiDB Cloudは、組織、プロジェクト、リソースという階層構造 ### 例となる構造 {#example-structure} - - Your organization - - TiDB X instances out of any project - - TiDB Cloud Starter instance 1 - - TiDB Cloud Essential instance 1 - - TiDB X project 1 - - TiDB Cloud Starter instance 2 - - TiDB Cloud Starter instance 3 - - TiDB Cloud Essential instance 2 - - TiDB Dedicated project 1 - - TiDB Cloud Dedicated cluster 1 - - TiDB Cloud Dedicated cluster 2 +``` +- Your organization + - TiDB X instances out of any project + - TiDB Cloud Starter instance 1 + - TiDB Cloud Essential instance 1 + - TiDB X project 1 + - TiDB Cloud Starter instance 2 + - TiDB Cloud Starter instance 3 + - TiDB Cloud Essential instance 2 + - TiDB Dedicated project 1 + - TiDB Cloud Dedicated cluster 1 + - TiDB Cloud Dedicated cluster 2 +``` ### 主な機能 {#key-features} diff --git a/tidb-cloud/set-up-vpc-peering-connections.md b/tidb-cloud/set-up-vpc-peering-connections.md index 8a54eaaeda38f..11fe256af039a 100644 --- a/tidb-cloud/set-up-vpc-peering-connections.md +++ b/tidb-cloud/set-up-vpc-peering-connections.md @@ -156,11 +156,13 @@ AWS CLI または AWS ダッシュボードを使用して、VPC ピアリング 例えば: - # Sets up the related variables - pcx_tidb_to_app_id="pcx-069f41efddcff66c8" - app_region="us-west-2" - app_vpc_id="vpc-0039fb90bb5cf8698" - tidbcloud_project_cidr="10.250.0.0/16" + ``` + # Sets up the related variables + pcx_tidb_to_app_id="pcx-069f41efddcff66c8" + app_region="us-west-2" + app_vpc_id="vpc-0039fb90bb5cf8698" + tidbcloud_project_cidr="10.250.0.0/16" + ``` 4. 次のコマンドを実行します。 diff --git a/tidb-cloud/terraform-migrate-cluster-resource.md b/tidb-cloud/terraform-migrate-cluster-resource.md index c1814142f148f..563a234b3a4a5 100644 --- a/tidb-cloud/terraform-migrate-cluster-resource.md +++ b/tidb-cloud/terraform-migrate-cluster-resource.md @@ -45,19 +45,23 @@ terraform state rm ${your_target_cluster_resource} - ターゲット クラスターがTiDB Cloud Starter の場合は、次のインポート ブロックを`.tf`ファイルに追加し、 `example`目的のリソース名に置き換え、 `${id}` [ステップ1](#step-1-identify-the-tidbcloud_cluster-resource-to-migrate)から取得したクラスター ID に置き換えます。 - # TiDB Cloud Starter - import { - to = tidbcloud_serverless_cluster.example - id = "${id}" - } + ``` + # TiDB Cloud Starter + import { + to = tidbcloud_serverless_cluster.example + id = "${id}" + } + ``` - ターゲット クラスターがTiDB Cloud Dedicated の場合は、次のインポート ブロックを`.tf`ファイルに追加し、 `example`目的のリソース名に置き換え、 `${id}` [ステップ1](#step-1-identify-the-tidbcloud_cluster-resource-to-migrate)から取得したクラスター ID に置き換えます。 - # TiDB Cloud Dedicated - import { - to = tidbcloud_dedicated_cluster.example - id = "${id}" - } + ``` + # TiDB Cloud Dedicated + import { + to = tidbcloud_dedicated_cluster.example + id = "${id}" + } + ``` ## ステップ5. 新しい構成ファイルを生成する {#step-5-generate-the-new-configuration-file} diff --git a/tidb-cloud/terraform-use-dedicated-network-container-resource.md b/tidb-cloud/terraform-use-dedicated-network-container-resource.md index 2f1f430822812..944409bc513c0 100644 --- a/tidb-cloud/terraform-use-dedicated-network-container-resource.md +++ b/tidb-cloud/terraform-use-dedicated-network-container-resource.md @@ -35,24 +35,26 @@ summary: tidbcloud_dedicated_network_container` リソースを使用して、 T 2. `network_container.tf`ファイルを作成します。 - terraform { - required_providers { - tidbcloud = { - source = "tidbcloud/tidbcloud" - } - } + ``` + terraform { + required_providers { + tidbcloud = { + source = "tidbcloud/tidbcloud" } + } + } - provider "tidbcloud" { - public_key = "your_public_key" - private_key = "your_private_key" - } + provider "tidbcloud" { + public_key = "your_public_key" + private_key = "your_private_key" + } - resource "tidbcloud_dedicated_network_container" "example" { - project_id = "1372813089454000000" - region_id = "aws-ap-northeast-2" - cidr_notation = "172.16.16.0/21" - } + resource "tidbcloud_dedicated_network_container" "example" { + project_id = "1372813089454000000" + region_id = "aws-ap-northeast-2" + cidr_notation = "172.16.16.0/21" + } + ``` `resource`ブロックを使用して、リソース タイプ、リソース名、リソースの詳細など、 TiDB Cloudのリソースを定義します。 @@ -144,10 +146,12 @@ Terraform によって管理されていないTiDB Cloud Dedicated ネットワ 次のインポート ブロックを`.tf`ファイルに追加し、 `example`目的のリソース名に置き換え、 `${id}` `cluster_id,network_container_id`の形式に置き換えます。 - import { - to = tidbcloud_dedicated_network_container.example - id = "${id}" - } + ``` + import { + to = tidbcloud_dedicated_network_container.example + id = "${id}" + } + ``` 2. 新しい構成ファイルを生成します。 @@ -223,4 +227,6 @@ TiDB Cloud Dedicated クラスターを削除するには、 `tidbcloud_dedicate ここで、 `terraform show`コマンドを実行すると、リソースがクリアされているため、管理対象リソースは表示されません。 - $ terraform show +``` +$ terraform show +``` diff --git a/tidb-cloud/terraform-use-dedicated-private-endpoint-connection-resource.md b/tidb-cloud/terraform-use-dedicated-private-endpoint-connection-resource.md index 966718b93f7bd..b10806a672ba1 100644 --- a/tidb-cloud/terraform-use-dedicated-private-endpoint-connection-resource.md +++ b/tidb-cloud/terraform-use-dedicated-private-endpoint-connection-resource.md @@ -32,24 +32,26 @@ summary: tidbcloud_dedicated_private_endpoint_connection` リソースを使用 2. `private_endpoint_connection.tf`ファイルを作成します。 - terraform { - required_providers { - tidbcloud = { - source = "tidbcloud/tidbcloud" - } - } + ``` + terraform { + required_providers { + tidbcloud = { + source = "tidbcloud/tidbcloud" } + } + } - provider "tidbcloud" { - public_key = "your_public_key" - private_key = "your_private_key" - } + provider "tidbcloud" { + public_key = "your_public_key" + private_key = "your_private_key" + } - resource "tidbcloud_dedicated_private_endpoint_connection" "example" { - cluster_id = "your_cluster_id" - node_group_id = "your_node_group_id" - endpoint_id = "your_endpoint_id" - } + resource "tidbcloud_dedicated_private_endpoint_connection" "example" { + cluster_id = "your_cluster_id" + node_group_id = "your_node_group_id" + endpoint_id = "your_endpoint_id" + } + ``` `resource`ブロックを使用して、リソース タイプ、リソース名、リソースの詳細など、 TiDB Cloudのリソースを定義します。 @@ -150,10 +152,12 @@ Terraform によって管理されていないTiDB Cloud Dedicated プライベ 次のインポート ブロックを`.tf`ファイルに追加し、 `example`目的のリソース名に置き換え、 `${id}` `cluster_id,dedicated_private_endpoint_connection_id`の形式に置き換えます。 - import { - to = tidbcloud_dedicated_private_endpoint_connection.example - id = "${id}" - } + ``` + import { + to = tidbcloud_dedicated_private_endpoint_connection.example + id = "${id}" + } + ``` 2. 新しい構成ファイルを生成します。 @@ -232,4 +236,6 @@ TiDB Cloud Dedicated プライベート エンドポイント接続を削除す ここで、コマンド`terraform show`を実行すると、リソースがクリアされているため何も表示されません。 - $ terraform show +``` +$ terraform show +``` diff --git a/tidb-cloud/terraform-use-dedicated-vpc-peering-resource.md b/tidb-cloud/terraform-use-dedicated-vpc-peering-resource.md index 56fecf9818669..878760a8c1e25 100644 --- a/tidb-cloud/terraform-use-dedicated-vpc-peering-resource.md +++ b/tidb-cloud/terraform-use-dedicated-vpc-peering-resource.md @@ -31,26 +31,28 @@ summary: tidbcloud_dedicated_vpc_peering` リソースを使用して、 TiDB Cl 2. `vpc_peering.tf`ファイルを作成します。 - terraform { - required_providers { - tidbcloud = { - source = "tidbcloud/tidbcloud" - } - } + ``` + terraform { + required_providers { + tidbcloud = { + source = "tidbcloud/tidbcloud" } + } + } - provider "tidbcloud" { - public_key = "your_public_key" - private_key = "your_private_key" - } + provider "tidbcloud" { + public_key = "your_public_key" + private_key = "your_private_key" + } - resource "tidbcloud_dedicated_vpc_peering" "example" { - tidb_cloud_region_id = "your_tidb_cloud_region_id" - customer_region_id = "your_customer_region_id" - customer_account_id = "your_customer_account_id" - customer_vpc_id = "your_customer_vpc_id" - customer_vpc_cidr = "your_customer_vpc_cidr" - } + resource "tidbcloud_dedicated_vpc_peering" "example" { + tidb_cloud_region_id = "your_tidb_cloud_region_id" + customer_region_id = "your_customer_region_id" + customer_account_id = "your_customer_account_id" + customer_vpc_id = "your_customer_vpc_id" + customer_vpc_cidr = "your_customer_vpc_cidr" + } + ``` `resource`ブロックを使用して、リソース タイプ、リソース名、リソースの詳細など、 TiDB Cloudのリソースを定義します。 @@ -152,10 +154,12 @@ Terraform によって管理されていないTiDB Cloud Dedicated VPC ピアリ 次のインポート ブロックを`.tf`ファイルに追加し、 `example`目的のリソース名に置き換え、 `${vpc_peering_id}`実際の VPC ピアリング ID に置き換えます。 - import { - to = tidbcloud_dedicated_vpc_peering.example - id = "${vpc_peering_id}" - } + ``` + import { + to = tidbcloud_dedicated_vpc_peering.example + id = "${vpc_peering_id}" + } + ``` 2. 新しい構成ファイルを生成します。 @@ -234,4 +238,6 @@ TiDB Cloud Dedicated VPC ピアリングを削除するには、 `tidbcloud_dedi ここで、コマンド`terraform show`を実行すると、リソースがクリアされているため何も表示されません。 - $ terraform show +``` +$ terraform show +``` diff --git a/tidb-cloud/terraform-use-restore-resource.md b/tidb-cloud/terraform-use-restore-resource.md index c01ec4eb4ca1a..70e7289a76efb 100644 --- a/tidb-cloud/terraform-use-restore-resource.md +++ b/tidb-cloud/terraform-use-restore-resource.md @@ -30,144 +30,150 @@ summary: tidbcloud_restore` リソースを使用して復元タスクを作成 例えば: - terraform { - required_providers { - tidbcloud = { - source = "tidbcloud/tidbcloud" - } - } - } - - provider "tidbcloud" { - public_key = "your_public_key" - private_key = "your_private_key" - } - resource "tidbcloud_restore" "example_restore" { - project_id = tidbcloud_cluster.example_cluster.project_id - backup_id = tidbcloud_backup.example_backup.id - name = "restoreCluster" - config = { - root_password = "Your_root_password1." - port = 4000 - components = { - tidb = { - node_size : "8C16G" - node_quantity : 2 - } - tikv = { - node_size : "8C32G" - storage_size_gib : 500 - node_quantity : 6 - } - tiflash = { - node_size : "8C64G" - storage_size_gib : 500 - node_quantity : 2 - } - } + ``` + terraform { + required_providers { + tidbcloud = { + source = "tidbcloud/tidbcloud" + } + } + } + + provider "tidbcloud" { + public_key = "your_public_key" + private_key = "your_private_key" + } + resource "tidbcloud_restore" "example_restore" { + project_id = tidbcloud_cluster.example_cluster.project_id + backup_id = tidbcloud_backup.example_backup.id + name = "restoreCluster" + config = { + root_password = "Your_root_password1." + port = 4000 + components = { + tidb = { + node_size : "8C16G" + node_quantity : 2 + } + tikv = { + node_size : "8C32G" + storage_size_gib : 500 + node_quantity : 6 + } + tiflash = { + node_size : "8C64G" + storage_size_gib : 500 + node_quantity : 2 } } + } + } + ``` 3. `terraform apply`コマンドを実行し、確認のために`yes`入力します。 - $ terraform apply - tidbcloud_cluster.example_cluster: Refreshing state... [id=1379661944630234067] - tidbcloud_backup.example_backup: Refreshing state... [id=1350048] + ``` + $ terraform apply + tidbcloud_cluster.example_cluster: Refreshing state... [id=1379661944630234067] + tidbcloud_backup.example_backup: Refreshing state... [id=1350048] - Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: - + create + Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + + create - Terraform will perform the following actions: + Terraform will perform the following actions: - # tidbcloud_restore.example_restore will be created - + resource "tidbcloud_restore" "example_restore" { - + backup_id = "1350048" - + cluster = { - + id = (known after apply) - + name = (known after apply) - + status = (known after apply) - } - + cluster_id = (known after apply) - + config = { - + components = { - + tidb = { - + node_quantity = 2 - + node_size = "8C16G" - } - + tiflash = { - + node_quantity = 2 - + node_size = "8C64G" - + storage_size_gib = 500 - } - + tikv = { - + node_quantity = 6 - + node_size = "8C32G" - + storage_size_gib = 500 - } + # tidbcloud_restore.example_restore will be created + + resource "tidbcloud_restore" "example_restore" { + + backup_id = "1350048" + + cluster = { + + id = (known after apply) + + name = (known after apply) + + status = (known after apply) + } + + cluster_id = (known after apply) + + config = { + + components = { + + tidb = { + + node_quantity = 2 + + node_size = "8C16G" + } + + tiflash = { + + node_quantity = 2 + + node_size = "8C64G" + + storage_size_gib = 500 + } + + tikv = { + + node_quantity = 6 + + node_size = "8C32G" + + storage_size_gib = 500 } - + port = 4000 - + root_password = "Your_root_password1." } - + create_timestamp = (known after apply) - + error_message = (known after apply) - + id = (known after apply) - + name = "restoreCluster" - + project_id = "1372813089189561287" - + status = (known after apply) + + port = 4000 + + root_password = "Your_root_password1." } + + create_timestamp = (known after apply) + + error_message = (known after apply) + + id = (known after apply) + + name = "restoreCluster" + + project_id = "1372813089189561287" + + status = (known after apply) + } - Plan: 1 to add, 0 to change, 0 to destroy. + Plan: 1 to add, 0 to change, 0 to destroy. - Do you want to perform these actions? - Terraform will perform the actions described above. - Only 'yes' will be accepted to approve. + Do you want to perform these actions? + Terraform will perform the actions described above. + Only 'yes' will be accepted to approve. - Enter a value: yes + Enter a value: yes - tidbcloud_restore.example_restore: Creating... - tidbcloud_restore.example_restore: Creation complete after 1s [id=780114] + tidbcloud_restore.example_restore: Creating... + tidbcloud_restore.example_restore: Creation complete after 1s [id=780114] - Apply complete! Resources: 1 added, 0 changed, 0 destroyed. + Apply complete! Resources: 1 added, 0 changed, 0 destroyed. + ``` 4. `terraform state show tidbcloud_restore.${resource-name}`コマンドを使用して、復元タスクのステータスを確認します。 - $ terraform state show tidbcloud_restore.example_restore + ``` + $ terraform state show tidbcloud_restore.example_restore - # tidbcloud_restore.example_restore: - resource "tidbcloud_restore" "example_restore" { - backup_id = "1350048" - cluster = { - id = "1379661944630264072" - name = "restoreCluster" - status = "INITIALIZING" - } - cluster_id = "1379661944630234067" - config = { - components = { - tidb = { - node_quantity = 2 - node_size = "8C16G" - } - tiflash = { - node_quantity = 2 - node_size = "8C64G" - storage_size_gib = 500 - } - tikv = { - node_quantity = 6 - node_size = "8C32G" - storage_size_gib = 500 - } + # tidbcloud_restore.example_restore: + resource "tidbcloud_restore" "example_restore" { + backup_id = "1350048" + cluster = { + id = "1379661944630264072" + name = "restoreCluster" + status = "INITIALIZING" + } + cluster_id = "1379661944630234067" + config = { + components = { + tidb = { + node_quantity = 2 + node_size = "8C16G" + } + tiflash = { + node_quantity = 2 + node_size = "8C64G" + storage_size_gib = 500 + } + tikv = { + node_quantity = 6 + node_size = "8C32G" + storage_size_gib = 500 } - port = 4000 - root_password = "Your_root_password1." } - create_timestamp = "2022-08-26T08:16:33Z" - id = "780114" - name = "restoreCluster" - project_id = "1372813089189561287" - status = "PENDING" + port = 4000 + root_password = "Your_root_password1." } + create_timestamp = "2022-08-26T08:16:33Z" + id = "780114" + name = "restoreCluster" + project_id = "1372813089189561287" + status = "PENDING" + } + ``` 復元タスクのステータスは`PENDING` 、クラスターのステータスは`INITIALIZING`であることがわかります。 diff --git a/tidb-cloud/terraform-use-serverless-branch-resource.md b/tidb-cloud/terraform-use-serverless-branch-resource.md index fbffc00bd1d28..c16b33d96ce95 100644 --- a/tidb-cloud/terraform-use-serverless-branch-resource.md +++ b/tidb-cloud/terraform-use-serverless-branch-resource.md @@ -32,24 +32,26 @@ summary: サーバーレス ブランチ リソースを使用して、 TiDB Clo 2. `branch.tf`ファイルを作成します。 - terraform { - required_providers { - tidbcloud = { - source = "tidbcloud/tidbcloud" - } - } + ``` + terraform { + required_providers { + tidbcloud = { + source = "tidbcloud/tidbcloud" } + } + } - provider "tidbcloud" { - public_key = "your_public_key" - private_key = "your_private_key" - } + provider "tidbcloud" { + public_key = "your_public_key" + private_key = "your_private_key" + } - resource "tidbcloud_serverless_branch" "example" { - cluster_id = 10581524018573000000 - display_name = "example" - parent_id = 10581524018573000000 - } + resource "tidbcloud_serverless_branch" "example" { + cluster_id = 10581524018573000000 + display_name = "example" + parent_id = 10581524018573000000 + } + ``` `resource`ブロックを使用して、リソース タイプ、リソース名、リソースの詳細など、 TiDB Cloudのリソースを定義します。 @@ -166,17 +168,19 @@ Terraform によって管理されていないTiDB Cloud Starter またはTiDB C 次のインポート ブロックを`.tf`ファイルに追加し、 `example`目的のリソース名に置き換え、 `${id}` `cluster_id,branch_id`の形式に置き換えます。 - import { - to = tidbcloud_serverless_branch.example - id = "${id}" - } + ``` + import { + to = tidbcloud_serverless_branch.example + id = "${id}" + } + ``` 2. 新しい構成ファイルを生成します。 インポート ブロックに従って、新しい`tidbcloud_serverless_branch`リソースの新しい構成ファイルを生成します。 ```shell - terraform plan -generate-config-out=generated.tf + terraform plan -generate-config-out=generated.tf ``` 上記のコマンドでは、既存の`.tf`名を指定しないでください。指定した場合、Terraform はエラーを返します。 @@ -261,4 +265,6 @@ Apply complete! Resources: 0 added, 0 changed, 1 destroyed. ここで、 `terraform show`コマンドを実行すると、リソースがクリアされているため、管理対象リソースは表示されません。 - $ terraform show +``` +$ terraform show +``` diff --git a/tidb-cloud/terraform-use-serverless-export-resource.md b/tidb-cloud/terraform-use-serverless-export-resource.md index 467dfd97fa71e..9824cc9d4bf7f 100644 --- a/tidb-cloud/terraform-use-serverless-export-resource.md +++ b/tidb-cloud/terraform-use-serverless-export-resource.md @@ -32,22 +32,24 @@ summary: tidbcloud_serverless_export` リソースを使用して、 TiDB Cloud 以下は`export.tf`ファイルの例です。 - terraform { - required_providers { - tidbcloud = { - source = "tidbcloud/tidbcloud" - } - } + ``` + terraform { + required_providers { + tidbcloud = { + source = "tidbcloud/tidbcloud" } + } + } - provider "tidbcloud" { - public_key = "your_public_key" - private_key = "your_private_key" - } + provider "tidbcloud" { + public_key = "your_public_key" + private_key = "your_private_key" + } - resource "tidbcloud_serverless_export" "example" { - cluster_id = 10476959660988000000 - } + resource "tidbcloud_serverless_export" "example" { + cluster_id = 10476959660988000000 + } + ``` `resource`ブロックを使用して、リソース タイプ、リソース名、リソースの詳細など、 TiDB Cloudのリソースを定義します。 @@ -148,17 +150,19 @@ TiDB Cloud Starter またはTiDB Cloud Essential クラスターのデータ エ 次のインポート ブロックを`.tf`ファイルに追加し、 `example`目的のリソース名に置き換え、 `${id}` `cluster_id,export_id`の形式に置き換えます。 - import { - to = tidbcloud_serverless_export.example - id = "${id}" - } + ``` + import { + to = tidbcloud_serverless_export.example + id = "${id}" + } + ``` 2. 新しい構成ファイルを生成します。 インポート ブロックに従って、新しいサーバーレス エクスポート リソースの新しい構成ファイルを生成します。 ```shell - terraform plan -generate-config-out=generated.tf + terraform plan -generate-config-out=generated.tf ``` 上記のコマンドでは、既存の`.tf`名を指定しないでください。指定した場合、Terraform はエラーを返します。 @@ -226,4 +230,6 @@ Apply complete! Resources: 0 added, 0 changed, 1 destroyed. ここで、 `terraform show`コマンドを実行すると、リソースがクリアされているため、管理対象リソースは表示されません。 - $ terraform show +``` +$ terraform show +``` diff --git a/tidb-cloud/tidb-cloud-tune-performance-overview.md b/tidb-cloud/tidb-cloud-tune-performance-overview.md index 030a824924ebd..e814ac1e8da26 100644 --- a/tidb-cloud/tidb-cloud-tune-performance-overview.md +++ b/tidb-cloud/tidb-cloud-tune-performance-overview.md @@ -28,7 +28,9 @@ summary: TiDB Cloudで SQL パフォーマンスを分析および調整する ユーザー応答時間は、サービス時間、キュー時間、およびユーザー要求を完了するための同時待機時間で構成されます。 - User Response time = Service time + Queuing delay + Coherency delay +``` +User Response time = Service time + Queuing delay + Coherency delay +``` - サービス時間: リクエストを処理するときにシステムが特定のリソースに消費する時間。たとえば、データベースが SQL リクエストを完了するために消費する CPU 時間など。 - キューイング遅延: システムが要求を処理するときに、特定のリソースのサービスをキューで待機する時間。 @@ -61,7 +63,9 @@ TiDB Cloudコンソールには、ユーザー応答時間のトラブルシュ 2. 必要に応じて、TiDB トークンの制限を増やしてスループットを向上させることができます。 3. プリペアドプランキャッシュ機能が有効になっていて、ユーザー側で JDBC を使用する場合は、次の構成を使用することをお勧めします。 - useServerPrepStmts=true&cachePrepStmts=true& prepStmtCacheSize=1000&prepStmtCacheSqlLimit=20480&useConfigs=maxPerformance + ``` + useServerPrepStmts=true&cachePrepStmts=true& prepStmtCacheSize=1000&prepStmtCacheSqlLimit=20480&useConfigs=maxPerformance + ``` JDBC を使用せず、現在の TiDB クラスターのプリペアドプランキャッシュ機能を最大限に活用したい場合は、クライアント側でプリペアドステートメントオブジェクトをキャッシュする必要があります。StmtPrepare および StmtClose の呼び出しをリセットする必要はありません。クエリごとに呼び出されるコマンドの数を 3 から 1 に減らします。パフォーマンス要件とクライアント側の変更の量によっては、ある程度の開発作業が必要になります。[PingCAPサポートチーム](/tidb-cloud/tidb-cloud-support.md)に問い合わせてください。 diff --git a/tidb-cloud/troubleshoot-import-access-denied-error.md b/tidb-cloud/troubleshoot-import-access-denied-error.md index 7172720f46fe2..073d37d6758d2 100644 --- a/tidb-cloud/troubleshoot-import-access-denied-error.md +++ b/tidb-cloud/troubleshoot-import-access-denied-error.md @@ -23,23 +23,25 @@ TiDB Cloudコンソールの**「データインポート」**ページで**「 以下は信頼エンティティのサンプルです。 - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "AWS": "arn:aws:iam::380838443567:root" - }, - "Action": "sts:AssumeRole", - "Condition": { - "StringEquals": { - "sts:ExternalId": "696e6672612d617069a79c22fa5740944bf8bb32e4a0c4e3fe" - } +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::380838443567:root" + }, + "Action": "sts:AssumeRole", + "Condition": { + "StringEquals": { + "sts:ExternalId": "696e6672612d617069a79c22fa5740944bf8bb32e4a0c4e3fe" } } - ] - } + } + ] +} +``` サンプル信頼エンティティの場合: @@ -80,27 +82,29 @@ IAMユーザーのポリシーを確認するには、次の手順を実行し 以下にサンプルポリシーを示します。 - { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": [ - "s3:GetObject" - ], - "Resource": "arn:aws:s3:::tidb-cloud-source-data/mydata/*" - }, - { - "Sid": "VisualEditor1", - "Effect": "Allow", - "Action": [ - "s3:ListBucket", - "s3:GetBucketLocation" - ], - "Resource": "arn:aws:s3:::tidb-cloud-source-data" - }, - } +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": [ + "s3:GetObject" + ], + "Resource": "arn:aws:s3:::tidb-cloud-source-data/mydata/*" + }, + { + "Sid": "VisualEditor1", + "Effect": "Allow", + "Action": [ + "s3:ListBucket", + "s3:GetBucketLocation" + ], + "Resource": "arn:aws:s3:::tidb-cloud-source-data" + }, +} +``` ユーザーに権限を付与してテストする方法の詳細については、 [ユーザーポリシーによるバケットへのアクセスの制御](https://docs.aws.amazon.com/AmazonS3/latest/userguide/walkthrough1.html)を参照してください。 @@ -114,37 +118,39 @@ IAMユーザーのポリシーを確認するには、次の手順を実行し 以下はサンプルポリシーです。 - { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": [ - "s3:GetObject", - "s3:GetObjectVersion" - ], - "Resource": "arn:aws:s3:::tidb-cloud-source-data/mydata/*" - }, - { - "Sid": "VisualEditor1", - "Effect": "Allow", - "Action": [ - "s3:ListBucket", - "s3:GetBucketLocation" - ], - "Resource": "arn:aws:s3:::tidb-cloud-source-data" - }, - { - "Sid": "AllowKMSkey", - "Effect": "Allow", - "Action": [ - "kms:Decrypt" - ], - "Resource": "arn:aws:kms:ap-northeast-1:105880447796:key/c3046e91-fdfc-4f3a-acff-00597dd3801f" - } - ] - } +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": [ + "s3:GetObject", + "s3:GetObjectVersion" + ], + "Resource": "arn:aws:s3:::tidb-cloud-source-data/mydata/*" + }, + { + "Sid": "VisualEditor1", + "Effect": "Allow", + "Action": [ + "s3:ListBucket", + "s3:GetBucketLocation" + ], + "Resource": "arn:aws:s3:::tidb-cloud-source-data" + }, + { + "Sid": "AllowKMSkey", + "Effect": "Allow", + "Action": [ + "kms:Decrypt" + ], + "Resource": "arn:aws:kms:ap-northeast-1:105880447796:key/c3046e91-fdfc-4f3a-acff-00597dd3801f" + } + ] +} +``` このサンプル ポリシーでは、次の点に注意してください。 @@ -152,14 +158,16 @@ IAMユーザーのポリシーを確認するには、次の手順を実行し - カスタマー管理のキー暗号化で AWS Key Management Service キー (SSE-KMS) を有効にしている場合は、次の設定がポリシーに含まれていることを確認してください。`"arn:aws:kms:ap-northeast-1:105880447796:key/c3046e91-fdfc-4f3a-acff-00597dd3801f"`はバケットのサンプル KMS キーです。 - { - "Sid": "AllowKMSkey", - "Effect": "Allow", - "Action": [ - "kms:Decrypt" - ], - "Resource": "arn:aws:kms:ap-northeast-1:105880447796:key/c3046e91-fdfc-4f3a-acff-00597dd3801f" - } + ``` + { + "Sid": "AllowKMSkey", + "Effect": "Allow", + "Action": [ + "kms:Decrypt" + ], + "Resource": "arn:aws:kms:ap-northeast-1:105880447796:key/c3046e91-fdfc-4f3a-acff-00597dd3801f" + } + ``` バケット内のオブジェクトが別の暗号化バケットからコピーされた場合、KMSキーの値には両方のバケットのキーを含める必要があります。例: `"Resource": ["arn:aws:kms:ap-northeast-1:105880447796:key/c3046e91-fdfc-4f3a-acff-00597dd3801f","arn:aws:kms:ap-northeast-1:495580073302:key/0d7926a7-6ecc-4bf7-a9c1-a38f0faec0cd"]` 。 diff --git a/tidb-cloud/v8.5-performance-highlights.md b/tidb-cloud/v8.5-performance-highlights.md index 3b376197a2e23..82b1ced64a49e 100644 --- a/tidb-cloud/v8.5-performance-highlights.md +++ b/tidb-cloud/v8.5-performance-highlights.md @@ -43,9 +43,11 @@ MVCC バージョンが蓄積されると、要求されたデータと処理さ - クラスタ構成: - tikv_configs: - [in-memory-engine] - enable = true + ``` + tikv_configs: + [in-memory-engine] + enable = true + ``` - データセット: 頻繁に更新されるデータを含む、約 340 のリージョンを持つ 24 GiB のストレージサイズ diff --git a/tidb-lightning/tidb-lightning-data-source.md b/tidb-lightning/tidb-lightning-data-source.md index 06bcb1cd59d0a..522a8cdff024d 100644 --- a/tidb-lightning/tidb-lightning-data-source.md +++ b/tidb-lightning/tidb-lightning-data-source.md @@ -289,11 +289,13 @@ backslash-escape = true コンテンツの例: - ID,Region,Count - 1,"East",32 - 2,"South",\N - 3,"West",10 - 4,"North",39 +``` +ID,Region,Count +1,"East",32 +2,"South",\N +3,"West",10 +4,"North",39 +``` #### TSV {#tsv} @@ -309,11 +311,13 @@ backslash-escape = false コンテンツの例: - ID Region Count - 1 East 32 - 2 South NULL - 3 West 10 - 4 North 39 +``` +ID Region Count +1 East 32 +2 South NULL +3 West 10 +4 North 39 +``` #### TPC-H DBGEN {#tpc-h-dbgen} @@ -329,10 +333,12 @@ backslash-escape = false コンテンツの例: - 1|East|32| - 2|South|0| - 3|West|10| - 4|North|39| +``` +1|East|32| +2|South|0| +3|West|10| +4|North|39| +``` ## SQL {#sql} @@ -342,12 +348,14 @@ TiDB LightningはSQLファイルを処理する際に、単一のSQLファイル TiDB Lightningは現在、Amazon Aurora、Apache Hive、Snowflakeによって生成されたParquetファイルのみをサポートしています。S3内のファイル構造を識別するには、以下の設定を使用してすべてのデータファイルを一致させてください。 - [[mydumper.files]] - # The expression needed for parsing Amazon Aurora parquet files - pattern = '(?i)^(?:[^/]*/)*([a-z0-9\-_]+).([a-z0-9\-_]+)/(?:[^/]*/)*(?:[a-z0-9\-_.]+\.(parquet))$' - schema = '$1' - table = '$2' - type = '$3' +``` +[[mydumper.files]] +# The expression needed for parsing Amazon Aurora parquet files +pattern = '(?i)^(?:[^/]*/)*([a-z0-9\-_]+).([a-z0-9\-_]+)/(?:[^/]*/)*(?:[a-z0-9\-_.]+\.(parquet))$' +schema = '$1' +table = '$2' +type = '$3' +``` この設定は、 Auroraスナップショットによってエクスポートされた parquet ファイルを一致させる方法のみを示しています。スキーマファイルは別途エクスポートして処理する必要があります。 diff --git a/tidb-lightning/tidb-lightning-faq.md b/tidb-lightning/tidb-lightning-faq.md index 3e825912b3662..3bff847040fa0 100644 --- a/tidb-lightning/tidb-lightning-faq.md +++ b/tidb-lightning/tidb-lightning-faq.md @@ -38,12 +38,14 @@ TiDB Lightningはデフォルトで、ローカルデータソースとインポ ADMIN CHECKSUM TABLE `schema`.`table`; ``` - +---------+------------+---------------------+-----------+-------------+ - | Db_name | Table_name | Checksum_crc64_xor | Total_kvs | Total_bytes | - +---------+------------+---------------------+-----------+-------------+ - | schema | table | 5505282386844578743 | 3 | 96 | - +---------+------------+---------------------+-----------+-------------+ - 1 row in set (0.01 sec) +``` ++---------+------------+---------------------+-----------+-------------+ +| Db_name | Table_name | Checksum_crc64_xor | Total_kvs | Total_bytes | ++---------+------------+---------------------+-----------+-------------+ +| schema | table | 5505282386844578743 | 3 | 96 | ++---------+------------+---------------------+-----------+-------------+ +1 row in set (0.01 sec) +``` ## TiDB Lightningではどのようなデータ ソース形式がサポートされていますか? {#what-kinds-of-data-source-formats-are-supported-by-tidb-lightning} @@ -172,7 +174,9 @@ TiDB LightningでSQLの配置ルールを使用するには、データをター 1. 必要なスキーマのみを選択するには、 `-B test`を使用して元のスキーマのバックアップを作成します。 - tiup dumpling -B test -o /tmp/bck1 + ``` + tiup dumpling -B test -o /tmp/bck1 + ``` 2. 次の内容のファイルを`/tmp/tidb-lightning.toml`に作成します。 @@ -205,4 +209,6 @@ TiDB LightningでSQLの配置ルールを使用するには、データをター 3. この構成ファイルを使用してインポートを実行します。 - tiup tidb-lightning -config /tmp/tidb-lightning.toml + ``` + tiup tidb-lightning -config /tmp/tidb-lightning.toml + ``` diff --git a/tidb-lightning/tidb-lightning-physical-import-mode-usage.md b/tidb-lightning/tidb-lightning-physical-import-mode-usage.md index 9009f5813f224..154bbdaee5413 100644 --- a/tidb-lightning/tidb-lightning-physical-import-mode-usage.md +++ b/tidb-lightning/tidb-lightning-physical-import-mode-usage.md @@ -242,23 +242,25 @@ TPCCを使用してオンラインアプリケーションをシミュレート TiDB Lightningは、物理インポートモードでのインポートパフォーマンスに影響を与える同時実行性関連の設定項目をいくつか提供しています。しかし、長年の経験から、以下の4つの設定項目はデフォルト値のままにしておくことをお勧めします。これらの設定項目を調整しても、パフォーマンスが大幅に向上することはありません。 - [lightning] - # The maximum concurrency of engine files. - # Each table is split into one "index engine" to store indices, and multiple - # "data engines" to store row data. These settings control the maximum - # concurrent number for each type of engines. - # The two settings controls the maximum concurrency of the two engine files. - index-concurrency = 2 - table-concurrency = 6 - - # The concurrency of data. The default value is the number of logical CPUs. - region-concurrency = - - # The maximum concurrency of I/O. When the concurrency is too high, the disk - # cache may be frequently refreshed, causing the cache miss and read speed - # to slow down. For different storage mediums, this parameter may need to be - # adjusted to achieve the best performance. - io-concurrency = 5 +``` +[lightning] +# The maximum concurrency of engine files. +# Each table is split into one "index engine" to store indices, and multiple +# "data engines" to store row data. These settings control the maximum +# concurrent number for each type of engines. +# The two settings controls the maximum concurrency of the two engine files. +index-concurrency = 2 +table-concurrency = 6 + +# The concurrency of data. The default value is the number of logical CPUs. +region-concurrency = + +# The maximum concurrency of I/O. When the concurrency is too high, the disk +# cache may be frequently refreshed, causing the cache miss and read speed +# to slow down. For different storage mediums, this parameter may need to be +# adjusted to achieve the best performance. +io-concurrency = 5 +``` インポート処理中、各テーブルはインデックスを格納するための「インデックスエンジン」1つと、行データを格納するための複数の「データエンジン」に分割されます。 diff --git a/tidb-lightning/troubleshoot-tidb-lightning.md b/tidb-lightning/troubleshoot-tidb-lightning.md index ac9535d423790..6482c849869c0 100644 --- a/tidb-lightning/troubleshoot-tidb-lightning.md +++ b/tidb-lightning/troubleshoot-tidb-lightning.md @@ -42,7 +42,9 @@ strict-format = true これは、 `tidb-lightning`が正しく起動されていないためにシステムが SIGHUP シグナルを送信し、 `tidb-lightning`プロセスを停止したことが原因である可能性があります。この場合、 `tidb-lightning.log`は通常、次のログを出力します。 - [2018/08/10 07:29:08.310 +08:00] [INFO] [main.go:41] ["got signal to exit"] [signal=hangup] +``` +[2018/08/10 07:29:08.310 +08:00] [INFO] [main.go:41] ["got signal to exit"] [signal=hangup] +``` コマンドラインで直接`nohup`を使用して`tidb-lightning`起動することは推奨されません。スクリプトを実行することで[`tidb-lightning`を起動する](/get-started-with-tidb-lightning.md#step-4-start-tidb-lightning)起動できます。 @@ -169,8 +171,10 @@ TiDB Lightning Local-backend は、v4.0.0 以降のバージョンの TiDB ク このエラーは通常、CSVデータファイルにヘッダーが含まれていないこと(最初の行が列名ではなくデータである)が原因で発生します。そのため、 TiDB Lightning設定ファイルに以下の設定を追加する必要があります。 - [mydumper.csv] - header = false +``` +[mydumper.csv] +header = false +``` ### `Unknown character set` {#unknown-character-set} diff --git a/tidb-monitoring-api.md b/tidb-monitoring-api.md index d9606c66dfb11..45c594b394fa0 100644 --- a/tidb-monitoring-api.md +++ b/tidb-monitoring-api.md @@ -40,9 +40,28 @@ curl http://127.0.0.1:10080/status curl http://127.0.0.1:10080/schema_storage/mysql/stats_histograms ``` +``` +{ + "table_schema": "mysql", + "table_name": "stats_histograms", + "table_rows": 0, + "avg_row_length": 0, + "data_length": 0, + "max_data_length": 0, + "index_length": 0, + "data_free": 0 +} +``` + +```bash +curl http://127.0.0.1:10080/schema_storage/test +``` + +``` +[ { - "table_schema": "mysql", - "table_name": "stats_histograms", + "table_schema": "test", + "table_name": "test", "table_rows": 0, "avg_row_length": 0, "data_length": 0, @@ -50,24 +69,9 @@ curl http://127.0.0.1:10080/schema_storage/mysql/stats_histograms "index_length": 0, "data_free": 0 } - -```bash -curl http://127.0.0.1:10080/schema_storage/test +] ``` - [ - { - "table_schema": "test", - "table_name": "test", - "table_rows": 0, - "avg_row_length": 0, - "data_length": 0, - "max_data_length": 0, - "index_length": 0, - "data_free": 0 - } - ] - ### PDサーバー {#pd-server} - PD APIアドレス: `http://${host}:${port}/pd/api/v1/${api_name}` diff --git a/tidb-resource-control-background-tasks.md b/tidb-resource-control-background-tasks.md index 62f1b3da94df3..b0bde3fd5ddde 100644 --- a/tidb-resource-control-background-tasks.md +++ b/tidb-resource-control-background-tasks.md @@ -78,11 +78,13 @@ TiDB は次の種類のバックグラウンド タスクをサポートして 出力は次のようになります。 - +---------+------------+----------+-----------+-------------+-------------------------------------------+ - | NAME | RU_PER_SEC | PRIORITY | BURSTABLE | QUERY_LIMIT | BACKGROUND | - +---------+------------+----------+-----------+-------------+-------------------------------------------+ - | default | UNLIMITED | MEDIUM | YES | NULL | TASK_TYPES='br,ddl', UTILIZATION_LIMIT=30 | - +---------+------------+----------+-----------+-------------+-------------------------------------------+ + ``` + +---------+------------+----------+-----------+-------------+-------------------------------------------+ + | NAME | RU_PER_SEC | PRIORITY | BURSTABLE | QUERY_LIMIT | BACKGROUND | + +---------+------------+----------+-----------+-------------+-------------------------------------------+ + | default | UNLIMITED | MEDIUM | YES | NULL | TASK_TYPES='br,ddl', UTILIZATION_LIMIT=30 | + +---------+------------+----------+-----------+-------------+-------------------------------------------+ + ``` 5. 現在のセッションのタスクを明示的にバックグラウンドタイプとしてマークするには、 `tidb_request_source_type`を使用してタスクタイプを明示的に指定します。例を以下に示します。 diff --git a/tidb-resource-control-ru-groups.md b/tidb-resource-control-ru-groups.md index 49c5d6eb5563d..7fd625002c05c 100644 --- a/tidb-resource-control-ru-groups.md +++ b/tidb-resource-control-ru-groups.md @@ -288,8 +288,10 @@ TiDBはシステム変数[`tidb_last_query_info`](/system-variables.md#tidb_last UPDATE sbtest.sbtest1 SET k = k + 1 WHERE id = 1; ``` - Query OK, 1 row affected (0.01 sec) - Rows matched: 1 Changed: 1 Warnings: 0 + ``` + Query OK, 1 row affected (0.01 sec) + Rows matched: 1 Changed: 1 Warnings: 0 + ``` 2. 最後に実行されたステートメントの情報を表示するには、システム変数`tidb_last_query_info`を照会します。 @@ -297,12 +299,14 @@ TiDBはシステム変数[`tidb_last_query_info`](/system-variables.md#tidb_last SELECT @@tidb_last_query_info; ``` - +------------------------------------------------------------------------------------------------------------------------+ - | @@tidb_last_query_info | - +------------------------------------------------------------------------------------------------------------------------+ - | {"txn_scope":"global","start_ts":446809472210829315,"for_update_ts":446809472210829315,"ru_consumption":4.34885578125} | - +------------------------------------------------------------------------------------------------------------------------+ - 1 row in set (0.01 sec) + ``` + +------------------------------------------------------------------------------------------------------------------------+ + | @@tidb_last_query_info | + +------------------------------------------------------------------------------------------------------------------------+ + | {"txn_scope":"global","start_ts":446809472210829315,"for_update_ts":446809472210829315,"ru_consumption":4.34885578125} | + +------------------------------------------------------------------------------------------------------------------------+ + 1 row in set (0.01 sec) + ``` 結果として、 `ru_consumption`はこの SQL ステートメントの実行によって消費された RU です。 @@ -338,16 +342,18 @@ TiDB のシステム テーブル[`INFORMATION_SCHEMA.statements_summary`](/stat SELECT * FROM request_unit_by_group LIMIT 5; ``` - +----------------------------+----------------------------+----------------+----------+ - | start_time | end_time | resource_group | total_ru | - +----------------------------+----------------------------+----------------+----------+ - | 2024-01-01 00:00:00.000000 | 2024-01-02 00:00:00.000000 | default | 334147 | - | 2024-01-01 00:00:00.000000 | 2024-01-02 00:00:00.000000 | rg1 | 4172 | - | 2024-01-01 00:00:00.000000 | 2024-01-02 00:00:00.000000 | rg2 | 34028 | - | 2024-01-02 00:00:00.000000 | 2024-01-03 00:00:00.000000 | default | 334088 | - | 2024-01-02 00:00:00.000000 | 2024-01-03 00:00:00.000000 | rg1 | 3850 | - +----------------------------+----------------------------+----------------+----------+ - 5 rows in set (0.01 sec) +``` ++----------------------------+----------------------------+----------------+----------+ +| start_time | end_time | resource_group | total_ru | ++----------------------------+----------------------------+----------------+----------+ +| 2024-01-01 00:00:00.000000 | 2024-01-02 00:00:00.000000 | default | 334147 | +| 2024-01-01 00:00:00.000000 | 2024-01-02 00:00:00.000000 | rg1 | 4172 | +| 2024-01-01 00:00:00.000000 | 2024-01-02 00:00:00.000000 | rg2 | 34028 | +| 2024-01-02 00:00:00.000000 | 2024-01-03 00:00:00.000000 | default | 334088 | +| 2024-01-02 00:00:00.000000 | 2024-01-03 00:00:00.000000 | rg1 | 3850 | ++----------------------------+----------------------------+----------------+----------+ +5 rows in set (0.01 sec) +``` > **Note:** > diff --git a/tidb-storage.md b/tidb-storage.md index a89fe51e4a7eb..0868f13bd2ca5 100644 --- a/tidb-storage.md +++ b/tidb-storage.md @@ -78,25 +78,29 @@ TiKVは、マルチバージョン同時実行制御(MVCC)をサポートし TiKV MVCCは、キーにバージョン番号を付加することで実装されます。MVCCがない場合、TiKVのキーと値のペアは次のようになります。 - Key1 -> Value - Key2 -> Value - …… - KeyN -> Value +``` +Key1 -> Value +Key2 -> Value +…… +KeyN -> Value +``` MVCC では、TiKV のキーと値のペアは次のようになります。 - Key1_Version3 -> Value - Key1_Version2 -> Value - Key1_Version1 -> Value - …… - Key2_Version4 -> Value - Key2_Version3 -> Value - Key2_Version2 -> Value - Key2_Version1 -> Value - …… - KeyN_Version2 -> Value - KeyN_Version1 -> Value - …… +``` +Key1_Version3 -> Value +Key1_Version2 -> Value +Key1_Version1 -> Value +…… +Key2_Version4 -> Value +Key2_Version3 -> Value +Key2_Version2 -> Value +Key2_Version1 -> Value +…… +KeyN_Version2 -> Value +KeyN_Version1 -> Value +…… +``` 同じキーに複数のバージョンがある場合、番号の大きいバージョンが先頭に配置されます(キーの順序については[キーバリュー](#key-value-pairs)セクションを参照)。そのため、Key + VersionでValueを取得すると、MVCCのKeyはKeyとVersionで構築でき、 `Key_Version`になります。その後、RocksDBの`SeekPrefix(Key_Version)` APIを使用して、この`Key_Version`以上の最初の位置を直接見つけることができます。 diff --git a/tiflash/create-tiflash-replicas.md b/tiflash/create-tiflash-replicas.md index 2dc2faa9bddc1..139210ae1fb4a 100644 --- a/tiflash/create-tiflash-replicas.md +++ b/tiflash/create-tiflash-replicas.md @@ -210,24 +210,26 @@ TiDB クラスターは、次のいずれかの操作を実行すると、 TiFla 1. クラスター構成ファイルでTiFlashノードのラベルを指定します。 - tiflash_servers: - - host: 172.16.5.81 - logger.level: "info" - learner_config: - server.labels: - zone: "z1" - - host: 172.16.5.82 - config: - logger.level: "info" - learner_config: - server.labels: - zone: "z1" - - host: 172.16.5.85 - config: - logger.level: "info" - learner_config: - server.labels: - zone: "z2" + ``` + tiflash_servers: + - host: 172.16.5.81 + logger.level: "info" + learner_config: + server.labels: + zone: "z1" + - host: 172.16.5.82 + config: + logger.level: "info" + learner_config: + server.labels: + zone: "z1" + - host: 172.16.5.85 + config: + logger.level: "info" + learner_config: + server.labels: + zone: "z2" + ``` 以前のバージョンでは、 `flash.proxy.labels`設定では、利用可能なゾーン名に含まれる特殊文字を正しく処理できないことに注意してください。利用可能なゾーン名を設定するには、 `learner_config`の`server.labels`を使用することをお勧めします。 diff --git a/tiflash/maintain-tiflash.md b/tiflash/maintain-tiflash.md index bb6d8caa2224c..6c9f14dc152f5 100644 --- a/tiflash/maintain-tiflash.md +++ b/tiflash/maintain-tiflash.md @@ -23,7 +23,9 @@ TiFlash のバージョンを確認するには、次の 2 つの方法があり - TiFlash のログを参照して、 TiFlash のバージョンを確認してください。ログのパスについては、 [`tiflash.toml`ファイル](/tiflash/tiflash-configuration.md#configure-the-tiflashtoml-file)の`[logger]`部分を参照してください。例えば、以下のようになります。 - : TiFlash version: TiFlash 0.2.0 master-375035282451103999f3863c691e2fc2 + ``` + : TiFlash version: TiFlash 0.2.0 master-375035282451103999f3863c691e2fc2 + ``` ## TiFlashの重要なログ {#tiflash-critical-logs} diff --git a/tiflash/tiflash-late-materialization.md b/tiflash/tiflash-late-materialization.md index 4bb2484b208c1..de5a8e816706d 100644 --- a/tiflash/tiflash-late-materialization.md +++ b/tiflash/tiflash-late-materialization.md @@ -22,13 +22,15 @@ OLAPシナリオにおける特定のクエリのパフォーマンスを向上 EXPLAIN SELECT a, b, c FROM t1 WHERE a < 1; ``` - +-------------------------+----------+--------------+---------------+-------------------------------------------------------+ - | id | estRows | task | access object | operator info | - +-------------------------+----------+--------------+---------------+-------------------------------------------------------+ - | TableReader_12 | 12288.00 | root | | MppVersion: 1, data:ExchangeSender_11 | - | └─ExchangeSender_11 | 12288.00 | mpp[tiflash] | | ExchangeType: PassThrough | - | └─TableFullScan_9 | 12288.00 | mpp[tiflash] | table:t1 | pushed down filter:lt(test.t1.a, 1), keep order:false | - +-------------------------+----------+--------------+---------------+-------------------------------------------------------+ +``` ++-------------------------+----------+--------------+---------------+-------------------------------------------------------+ +| id | estRows | task | access object | operator info | ++-------------------------+----------+--------------+---------------+-------------------------------------------------------+ +| TableReader_12 | 12288.00 | root | | MppVersion: 1, data:ExchangeSender_11 | +| └─ExchangeSender_11 | 12288.00 | mpp[tiflash] | | ExchangeType: PassThrough | +| └─TableFullScan_9 | 12288.00 | mpp[tiflash] | table:t1 | pushed down filter:lt(test.t1.a, 1), keep order:false | ++-------------------------+----------+--------------+---------------+-------------------------------------------------------+ +``` この例では、フィルタ条件`a < 1`は TableScan演算子にプッシュダウンされます。TiFlashはまず列`a`からすべてのデータを読み取り、次に条件`a < 1`を満たす行をフィルタリングします。次に、 TiFlashはフィルタリングされた行から列`b`と`c`を読み取ります。 @@ -40,21 +42,25 @@ EXPLAIN SELECT a, b, c FROM t1 WHERE a < 1; SHOW VARIABLES LIKE 'tidb_opt_enable_late_materialization'; ``` - +--------------------------------------+-------+ - | Variable_name | Value | - +--------------------------------------+-------+ - | tidb_opt_enable_late_materialization | ON | - +--------------------------------------+-------+ +``` ++--------------------------------------+-------+ +| Variable_name | Value | ++--------------------------------------+-------+ +| tidb_opt_enable_late_materialization | ON | ++--------------------------------------+-------+ +``` ```sql SHOW GLOBAL VARIABLES LIKE 'tidb_opt_enable_late_materialization'; ``` - +--------------------------------------+-------+ - | Variable_name | Value | - +--------------------------------------+-------+ - | tidb_opt_enable_late_materialization | ON | - +--------------------------------------+-------+ +``` ++--------------------------------------+-------+ +| Variable_name | Value | ++--------------------------------------+-------+ +| tidb_opt_enable_late_materialization | ON | ++--------------------------------------+-------+ +``` `tidb_opt_enable_late_materialization`変数は、セッション レベルまたはグローバル レベルで変更できます。