{"id":322,"date":"2021-05-08T04:25:44","date_gmt":"2021-05-07T19:25:44","guid":{"rendered":"http:\/\/10.124.124.111\/?p=322"},"modified":"2021-05-08T04:28:44","modified_gmt":"2021-05-07T19:28:44","slug":"pumba%e3%81%a7%e5%bc%b7%e5%88%b6%e7%9a%84%e3%81%abdocker%e3%82%b3%e3%83%b3%e3%83%86%e3%83%8a%e9%96%93%e3%81%ae%e3%83%91%e3%82%b1%e3%83%83%e3%83%88%e3%82%92%e3%83%ad%e3%82%b9%e3%81%95%e3%81%9b%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.homi.run\/?p=322","title":{"rendered":"Pumba\u3067\u5f37\u5236\u7684\u306bDocker\u30b3\u30f3\u30c6\u30ca\u9593\u306e\u30d1\u30b1\u30c3\u30c8\u3092\u30ed\u30b9\u3055\u305b\u308b"},"content":{"rendered":"\n<p>1\u5e74\u524d\u306e\u4eca\u9803\u3001\u6307\u5b9a\u3057\u305fDocker\u30b3\u30f3\u30c6\u30ca\u9593\u306e\u30d1\u30b1\u30c3\u30c8\u3092\u30ed\u30b9\u3055\u305b\u308b\u307f\u305f\u3044\u306a\u3053\u3068\u3092\u3084\u3063\u3066\u3044\u305f\u3002<\/p>\n\n\n\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u81ea\u5206\u306e\u5b66\u90e84\u5e74\u3067\u306e\u7814\u7a76\u306b\u304a\u3044\u3066\u5206\u6563\u30b7\u30b9\u30c6\u30e0\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5206\u65ad\u306e\u5bfe\u7b56\u624b\u6cd5\u307f\u305f\u3044\u306a\u3082\u306e\u3092\u63d0\u6848\u3057\u3066\u3044\u305f\u3002\u305d\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u7c21\u6613\u7684\u306b\u5b9f\u88c5\u3057\u3066\u3001\u5b9f\u969b\u306b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5206\u65ad\u3092\u767a\u751f\u3055\u305b\u3066\u30b9\u30d7\u30ea\u30c3\u30c8\u30d6\u30ec\u30a4\u30f3\u3092\u8d77\u3053\u305d\u3046\u3002\u305d\u308c\u3092\u4f7f\u3063\u3066\u8a55\u4fa1\u3057\u3088\u3046\u3002\u307f\u305f\u3044\u306a\u3053\u3068\u3092\u3084\u3063\u305f\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u6642\u306b\u5de1\u308a\u5408\u3063\u305f\u306e\u304c\u4eca\u56de\u7d39\u4ecb\u3059\u308b<a href=\"https:\/\/github.com\/alexei-led\/pumba\" title=\"https:\/\/github.com\/alexei-led\/pumba\">Pumba<\/a>\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pumba\u3068\u306f<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/10.124.124.111\/wp-content\/uploads\/2021\/05\/pumba_logo.png\" alt=\"\" class=\"wp-image-358\" width=\"235\" height=\"211\"\/><\/figure><\/div>\n\n\n\n<p>Pumba\u306f\u3044\u308f\u3086\u308b\u30ab\u30aa\u30b9\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u30c4\u30fc\u30eb\u306e\u4e00\u7a2e\u3067\u3001Docker\u306e\u30b3\u30f3\u30c6\u30ca\u5358\u4f4d\u3067\u624b\u8efd\u306b\u69d8\u3005\u306a\u64cd\u4f5c\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u4efb\u610f\u306e\u30b3\u30f3\u30c6\u30ca\u3092kill\u3057\u305f\u308a\u30b3\u30f3\u30c6\u30ca\u9593\u306e\u901a\u4fe1\u306e\u30d1\u30b1\u30c3\u30c8\u3092n%\u30ed\u30b9\u3055\u305b\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u3053\u308c\u3092\u4f7f\u3046\u3053\u3068\u3067\u969c\u5bb3\u304c\u8d77\u304d\u305f\u969b\u306b\u30b7\u30b9\u30c6\u30e0\u304c\u3069\u306e\u3088\u3046\u306b\u52d5\u304f\u306e\u304b\u3092\u624b\u5143\u3067\u89b3\u6e2c\u3059\u308b\u306e\u304c\u5bb9\u6613\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u60f3\u5b9a\u74b0\u5883<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>MacBook Pro (16\u30a4\u30f3\u30c1, 2019)<\/li><li>macOS Big Sur 11.2.3<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>$ brew install pumba<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4efb\u610f\u30b3\u30f3\u30c6\u30ca\u9593\u306e\u30d1\u30b1\u30c3\u30c8\u3092\u30ed\u30b9<\/h3>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u3001\u8a66\u3057\u306balpine\u306eDocker\u30b3\u30f3\u30c6\u30ca\u30922\u3064\u5efa\u3066\u3066\u305d\u306e\u9593\u306e\u30d1\u30b1\u30c3\u30c8\u3092\u30ed\u30b9\u3055\u305b\u3066\u89b3\u6e2c\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3046\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. Docker\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u5efa\u3066\u308b<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>$ docker network create pumba_test_network<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. \u30b3\u30f3\u30c6\u30ca\u3092\u5efa\u3066\u308b<\/h4>\n\n\n\n<p>\u3053\u3053\u3067\u306fdebian:latest\u306a\u30a4\u30e1\u30fc\u30b8\u3092\u7528\u3044\u3066\u3044\u308b\u304c\u3001tc\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u30a4\u30e1\u30fc\u30b8\u306a\u3089\u4f55\u3067\u3082\u3044\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ docker run --name container_1 --network pumba_test_network -itd debian:latest \/bin\/sh\n\n$ docker run --name container_2 --network pumba_test_network -itd debian:latest \/bin\/sh<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3. \u30ed\u30fc\u30ab\u30ebIP\u8abf\u3079\u3066ping\u3092\u901a\u3059<\/h4>\n\n\n\n<p>container_1\u306b\u5165\u3063\u3066\u30ed\u30fc\u30ab\u30ebIP\u3092\u8abf\u3079\u305f\u5f8c\u3001container_2\u3078ping\u3092\u901a\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ docker exec -it container_1 \/bin\/sh\n\n====== container_1\u5185 ======\n$ ip addr\n1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n    inet 127.0.0.1\/8 scope host lo\n       valid_lft forever preferred_lft forever\n2: tunl0@NONE: &lt;NOARP&gt; mtu 1480 qdisc noop state DOWN group default qlen 1000\n    link\/ipip 0.0.0.0 brd 0.0.0.0\n3: ip6tnl0@NONE: &lt;NOARP&gt; mtu 1452 qdisc noop state DOWN group default qlen 1000\n    link\/tunnel6 :: brd ::\n92: eth0@if93: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UP group default\n    link\/ether 02:42:ac:12:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0\n    inet <span class=\"has-inline-color has-vivid-red-color\">172.18.0.2<\/span><span class=\"has-inline-color has-black-color\">\/16<\/span> brd 172.18.255.255 scope global eth0\n       valid_lft forever preferred_lft forever\n\n\n$ ping container_2<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4. pumba\u306e\u30b3\u30de\u30f3\u30c9\u53e9\u304f<\/h4>\n\n\n\n<p>\u5225\u3067terminal\u958b\u3044\u3066\u30db\u30b9\u30c8OS\u4e0a\u3067pumba\u306e\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u304f\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067300\u79d2\u9593 container_2\u304b\u3089172.18.0.2\/32(container_1)\u3078\u306e\u30d1\u30b1\u30c3\u30c8\u3092100%\u30ed\u30b9\u3055\u305b\u308b\u4e8b\u304c\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ pumba netem --duration 300s -target 172.18.0.2\/32 loss -p 100 container_2<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u72b6\u614b\u3067container_1\u304c\u6295\u3052\u3066\u3044\u308bping\u306e\u69d8\u5b50\u3092\u898b\u308b\u3068\u591a\u5206\u6b62\u307e\u3063\u3066\u308b\u306f\u305a\u3002pumba\u306e\u30b3\u30de\u30f3\u30c9\u3092\u2318+C\u3068\u304b\u3067\u6b62\u3081\u308b\u3068ping\u304c\u518d\u5ea6\u6295\u3052\u3089\u308c\u59cb\u3081\u308b\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5. \u304a\u307e\u3051<\/h4>\n\n\n\n<p>\u5148\u7a0b\u306f\u30b3\u30f3\u30c6\u30ca2\u53f0\u3067\u884c\u3063\u305f\u304c\u3001\u8907\u6570\u53f0\u3068\u8907\u6570\u53f0\u3067\u30d1\u30b1\u30c3\u30c8\u30ed\u30b9\u3055\u305b\u305f\u308a\u3082\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p>\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u306f20\u53f0\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u534a\u5206\u306b\u5206\u3051\u3066\u30d1\u30b1\u30c3\u30c8\u30ed\u30b9\u3055\u305b\u305f\u3068\u304d\u306e\u4f8b\u3002(\u5b9f\u969b\u306b\u81ea\u5206\u304c\u5b9f\u9a13\u3067\u4f7f\u3063\u305f\u3084\u3064)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ pumba netem --duration 330s -target 172.16.124.11\/32 -target 172.16.124.12\/32 -target 172.16.124.13\/32 -target 172.16.124.14\/32 -target 172.16.124.15\/32 -target 172.16.124.16\/32 -target 172.16.124.17\/32 -target 172.16.124.18\/32 -target 172.16.124.19\/32 -target 172.16.124.20\/32 loss -p 100 node1 node2 node3 node4 node5 node6 node7 node8 node9 node10<\/code><\/pre>\n\n\n\n<p>\u6d41\u77f3\u306b\u3053\u3053\u307e\u3067\u9577\u3044\u3068\u30b3\u30f3\u30c6\u30ca\u6570\u304c\u5897\u6e1b\u3057\u305f\u3068\u304d\u306b\u624b\u66f8\u304d\u3057\u305f\u304f\u306a\u304f\u306a\u308b\u306e\u3067\u81ea\u5206\u306f\u30b3\u30de\u30f3\u30c9\u3092\u751f\u6210\u3059\u308b<a href=\"https:\/\/github.com\/homirun\/node_grouping_v2\/blob\/master\/pumba_cmd_generator.py\" title=\"https:\/\/github.com\/homirun\/node_grouping_v2\/blob\/master\/pumba_cmd_generator.py\">\u30b9\u30af\u30ea\u30d7\u30c8<\/a>\u66f8\u3044\u3066\u305f\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7d42\u308f\u308a\u306b<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u3001B4\u306e\u3068\u304d\u306b\u4f7f\u3063\u305fPumba\u306b\u3064\u3044\u3066\u306e\u8a18\u4e8b\u3092\u30bf\u30a4\u30c8\u30eb\u3060\u3051\u66f8\u3044\u3066\u653e\u7f6e\u3057\u3066\u3044\u305f\u306e\u30671\u5e74\u7720\u3089\u305b\u3066\u66f8\u3044\u305f\u3002\u81ea\u5206\u306f\u30d1\u30b1\u30c3\u30c8\u30ed\u30b9\u3050\u3089\u3044\u3057\u304b\u4f7f\u3046\u3053\u3068\u304c\u306a\u304b\u3063\u305f\u304c\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u9045\u5ef6\u3068\u304b\u3044\u308d\u3044\u308d\u9762\u767d\u305d\u3046\u306a\u6a5f\u80fd\u304c\u3042\u308b\u306e\u3067\u305c\u3072\u3044\u3064\u304b\u6a5f\u4f1a\u304c\u3042\u3063\u305f\u3089\u89e6\u3063\u3066\u307f\u305f\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u5e74\u524d\u306e\u4eca\u9803\u3001\u6307\u5b9a\u3057\u305fDocker\u30b3\u30f3\u30c6\u30ca\u9593\u306e\u30d1\u30b1\u30c3\u30c8\u3092\u30ed\u30b9\u3055\u305b\u308b\u307f\u305f\u3044\u306a\u3053\u3068\u3092\u3084\u3063\u3066\u3044\u305f\u3002 \u3068\u3044\u3046\u306e\u3082\u3001\u81ea\u5206\u306e\u5b66\u90e84\u5e74\u3067\u306e\u7814\u7a76\u306b\u304a\u3044\u3066\u5206\u6563\u30b7\u30b9\u30c6\u30e0\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5206\u65ad\u306e\u5bfe\u7b56\u624b\u6cd5\u307f\u305f\u3044\u306a\u3082\u306e\u3092\u63d0\u6848\u3057\u3066\u3044\u305f\u3002\u305d\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0 &hellip; <a href=\"https:\/\/blog.homi.run\/?p=322\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Pumba\u3067\u5f37\u5236\u7684\u306bDocker\u30b3\u30f3\u30c6\u30ca\u9593\u306e\u30d1\u30b1\u30c3\u30c8\u3092\u30ed\u30b9\u3055\u305b\u308b&#8221;\u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-322","post","type-post","status-publish","format-standard","hentry","category-1"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts\/322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=322"}],"version-history":[{"count":19,"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts\/322\/revisions"}],"predecessor-version":[{"id":390,"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts\/322\/revisions\/390"}],"wp:attachment":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}