chaosblade使用(一):blade命令

1 查看 blade 命令帮助文档

$ blade -h
An easy to use and powerful chaos engineering experiment toolkit

Usage:
  blade [command]

Available Commands:
  check       Check the environment for chaosblade
  create      Create a chaos engineering experiment
  destroy     Destroy a chaos experiment
  help        Help about any command
  prepare     Prepare to experiment
  query       Query the parameter values required for chaos experiments
  revoke      Undo chaos engineering experiment preparation
  server      Server mode starts, exposes web services
  status      Query preparation stage or experiment status
  version     Print version info

Flags:
  -d, --debug   Set client to DEBUG mode
  -h, --help    help for blade

Use "blade [command] --help" for more information about a command.

参数解释:

  • prepare:简写 p,混沌实验前的准备,比如演练 Java 应用,则需要挂载 java agent。要演练应用名是 business 的应用,则在目标主机上执行 blade p jvm –process business。如果挂载成功,返回挂载的 uid,用于状态查询或者撤销挂载使用。
  • revoke:简写 r,撤销之前混沌实验准备,比如卸载 java agent。命令是 blade revoke UID
  • create: 简写是 c,创建一个混沌演练实验,指执行故障注入。命令是 blade create [TARGET] [ACTION] [FLAGS],比如实施一次 Dubbo consumer 调用 xxx.xxx.Service 接口延迟 3s,则执行的命令为 blade create dubbo delay –consumer –time 3000 –service xxx.xxx.Service,如果注入成功,则返回实验的 uid,用于状态查询和销毁此实验使用。
  • destroy:简写是 d,销毁之前的混沌实验,比如销毁上面提到的 Dubbo 延迟实验,命令是 blade destroy UID
  • status:简写 s,查询准备阶段或者实验的状态,命令是 blade status UID 或者 blade status –type create

2 所有的命令都可以添加 -h 来查看此命令如何使用,如创建混沌实验

$ blade create -h
Create a chaos engineering experiment

Usage:
  blade create [command]

Aliases:
  create, c

Examples:
blade create cpu load --cpu-percent 60

Available Commands:
  cplus       C++ chaos experiments
  cpu         Cpu experiment
  disk        Disk experiment
  docker      Docker experiment
  druid       Experiment with the Druid
  dubbo       Experiment with the Dubbo
  es          ElasticSearch experiment!
  file        File experiment
  gateway     gateway experiment!
  hbase       hbase experiment!
  http        http experiment
  jedis       jedis experiment
  jvm         Experiment with the JVM
  k8s         Kubernetes experiment
  kafka       kafka experiment
  lettuce     redis client lettuce experiment
  log         log experiment
  mem         Mem experiment
  mongodb     MongoDB experiment
  mysql       mysql experiment
  network     Network experiment
  process     Process experiment
  psql        Postgrelsql experiment
  rabbitmq    rabbitmq experiment
  redisson    redisson experiment
  rocketmq    Rocketmq experiment,can make message send or pull delay and exception
  script      Script chaos experiment
  servlet     java servlet experiment
  strace      strace experiment
  systemd     Systemd experiment
  tars        tars experiment

Flags:
  -a, --async             whether to create asynchronously, default is false
  -e, --endpoint string   the create result reporting address. It takes effect only when the async value is true and the value is not empty
  -h, --help              help for create
  -n, --nohup             used to internal async create, no need to config
      --uid string        Set Uid for the experiment, adapt to docker

Global Flags:
  -d, --debug   Set client to DEBUG mode

Use "blade create [command] --help" for more information about a command.

3 所有的命令都可以添加 -d 来查看更细的执行信息

blade create cpu fullload -d

4 参数

  • -d, --debug 设置工具为 DEBUG 模式,主要用于调试使用
  • -h, --help 查看 blade 命令帮助文档

5 案例

# 所有的命令都可以添加 -d 来查看更细的执行信息

blade create cpu fullload -d 

6 相关命令

  • blade create - 创建一个混沌实验
  • blade_destroy.md - 销毁一个混沌实验
  • blade_prepare.md - 准备混沌实验环境,部分实验执行前必须执行
  • blade_revoke.md - 撤销混沌实验环境,与 prepare 操作对应
  • blade status - 查询混沌实验和混沌实验环境状态
  • blade_query.md - 查询部分实验所需的系统参数
  • blade version - 打印 blade 工具版本信息 blade server - server 模式
  • blade server.md - server 模式

你可能感兴趣的:(#,chaosblade工具,java,dubbo,开发语言)