Partager via


az arcdata dc debug

Note

This reference is part of the arcdata extension for the Azure CLI (version 2.3.1 or higher). The extension will automatically install the first time you run an az arcdata dc debug command. Learn more about extensions.

Debug data controller.

Commands

Name Description Type Status
az arcdata dc debug controldb-cdc

Enable/disable CDC on Data Controller Database and Tables - for troubleshooting purposes only.

Extension GA
az arcdata dc debug copy-logs

Copy logs.

Extension GA
az arcdata dc debug dump

Trigger memory dump.

Extension GA
az arcdata dc debug restore-controldb-snapshot

Restores a unique copy of ControlDB from backup - for troubleshooting purposes only.

Extension GA

az arcdata dc debug controldb-cdc

Enable/disable CDC on Data Controller Database and Tables - for troubleshooting purposes only.

Enable/Disable Change Data Capture for 'controller' Database and supported tables with configurable retention hours.

az arcdata dc debug controldb-cdc --k8s-namespace
                                  [--enable {false, true}]
                                  [--retention-hours]
                                  [--use-k8s]

Examples

Enables Change Data Capture with 4 hours of retention.

az arcdata dc debug controldb-cdc -k arc-data-services --enable true --retention-hours 4

Disables Change Data Capture.

az arcdata dc debug controldb-cdc -k arc-data-services --enable false

Required Parameters

--k8s-namespace -k

Kubernetes namespace of the existing data controller.

Optional Parameters

--enable

Enable or disable change data capture.

Accepted values: false, true
--retention-hours

CDC retention period, specified in hours. Allowed values are 1 to 24.

Default value: 8
--use-k8s

Use local Kubernetes APIs to perform this action.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az arcdata dc debug copy-logs

Copy logs.

Copy the debug logs from the data controller - Kubernetes configuration is required on your system.

az arcdata dc debug copy-logs --k8s-namespace
                              [--container]
                              [--exclude-arcdata-logs]
                              [--exclude-cluster-info]
                              [--exclude-controldb]
                              [--exclude-dumps]
                              [--exclude-system-logs]
                              [--pod]
                              [--resource-kind]
                              [--resource-name]
                              [--skip-compress]
                              [--target-folder]
                              [--timeout]
                              [--use-k8s]

Required Parameters

--k8s-namespace -k

Kubernetes namespace of the data controller.

Optional Parameters

--container -c

Copy the logs for the containers with similar name, Optional, by default copies logs for all containers. Cannot be specified multiple times. If specified multiple times, last one will be used.

--exclude-arcdata-logs

Whether or not to exclude arc data services logs from result folder. The default value is False which includes all arc data services container logs.

Default value: False
--exclude-cluster-info

Whether or not to exclude kubernetes resource info from result folder per namespace. The default value is False which includes namespaced resource info.

Default value: False
--exclude-controldb

Whether or not to exclude a backup of controldb from result folder. The default value is False which includes a controldb backup.

Default value: False
--exclude-dumps

Whether or not to exclude dumps from result folder. The default value is False which includes dumps.

Default value: False
--exclude-system-logs

Whether or not to exclude kube-system and azure-arc namespace logs from collection. The default value is False which includes kube-system and connectedk8s logs, if accessible.

Default value: False
--pod

Copy the logs for the pods with similar name. Optional, by default copies logs for all pods. Cannot be specified multiple times. If specified multiple times, last one will be used.

--resource-kind

Copy the logs for the resource of a particular kind. Cannot specified multiple times. If specified multiple times, last one will be used. If specified, --resource-name should also be specified to identify the resource.

--resource-name

Copy the logs for the resource of the specified name. Cannot be specified multiple times. If specified multiple times, last one will be used. If specified, --resource-kind should also be specified to identify the resource.

--skip-compress

Whether or not to skip compressing the result folder. The default value is False which compresses the result folder.

Default value: False
--target-folder -d

Target folder path to copy logs to. Optional, by default creates the result in the local folder. Cannot be specified multiple times. If specified multiple times, last one will be used.

--timeout -t

The number of seconds to wait for the command to complete. The default value is 0 which is unlimited.

Default value: 0
--use-k8s

Use local Kubernetes APIs to perform this action.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az arcdata dc debug dump

Trigger memory dump.

Trigger memory dump and copy it out from container - Kubernetes configuration is required on your system.

az arcdata dc debug dump --k8s-namespace
                         [--container {controller}]
                         [--target-folder]
                         [--use-k8s]

Required Parameters

--k8s-namespace -k

Kubernetes namespace of the data controller.

Optional Parameters

--container -c

The target container to be triggered for dumping the running processes.

Accepted values: controller
Default value: controller
--target-folder -d

Target folder to copy the dump out.

Default value: ./output/dump
--use-k8s

Use local Kubernetes APIs to perform this action.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az arcdata dc debug restore-controldb-snapshot

Restores a unique copy of ControlDB from backup - for troubleshooting purposes only.

Restores a COPY_ONLY backup of ControlDB under a unique name for troubleshooting - Kubernetes configuration is required on your system.

az arcdata dc debug restore-controldb-snapshot --backup-file
                                               --k8s-namespace
                                               [--use-k8s]

Examples

Linux - Restore a backup taken from a previously run 'arcdata dc debug copy-logs' command.

az arcdata dc debug restore-controldb-snapshot -k arc-data-services -f /path/to/backup/controller-1675653451.bak

Windows - Restore a backup taken from a previously run 'arcdata dc debug copy-logs' command.

az arcdata dc debug restore-controldb-snapshot -k arc-data-services -f C:\path\to\backup\controller-1675653451.bak

Required Parameters

--backup-file -f

Existing Controller Database backup file - must end in '.bak', will be restored under a unique database name based on execution timestamp.

--k8s-namespace -k

Kubernetes namespace of the existing data controller.

Optional Parameters

--use-k8s

Use local Kubernetes APIs to perform this action.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.