sfctl partitionsfctl partition

查询和管理任何服务的分区。Query and manage partitions for any service.

命令Commands

命令Command 说明Description
data-lossdata-loss 此 API 会造成指定的分区发生数据丢失。This API will induce data loss for the specified partition.
data-loss-statusdata-loss-status 获取使用 StartDataLoss API 启动的分区数据丢失操作的进度。Gets the progress of a partition data loss operation started using the StartDataLoss API.
healthhealth 获取指定 Service Fabric 分区的运行状况。Gets the health of the specified Service Fabric partition.
infoinfo 获取有关 Service Fabric 分区的信息。Gets the information about a Service Fabric partition.
listlist 获取 Service Fabric 服务的分区列表。Gets the list of partitions of a Service Fabric service.
loadload 获取指定的 Service Fabric 分区的负载信息。Gets the load information of the specified Service Fabric partition.
load-resetload-reset 重置 Service Fabric 分区的当前负载。Resets the current load of a Service Fabric partition.
quorum-lossquorum-loss 造成给定的有状态服务分区发生仲裁丢失。Induces quorum loss for a given stateful service partition.
quorum-loss-statusquorum-loss-status 获取使用 StartQuorumLoss API 在分区上启动的仲裁丢失操作的进度。Gets the progress of a quorum loss operation on a partition started using the StartQuorumLoss API.
recoverrecover 向 Service Fabric 群集指出应该尝试恢复当前停滞在仲裁丢失状态的特定分区。Indicates to the Service Fabric cluster that it should attempt to recover a specific partition that is currently stuck in quorum loss.
recover-allrecover-all 向 Service Fabric 群集指出应该尝试恢复当前停滞在仲裁丢失状态的所有服务(包括系统服务)。Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss.
report-healthreport-health 发送有关 Service Fabric 分区的运行状况报告。Sends a health report on the Service Fabric partition.
restartrestart 此 API 会重启指定分区的部分或所有副本或者实例。This API will restart some or all replicas or instances of the specified partition.
restart-statusrestart-status 获取使用 StartPartitionRestart 启动的 PartitionRestart 操作的进度。Gets the progress of a PartitionRestart operation started using StartPartitionRestart.
svc-namesvc-name 获取分区的 Service Fabric 服务名称。Gets the name of the Service Fabric service for a partition.

sfctl partition data-losssfctl partition data-loss

此 API 会造成指定的分区发生数据丢失。This API will induce data loss for the specified partition.

它会触发对分区的 OnDataLossAsync API 的调用。It will trigger a call to the OnDataLossAsync API of the partition. 此 API 会造成指定的分区发生数据丢失。This API will induce data loss for the specified partition. 它会触发对分区的 OnDataLoss API 的调用。It will trigger a call to the OnDataLoss API of the partition. 实际的数据丢失情况将取决于指定的 DataLossMode。Actual data loss will depend on the specified DataLossMode.

  • PartialDataLoss:仅删除一定数量的副本,并且会为分区触发 OnDataLoss,但实际的数据丢失情况取决于是否存在正在进行的复制。PartialDataLoss: Only a quorum of replicas are removed and OnDataLoss is triggered for the partition but actual data loss depends on the presence of in-flight replication.
  • FullDataLoss:会删除所有副本,因此会丢失所有数据并触发 OnDataLoss。FullDataLoss: All replicas are removed hence all data is lost and OnDataLoss is triggered. 调用此 API 时,只能将有状态服务作为目标。This API should only be called with a stateful service as the target. 建议不要在调用此 API 时将系统服务作为目标。Calling this API with a system service as the target is not advised.

备注

此 API 一旦被调用就无法撤消。Once this API has been called, it cannot be reversed. 调用 CancelOperation 只会停止执行操作并清除内部系统状态。Calling CancelOperation will only stop execution and clean up internal system state. 如果命令的执行时间很长,已导致数据丢失,则不会还原数据。It will not restore data if the command has progressed far enough to cause data loss. 使用同一 OperationId 调用 GetDataLossProgress API 会返回使用此 API 启动的操作的信息。Call the GetDataLossProgress API with the same OperationId to return information on the operation started with this API.

参数Arguments

参数Argument 说明Description
--data-loss-mode [必需]--data-loss-mode [Required] 此枚举会传递到 StartDataLoss API,表示会导致哪种类型的数据丢失。This enum is passed to the StartDataLoss API to indicate what type of data loss to induce.
--operation-id [必需]--operation-id [Required] 用于标识此 API 的调用的 GUID。A GUID that identifies a call of this API. 需将此参数传入相应的 GetProgress API。This is passed into the corresponding GetProgress API.
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--service-id [必需]--service-id [Required] 服务的标识。The identity of the service. 此 ID 通常是不带“fabric:”URI 方案的服务全名。This ID is typically the full name of the service without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果服务名称为“fabric:/myapp/app1/svc1”,则 6.0 及更高版本中的服务标识为“myapp~app1~svc1”,在以前的版本中为“myapp/app1/svc1”。For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition data-loss-statussfctl partition data-loss-status

获取使用 StartDataLoss API 启动的分区数据丢失操作的进度。Gets the progress of a partition data loss operation started using the StartDataLoss API.

获取使用 OperationId 通过 StartDataLoss 启动的数据丢失操作的进度。Gets the progress of a data loss operation started with StartDataLoss, using the OperationId.

参数Arguments

参数Argument 说明Description
--operation-id [必需]--operation-id [Required] 用于标识此 API 的调用的 GUID。A GUID that identifies a call of this API. 需将此参数传入相应的 GetProgress API。This is passed into the corresponding GetProgress API.
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--service-id [必需]--service-id [Required] 服务的标识。The identity of the service. 此 ID 通常是不带“fabric:”URI 方案的服务全名。This ID is typically the full name of the service without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果服务名称为“fabric:/myapp/app1/svc1”,则 6.0 及更高版本中的服务标识为“myapp~app1~svc1”,在以前的版本中为“myapp/app1/svc1”。For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition healthsfctl partition health

获取指定 Service Fabric 分区的运行状况。Gets the health of the specified Service Fabric partition.

使用 EventsHealthStateFilter 可以根据运行状态筛选针对服务报告的运行状况事件的集合。Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. 使用 ReplicasHealthStateFilter 可以筛选分区上 ReplicaHealthState 对象的集合。Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. 如果指定运行状况存储中不存在的分区,此请求会返回错误。If you specify a partition that does not exist in the health store, this request returns an error.

参数Arguments

参数Argument 说明Description
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--events-health-state-filter--events-health-state-filter 用于根据运行状况筛选返回的 HealthEvent 对象集合。Allows filtering the collection of HealthEvent objects returned based on health state. 此参数的可能值包括以下运行状态之一的整数值。The possible values for this parameter include integer value of one of the following health states. 仅返回与筛选器匹配的事件。Only events that match the filter are returned. 所有事件用于评估聚合运行状态。All events are used to evaluate the aggregated health state. 如果未指定,则返回所有项。If not specified, all entries are returned. 状态值为基于标志的枚举,因此该值可以是使用按位“OR”运算符获取的值的组合。The state values are flag-based enumeration, so the value could be a combination of these values, obtained using the bitwise 'OR' operator. 例如,如果提供的值为 6,则返回 HealthState 值为 OK (2) 和 Warning (4) 的所有事件。For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned.
- Default - 默认值。- Default - Default value. 匹配任何 HealthState。Matches any HealthState. 值为 0。The value is zero.
- None - 不与任何 HealthState 值匹配的筛选器。- None - Filter that doesn't match any HealthState value. 未返回有关给定状态集合的结果时使用。Used in order to return no results on a given collection of states. 值为 1。The value is 1.
- Ok - 与 HealthState 值为 OK 的输入匹配的筛选器。- Ok - Filter that matches input with HealthState value Ok. 值为 2。The value is 2.
- Warning - 与 HealthState 值为 Warning 的输入匹配的筛选器。- Warning - Filter that matches input with HealthState value Warning. 值为 4。The value is 4.
- Error - 与 HealthState 值为 Error 的输入匹配的筛选器。- Error - Filter that matches input with HealthState value Error. 值为 8。The value is 8.
- All - 与具有任意 HealthState 值的输入匹配的筛选器。- All - Filter that matches input with any HealthState value. 值为 65535。The value is 65535.
--exclude-health-statistics--exclude-health-statistics 指示运行状况统计数据是否应作为查询结果的一部分返回。Indicates whether the health statistics should be returned as part of the query result. 默认值为 False。False by default. 统计信息显示处于 Ok、Warning 和 Error 运行状况的子实体数。The statistics show the number of children entities in health state Ok, Warning, and Error.
--replicas-health-state-filter--replicas-health-state-filter 允许筛选分区上 ReplicaHealthState 对象的集合。Allows filtering the collection of ReplicaHealthState objects on the partition. 可通过对 HealthStateFilter 的成员进行成员操作或位运算获取该值。The value can be obtained from members or bitwise operations on members of HealthStateFilter. 只会返回与筛选器匹配的副本。Only replicas that match the filter will be returned. 所有副本都会用于评估聚合运行状态。All replicas will be used to evaluate the aggregated health state. 如果未指定,将返回所有条目。状态值为基于标志的枚举,因此该值可以是使用按位“OR”运算符获取的值的组合。If not specified, all entries will be returned.The state values are flag-based enumeration, so the value could be a combination of these values obtained using bitwise 'OR' operator. 例如,如果提供的值为 6,则会返回 HealthState 值为 OK (2) 和 Warning (4) 的所有事件。For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. 此参数的可能值包括以下运行状态之一的整数值。The possible values for this parameter include integer value of one of the following health states.
- Default - 默认值。- Default - Default value. 匹配任何 HealthState。Matches any HealthState. 值为 0。The value is zero.
- None - 不与任何 HealthState 值匹配的筛选器。- None - Filter that doesn't match any HealthState value. 未返回有关给定状态集合的结果时使用。Used in order to return no results on a given collection of states. 值为 1。The value is 1.
- Ok - 与 HealthState 值为 OK 的输入匹配的筛选器。- Ok - Filter that matches input with HealthState value Ok. 值为 2。The value is 2.
- Warning - 与 HealthState 值为 Warning 的输入匹配的筛选器。- Warning - Filter that matches input with HealthState value Warning. 值为 4。The value is 4.
- Error - 与 HealthState 值为 Error 的输入匹配的筛选器。- Error - Filter that matches input with HealthState value Error. 值为 8。The value is 8.
- All - 与具有任意 HealthState 值的输入匹配的筛选器。- All - Filter that matches input with any HealthState value. 值为 65535。The value is 65535.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition infosfctl partition info

获取有关 Service Fabric 分区的信息。Gets the information about a Service Fabric partition.

获取有关指定的分区的信息。Gets the information about the specified partition. 响应包括分区 ID、分区方案信息、分区支持的密钥、状态、运行状况和有关分区的其他详细信息。The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition.

参数Arguments

参数Argument 说明Description
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition listsfctl partition list

获取 Service Fabric 服务的分区列表。Gets the list of partitions of a Service Fabric service.

响应包括分区 ID、分区方案信息、分区支持的密钥、状态、运行状况和有关分区的其他详细信息。The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition.

参数Arguments

参数Argument 说明Description
--service-id [必需]--service-id [Required] 服务的标识。The identity of the service. 此 ID 通常是不带“fabric:”URI 方案的服务全名。This ID is typically the full name of the service without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果服务名称为“fabric:/myapp/app1/svc1”,则 6.0 及更高版本中的服务标识为“myapp~app1~svc1”,在以前的版本中为“myapp/app1/svc1”。For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
--continuation-token--continuation-token 继续标记参数用于获取下一组结果。The continuation token parameter is used to obtain next set of results. 如果单个响应无法容纳来自系统的结果,则 API 响应中包括含有非空值的继续标记。A continuation token with a non-empty value is included in the response of the API when the results from the system do not fit in a single response. 当此值传递到下一个 API 调用时,API 返回下一组结果。When this value is passed to the next API call, the API returns next set of results. 如果没有更多结果,则继续标记不包含值。If there are no further results, then the continuation token does not contain a value. 不应将此参数的值进行 URL 编码。The value of this parameter should not be URL encoded.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition loadsfctl partition load

获取指定的 Service Fabric 分区的负载信息。Gets the load information of the specified Service Fabric partition.

返回有关指定分区的负载的信息。Returns information about the load of a specified partition. 响应包括 Service Fabric 分区的负载报告的列表。The response includes a list of load reports for a Service Fabric partition. 每项报告包括负载指标名称、值以及上次报告时间 (UTC)。Each report includes the load metric name, value, and last reported time in UTC.

参数Arguments

参数Argument 说明Description
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition load-resetsfctl partition load-reset

重置 Service Fabric 分区的当前负载。Resets the current load of a Service Fabric partition.

将 Service Fabric 分区的当前负载重置为服务的默认负载。Resets the current load of a Service Fabric partition to the default load for the service.

参数Arguments

参数Argument 说明Description
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition quorum-losssfctl partition quorum-loss

造成给定的有状态服务分区发生仲裁丢失。Induces quorum loss for a given stateful service partition.

此 API 适用于服务出现临时仲裁丢失的情况。This API is useful for a temporary quorum loss situation on your service. 使用同一 OperationId 调用 GetQuorumLossProgress API 会返回使用此 API 启动的操作的信息。Call the GetQuorumLossProgress API with the same OperationId to return information on the operation started with this API. 只能在有状态持久 (HasPersistedState==true) 服务上调用此项。This can only be called on stateful persisted (HasPersistedState==true) services. 请勿在无状态服务或有状态仅内存中服务上使用此 API。Do not use this API on stateless services or stateful in-memory only services.

参数Arguments

参数Argument 说明Description
--operation-id [必需]--operation-id [Required] 用于标识此 API 的调用的 GUID。A GUID that identifies a call of this API. 需将此参数传入相应的 GetProgress API。This is passed into the corresponding GetProgress API.
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--quorum-loss-duration [必需]--quorum-loss-duration [Required] 分区将处于仲裁丢失状态的时间。The amount of time for which the partition will be kept in quorum loss. 必须以秒为单位指定此项。This must be specified in seconds.
--quorum-loss-mode [必需]--quorum-loss-mode [Required] 此枚举会传递到 StartQuorumLoss API,表示会导致哪种类型的仲裁丢失。This enum is passed to the StartQuorumLoss API to indicate what type of quorum loss to induce.
--service-id [必需]--service-id [Required] 服务的标识。The identity of the service. 此 ID 通常是不带“fabric:”URI 方案的服务全名。This ID is typically the full name of the service without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果服务名称为“fabric:/myapp/app1/svc1”,则 6.0 及更高版本中的服务标识为“myapp~app1~svc1”,在以前的版本中为“myapp/app1/svc1”。For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition quorum-loss-statussfctl partition quorum-loss-status

获取使用 StartQuorumLoss API 在分区上启动的仲裁丢失操作的进度。Gets the progress of a quorum loss operation on a partition started using the StartQuorumLoss API.

获取使用提供的 OperationId 通过 StartQuorumLoss 启动的仲裁丢失操作的进度。Gets the progress of a quorum loss operation started with StartQuorumLoss, using the provided OperationId.

参数Arguments

参数Argument 说明Description
--operation-id [必需]--operation-id [Required] 用于标识此 API 的调用的 GUID。A GUID that identifies a call of this API. 需将此参数传入相应的 GetProgress API。This is passed into the corresponding GetProgress API.
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--service-id [必需]--service-id [Required] 服务的标识。The identity of the service. 此 ID 通常是不带“fabric:”URI 方案的服务全名。This ID is typically the full name of the service without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果服务名称为“fabric:/myapp/app1/svc1”,则 6.0 及更高版本中的服务标识为“myapp~app1~svc1”,在以前的版本中为“myapp/app1/svc1”。For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition recoversfctl partition recover

向 Service Fabric 群集指出应该尝试恢复当前停滞在仲裁丢失状态的特定分区。Indicates to the Service Fabric cluster that it should attempt to recover a specific partition that is currently stuck in quorum loss.

仅当确定已关闭的副本无法恢复时,才执行此操作。This operation should only be performed if it is known that the replicas that are down cannot be recovered. 不当地使用此 API 可能导致潜在的数据丢失。Incorrect use of this API can cause potential data loss.

参数Arguments

参数Argument 说明Description
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition recover-allsfctl partition recover-all

向 Service Fabric 群集指出应该尝试恢复当前停滞在仲裁丢失状态的所有服务(包括系统服务)。Indicates to the Service Fabric cluster that it should attempt to recover any services (including system services) which are currently stuck in quorum loss.

仅当确定已关闭的副本无法恢复时,才执行此操作。This operation should only be performed if it is known that the replicas that are down cannot be recovered. 不当地使用此 API 可能导致潜在的数据丢失。Incorrect use of this API can cause potential data loss.

参数Arguments

参数Argument 说明Description
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition report-healthsfctl partition report-health

发送有关 Service Fabric 分区的运行状况报告。Sends a health report on the Service Fabric partition.

报告指定的 Service Fabric 分区的运行状况状态。Reports health state of the specified Service Fabric partition. 该报告必须包含有关运行状况报告及其所报告属性的源的信息。The report must contain the information about the source of the health report and property on which it is reported. 该报告将发送到 Service Fabric 网关分区,后者会将其转发到运行状况存储。The report is sent to a Service Fabric gateway Partition, which forwards to the health store. 该报告可能被网关接受但被运行状况存储在执行额外的验证后拒绝。The report may be accepted by the gateway, but rejected by the health store after extra validation. 例如,运行状况存储可能会由于无效的参数(如过时的序列号)而拒绝该报告。For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 若要了解该报告是否已应用于运行状况存储中,请检查该报告是否显示在事件部分中。To see whether the report was applied in the health store, check that the report appears in the events section.

参数Arguments

参数Argument 说明Description
--health-property [必需]--health-property [Required] 运行状况信息的属性。The property of the health information.

一个实体可以有不同属性的运行状况报告。An entity can have health reports for different properties. 该属性是一个字符串,不是固定的枚举,因此可使报告器灵活地对触发报告的状态条件进行分类。The property is a string and not a fixed enumeration to allow the reporter flexibility to categorize the state condition that triggers the report. 例如,SourceId 为“LocalWatchdog”的报告器可以监视节点上的可用磁盘的状态,因此它可以报告该节点的“AvailableDisk”属性。For example, a reporter with SourceId "LocalWatchdog" can monitor the state of the available disk on a node, so it can report "AvailableDisk" property on that node. 同一报告器可以监视节点连接,因此它可以报告同一节点的“Connectivity”属性。The same reporter can monitor the node connectivity, so it can report a property "Connectivity" on the same node. 在运行状况存储中,这些报告均被视为指定节点的单独运行状况事件。In the health store, these reports are treated as separate health events for the specified node. 与 SourceId 一起,该属性唯一地标识运行状况信息。Together with the SourceId, the property uniquely identifies the health information.
--health-state [必需]--health-state [Required] 可能的值包括:“Invalid”、“Ok”、“Warning”、“Error”、“Unknown”。Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'.
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--source-id [必需]--source-id [Required] 标识已生成运行状况信息的客户端/监视程序/系统组件的源名称。The source name that identifies the client/watchdog/system component that generated the health information.
--description--description 运行状况信息的说明。The description of the health information.

它表示用于添加有关该报告的用户可读信息的自定义文本。It represents free text used to add human readable information about the report. 该说明的最大字符串长度为 4096 个字符。The maximum string length for the description is 4096 characters. 如果所提供字符串的长度大于该值,它将被自动截断。If the provided string is longer, it will be automatically truncated. 截断时,该说明的末尾字符包含一个标记“[Truncated]”,并且总字符串大小为 4096 个字符。When truncated, the last characters of the description contain a marker "[Truncated]", and total string size is 4096 characters. 该标记的存在向用户指示截断已发生。The presence of the marker indicates to users that truncation occurred. 请注意,当截断时,该说明包含来自原始字符串的 4096 个以内的字符。Note that when truncated, the description has less than 4096 characters from the original string.
--immediate--immediate 一个用于指示是否应立即发送报告的标志。A flag that indicates whether the report should be sent immediately.

运行状况报告将发送到 Service Fabric 网关应用程序,后者会将其转发到运行状况存储。A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 如果 Immediate 设置为 true,则报告将立即从 HTTP 网关发送至运行状况存储,而无论 HTTP 网关应用程序使用的 Fabric 客户端设置如何。If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, regardless of the fabric client settings that the HTTP Gateway Application is using. 这对于应尽快发送的关键报告十分有用。This is useful for critical reports that should be sent as soon as possible. 由于计时和其他情况,发送报告可能仍会失败,例如,在 HTTP 网关已关闭或消息无法到达网关的情况下。Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway is closed or the message doesn't reach the Gateway. 如果 Immediate 设置为 false,则报告将基于来自 HTTP 网关的运行状况客户端设置发送。If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 因此,系统将根据 HealthReportSendInterval 配置对其进行批处理。Therefore, it will be batched according to the HealthReportSendInterval configuration. 这是建议的设置,因为它可让运行状况客户端优化发往运行状况存储的运行状况报告消息以及运行状况报告处理。This is the recommended setting because it allows the health client to optimize health reporting messages to health store as well as health report processing. 默认情况下,报告不立即发送。By default, reports are not sent immediately.
--remove-when-expired--remove-when-expired 该值指示是否在报告过期时从运行状况存储删除该报告。Value that indicates whether the report is removed from health store when it expires.

如果设置为 true,报告在过期后将从运行状况存储中删除。If set to true, the report is removed from the health store after it expires. 如果设置为 false,报告在过期时将被视为错误。If set to false, the report is treated as an error when expired. 此属性的值在默认情况下为 false。The value of this property is false by default. 当客户端定期报告时,它们应将 RemoveWhenExpired 设置为 false(默认值)。When clients report periodically, they should set RemoveWhenExpired false (default). 这样,如果报告器有问题(例如死锁)并且无法报告,那么在运行状况报告过期时该实体就会被评估为处于错误状态。This way, is the reporter has issues (e.g. deadlock) and can't report, the entity is evaluated at error when the health report expires. 这会将该实体标记为处于“Error”运行状况状态。This flags the entity as being in Error health state.
--sequence-number--sequence-number 此运行状况报告的序列号(采用数字字符串形式)。The sequence number for this health report as a numeric string.

报告序列号由运行状况存储用来检测过时的报告。The report sequence number is used by the health store to detect stale reports. 如果未指定,序列号将在报告被添加时由运行状况客户端自动生成。If not specified, a sequence number is auto-generated by the health client when a report is added.
--timeout -t--timeout -t 默认值: 60。Default: 60.
--ttl--ttl 此运行状况报告保持有效的持续时间。The duration for which this health report is valid. 此字段将 ISO8601 格式用于指定该持续时间。This field uses ISO8601 format for specifying the duration.

当客户端定期报告时,它们应以高于生存时间的频率发送报告。When clients report periodically, they should send reports with higher frequency than time to live. 如果客户端以非定期的方式报告,它们可以将生存时间设置为无限。If clients report on transition, they can set the time to live to infinite. 生存时间过期时,包含运行状况信息的运行状况事件将从运行状况存储中删除(如果 RemoveWhenExpired 为 true),或者将会评估为处于错误状态(如果 RemoveWhenExpired 为 false)。When time to live expires, the health event that contains the health information is either removed from health store, if RemoveWhenExpired is true, or evaluated at error, if RemoveWhenExpired false. 如果未指定,生存时间将默认为无限值。If not specified, time to live defaults to infinite value.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition restartsfctl partition restart

此 API 会重启指定分区的部分或所有副本或者实例。This API will restart some or all replicas or instances of the specified partition.

此 API 可用于测试故障转移。This API is useful for testing failover. 如果用于针对无状态服务分区,RestartPartitionMode 必须是 AllReplicasOrInstances。If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances. 使用相同的 OperationId 调用 GetPartitionRestartProgress API 可获取进度。Call the GetPartitionRestartProgress API using the same OperationId to get the progress.

参数Arguments

参数Argument 说明Description
--operation-id [必需]--operation-id [Required] 用于标识此 API 的调用的 GUID。A GUID that identifies a call of this API. 需将此参数传入相应的 GetProgress API。This is passed into the corresponding GetProgress API.
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--restart-partition-mode [必需]--restart-partition-mode [Required] 描述要重新启动哪些分区。Describe which partitions to restart.
--service-id [必需]--service-id [Required] 服务的标识。The identity of the service. 此 ID 通常是不带“fabric:”URI 方案的服务全名。This ID is typically the full name of the service without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果服务名称为“fabric:/myapp/app1/svc1”,则 6.0 及更高版本中的服务标识为“myapp~app1~svc1”,在以前的版本中为“myapp/app1/svc1”。For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition restart-statussfctl partition restart-status

获取使用 StartPartitionRestart 启动的 PartitionRestart 操作的进度。Gets the progress of a PartitionRestart operation started using StartPartitionRestart.

获取使用提供的 OperationId 通过 StartPartitionRestart 启动的 PartitionRestart 操作的进度。Gets the progress of a PartitionRestart started with StartPartitionRestart using the provided OperationId.

参数Arguments

参数Argument 说明Description
--operation-id [必需]--operation-id [Required] 用于标识此 API 的调用的 GUID。A GUID that identifies a call of this API. 需将此参数传入相应的 GetProgress API。This is passed into the corresponding GetProgress API.
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--service-id [必需]--service-id [Required] 服务的标识。The identity of the service. 此 ID 通常是不带“fabric:”URI 方案的服务全名。This ID is typically the full name of the service without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果服务名称为“fabric:/myapp/app1/svc1”,则 6.0 及更高版本中的服务标识为“myapp~app1~svc1”,在以前的版本中为“myapp/app1/svc1”。For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl partition svc-namesfctl partition svc-name

获取分区的 Service Fabric 服务名称。Gets the name of the Service Fabric service for a partition.

获取指定分区的服务的名称。Gets name of the service for the specified partition. 如果分区 ID 在群集中不存在,则会返回 404 错误。A 404 error is returned if the partition ID does not exist in the cluster.

参数Arguments

参数Argument 说明Description
--partition-id [必需]--partition-id [Required] 分区的标识。The identity of the partition.
--timeout -t--timeout -t 执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds. 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

后续步骤Next steps