chaos-mesh / chaosd

A Chaos Engineering toolkit.
Apache License 2.0
136 stars 63 forks source link

implement kafka chaos #154

Closed Hexilee closed 2 years ago

Hexilee commented 2 years ago

Add three subcommands for kafka attack:

flood

Usage

Flood kafka cluster with messages

Usage:
  chaosd attack kafka flood [options] [flags]

Flags:
  -h, --help              help for flood
  -H, --host string       the host of kafka leader (default "localhost")
  -p, --password string   the password of kafka client
  -P, --port uint16       the port of kafka leader (default 9092)
  -r, --rps uint          the request per second for each worker (default 128)
  -s, --size uint         the size of each message (default 1024)
  -t, --threads uint      the numbers of worker threads (default 100)
  -u, --username string   the username of kafka client

Global Flags:
      --log-level string   the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'
  -T, --topic string       the topic to attack
      --uid string         the experiment ID

Example

> bin/chaosd attack kafka flood -T test -r 200 -t 12

fill

Usage

Fill kafka cluster with messages

Usage:
  chaosd attack kafka fill [options] [flags]

Flags:
  -h, --help              help for fill
  -H, --host string       the host of kafka leader (default "localhost")
  -m, --max-bytes uint    the max bytes to fill (default 17179869184)
  -p, --password string   the password of kafka client
  -P, --port uint16       the port of kafka leader (default 9092)
  -s, --size uint         the size of each message (default 4096)
  -u, --username string   the username of kafka client

Global Flags:
      --log-level string   the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'
  -T, --topic string       the topic to attack
      --uid string         the experiment ID

Example

> bin/chaosd attack kafka fill -T test -m 1000_000_000

io

Usage

Make kafka cluster non-writable/non-readable

Usage:
  chaosd attack kafka io [options] [flags]

Flags:
  -c, --config string   the path of server config (default "/etc/kafka/server.properties")
  -h, --help            help for io
  -r, --non-readable    make kafka cluster non-readable
  -w, --non-writable    make kafka cluster non-writable

Global Flags:
      --log-level string   the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'
      --partition int      the partition to attack
  -T, --topic string       the topic to attack
      --uid string         the experiment ID

Example

bin/chaosd attack kafka io -T test -rw
ti-chi-bot commented 2 years ago

[REVIEW NOTIFICATION]

This pull request has been approved by:

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment. After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review. Reviewer can cancel approval by submitting a request changes review.
Hexilee commented 2 years ago

PTAL @WangXiangUSTC

Hexilee commented 2 years ago

@cwen0 All comments are resolved, PTAL again!

cwen0 commented 2 years ago

/merge

ti-chi-bot commented 2 years ago

This pull request has been accepted and is ready to merge.

Commit hash: 7d27a27c7f120fc6e3bc5aeb5a3412530a52ec0e