模拟时间故障
本文主要介绍如何使用 Chaosd 模拟时间偏移的场景。本功能支持通过命令行模式或服务模式创建实验。
使用命令行模式创建实验
本节介绍如何在命令行模式中创建时间故障实验。
在创建时间故障实验前,可运行以下命令行查看时间故障的相关配置项:
chaosd attack clock -h
结果如下所示:
$ chaosd attack clock -h
clock skew
Usage:
chaosd attack clock attack [flags]
Flags:
-c, --clock-ids-slice string The identifier of the particular clock on which to act.More clock description in linux kernel can be found in man page of clock_getres, clock_gettime, clock_settime.Muti clock ids should be split with "," (default "CLOCK_REALTIME")
-h, --help help for clock
-p, --pid int Pid of target program.
-t, --time-offset string Specifies the length of time offset.
Global Flags:
--log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'
--uid string the experiment ID