7个检验软件系统稳定性场景的混沌工程故障注入开源工具ChaosBlade

ChaosBlade可针对多达7个场景开展故障注入实验,但网上官方的中英文文档质量欠佳,内容缺失,真心没有站在一般用户的角度来写,只能通过运行blade命令的help了解究竟有什么功能。

官网

https://github.com/chaosblade-io/chaosblade

一句话介绍

ChaosBlade是阿里巴巴开源的针对7个检验软件系统稳定性场景的混沌工程故障注入开源工具:主机基础资源、CRI容器、K8S平台、Java应用、C++应用、阿里云平台、其他服务。

关键特性

以下关键特性,是我下载ChaosBlade v1.7.2,在运行blade时带上help参数,一点点试出来的。官网github的readme文档并没有写这么细。

场景1:主机基础资源

可注入故障包括CPU负载爆满,磁盘占用和读写爆满,内存爆满,网络延迟/丢包/坏包/乱序,端口被占用,DNS配置错误,杀进程。

场景2:CRI容器

可注入故障包括向容器内的基础资源注入故障,删除容器,以及向容器内各种服务注入故障。

场景3:K8S平台

可注入故障包括向K8S平台内容器、node和pod注入故障。

场景4:Java应用

可注入故障包括代码缓存爆满,内存不足,增加延迟,返回特定值,动态执行脚本,抛异常等。

场景5:C++应用

可注入故障包括增加延迟,运行中修改变量值,返回错误。

场景6:阿里云平台

可注入故障包括卸载磁盘,挂载或卸载网络接口等。

场景7:其他服务

可注入故障包括增加延迟和抛异常,可以针对如elastic search, hbase, http, mongodb, mysql等近30种服务注入故障。

具体特性,可以参考文后我根据命令行help输出,整理的特性列表。需要对里面的英文语法错误保持宽容态度。

适用平台

主机,CRI容器,K8S平台,Java应用,C++应用,阿里云平台,其他服务。

适用场景

需要向主机、CRI容器、K8S平台、阿里云平台、Java应用和C++应用注入故障的场景。

优势

支持多达7个故障注入场景。

劣势

网上的中英文文档描述过于简略。每个功能往往就一句话。只能把工具装上,运行起来,通过help参数,逆向工程来发现有什么功能。

案例

国内有金融行业的用户,已经基于ChaosBlade开发了混沌工程工具平台,在测试环境注入故障,检验基础设施和容器平台的稳定性。

开源许可证

Apache-2.0 license

Github点赞数

5.4k

最近发布日期与版本

2023.05: v1.7.2

所属项目

CNCF云原生计算基金会沙箱项目

参考资料

ChaosBlade文档:https://chaosblade.io/docs/

ChaosBlade使用入门:https://developer.aliyun.com/article/1196882

ChaosBlade使用案例:https://juejin.cn/post/6996923672564858916?searchId=2023080922085236FCE1AB509C0489C977

混沌工程开源工具 Chaosblade 探究:https://juejin.cn/post/7037154744225234981?searchId=2023080922085236FCE1AB509C0489C977#heading-5


你还知道有什么好用的开源故障注入工具?你还希望我聊有关混沌工程的其他什么新话题?欢迎在评论区留言。我会仔细阅读每一条留言。期待听到你的声音。

如果觉得本文对你有帮助,欢迎点赞,【点击在读,】并转发给其他志同道合的小伙伴。

企业生意好,系统运行稳。你所阅读的文章,来自“吾真本说混沌工程”知乎专栏。

附录:ChaosBlade支持7个故障注入场景

1 主机基础资源

cpu Cpu experiment, for example full load

fullload cpu load

disk Disk experiment contains fill disk or burn io

burn Increase disk read and write io load

fill Fill the specified directory path

mem Mem experiment, for example load

load mem load

network Network experiment

corrupt Corrupt experiment

delay Delay experiment

dns Dns experiment

dns_down Make DNS is not accessible

drop Drop experiment

duplicate Duplicate experiment

loss Loss network package

occupy Occupy the specify port

reorder Reorder experiment

process Process experiment

kill Kill process

stop process fake death

file File experiment contains file content append, permission modification so on

add File or path add

append File content append

chmod File permission modification.

delete File delete

move File move

2 CRI容器

cri CRI experiment, for example remove container. If container-runtime is containerd, the container-id shoud be full id.

ck Clickhouse experiment

container Execute a container experiment

cpu Cpu experiment

disk Disk experiment

druid Experiment with the Druid

dubbo Experiment with the Dubbo

es ElasticSearch experiment!

feign feign experiment

file File experiment

gateway gateway experiment!

hbase hbase experiment!

http http experiment

jedis jedis experiment

jvm Experiment with the JVM

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

security SpringSecurity login experiment

servlet java servlet experiment

tars tars experiment

zk zk experiment

3 K8S平台

k8s Kubernetes experiment, for example kill pod

container-ck Clickhouse experiment

container-container Execute a container experiment

container-cpu Cpu experiment

container-disk Disk experiment

container-druid Experiment with the Druid

container-dubbo Experiment with the Dubbo

container-es ElasticSearch experiment!

container-feign feign experiment

container-file File experiment

container-gateway gateway experiment!

container-hbase hbase experiment!

container-http http experiment

container-jedis jedis experiment

container-jvm Experiment with the JVM

container-kafka kafka experiment

container-lettuce redis client lettuce experiment

container-log log experiment

container-mem Mem experiment

container-mongodb MongoDB experiment

container-mysql mysql experiment

container-network Network experiment

container-process Process experiment

container-psql Postgrelsql experiment

container-rabbitmq rabbitmq experiment

container-redisson redisson experiment

container-rocketmq Rocketmq experiment,can make message send or pull delay and exception

container-script Script chaos experiment

container-security SpringSecurity login experiment

container-servlet java servlet experiment

container-tars tars experiment

container-zk zk experiment

node-cpu Cpu experiment

node-disk Disk experiment

node-file File experiment

node-mem Mem experiment

node-network Network experiment

node-process Process experiment

node-script Script chaos experiment

pod-cpu Cpu experiment

pod-disk Disk experiment

pod-file File experiment

pod-mem Mem experiment

pod-network Network experiment

pod-pod Pod experiments

pod-process Process experiment

pod-script Script chaos experiment

4 Java应用

jvm Experiment with the JVM, and you can specify classes, method injection delays, return values, exception failure scenarios, or write Groovy and Java scripts to implement complex scenarios

CodeCacheFilling Fill up code cache.

OutOfMemoryError JVM out of memory

cpufullload Process occupied cpu full load

delay delay time

full-gc JVM full gc

return Return the specify value

script Dynamically execute custom scripts

threadfull Specifies that the application thread is soaring

throwCustomException throw custom exception

throwDeclaredException Throw the first declared exception of method

5 C++应用

cplus C++ chaos experiments contain code line delayed, variable modified and err returned

delay Code line delayed

modify Modify value of the variable in source code when program running

return error returned

6 阿里云

aliyun Aliyun experiment contains ecs, public ip, private ip, networkInterface, securityGroup, VSwitch, disk

disk do some aliyun diskId Operations, like detach

ecs do some aliyun ecs Operations, like stop, start, reboot

networkInterface do some aliyun networkInterfaceId Operations, like detach, attach

privateIp do some aliyun private ip Operations, like unassign

publicIp do some aliyun publicIp Operations, like release, unassociate

securityGroup do some aliyun securityGroupId Operations, like join, remove

vSwitch do some aliyun vSwitchId Operations, like delete

7 其他服务

ck Clickhouse experiment contains delay and exception by table name and so on

delay delay time

throwCustomException throw custom exception

druid Experiment with the Druid database connection pool, For example `blade create druid connectionpoolfull

connectionpoolfull Connection pool full

dubbo Dubbo experiment for testing service delay and exception

delay delay time

threadpoolfull Thread pool full

throwCustomException throw custom exception

es ElasticSearch experiment contains delay and exception by table name and so on

delay delay time

throwCustomException throw custom exception

feign feign experiment for testing service api delay and exception

delay delay time

throwCustomException throw custom exception

gateway gateway experiment contains delay and exception

delay delay time

throwCustomException throw custom exception

hbase hbase experiment contains delay and exception by table name and so on

delay delay time

throwCustomException throw custom exception

http http experiment for testing service delay and exception

delay delay time

throwCustomException throw custom exception

jedis jedis experiment contains delay and exception by command and so on

delay delay time

throwCustomException throw custom exception

kafka kafka experiment for testing service delay and exception

delay delay time

throwCustomException throw custom exception

lettuce redis client lettuce experiment

delay delay time

throwCustomException throw custom exception

update update action spec

log log experiment for testing service delay

delay delay time

throwCustomException throw custom exception

mongodb MongoDB experiment contains delay and exception by Collection name and so on

delay delay time

throwCustomException throw custom exception

mysql Mysql experiment contains delay and exception by table name and so on

delay delay time

throwCustomException throw custom exception

nginx Nginx experiment

config Config experiment

crash Crash experiment

response Response experiment

restart Restart experiment

psql Postgrelsql experiment contains delay and exception by table name and so on

delay delay time

throwCustomException throw custom exception

rabbitmq rabbitmq experiment

delay delay time

throwCustomException throw custom exception

redis Redis experiment

cache-expire Cache Expire

cache-limit Cache Memory Limit

redisson redisson experiment

delay delay time

throwCustomException throw custom exception

rocketmq Rocketmq experiment,can make message send or pull delay and exception,default if you not set [producerGroup,consumerGroup],will effect both send and pull message,if you only set producerGroup for specific group,will only effect on sendMessage,if you only set consumerGroup,will only effect pullMessage for specific group

delay delay time

throwCustomException throw custom exception

script Script chaos experiment

delay Script executed delay

exit Exit script

security SpringSecurity login experiment contains delay and exception by command and so on

delay delay time

throwCustomException throw custom exception

servlet Java servlet experiment, support path, query string, request method matcher

delay delay time

modifyCode update action spec

throwCustomException throw custom exception

strace strace experiment contains syscall delay or syscall error

delay Delay the syscall of the target pid

error change the syscall's return value of the target pid

systemd Systemd experiment

stop Stop systemd

tars tars experiment

delay delay time

throwCustomException throw custom exception

time Time experiment

travel Time Travel

zk zk experiment

delay delay time

throwCustomException throw custom exception

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,816评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,729评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 158,300评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,780评论 1 285
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,890评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,084评论 1 291
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,151评论 3 410
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,912评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,355评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,666评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,809评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,504评论 4 334
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,150评论 3 317
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,882评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,121评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,628评论 2 362
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,724评论 2 351

推荐阅读更多精彩内容