模拟进程故障

    本文主要介绍如何使用 Chaosd 模拟进程故障。该功能通过使用 的 Golang 接口模拟进程被终止或暂停的场景,支持通过命令行模式创建实验。

    在创建进程故障实验前,可运行以下命令行查看 Chaosd 支持的进程故障类型:

    1. Process attack related commands
    2. Usage:
    3. Available Commands:
    4. kill kill process, default signal 9
    5. stop stop process, this action will stop the process with SIGSTOP
    6. Flags:
    7. -h, --help help for process
    8. --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'
    9. Use "chaosd attack process [command] --help" for more information about a command.

    目前 Chaosd 支持模拟进程被终止或暂停的故障。

    模拟进程被终止命令

      输出结果如下所示:

      模拟进程被终止相关配置说明

      模拟进程被终止示例

      1. chaosd attack process kill -p python

      模拟进程被暂停

      模拟进程被暂停命令

      输出结果如下所示:

      1. stop process, this action will stop the process with SIGSTOP
      2. Usage:
      3. chaosd attack process stop [flags]
      4. Flags:
      5. -h, --help help for stop
      6. -p, --process string The process name or the process ID
      7. Global Flags:

      模拟进程被暂停相关配置说明

      配置项配置缩写说明
      processp需要暂停的进程的名字或者进程的标识符string 类型,默认为

      模拟进程被暂停示例

      1. chaosd attack process stop -p python

      输出结果如下所示: