{"id":11959,"date":"2014-12-19T00:00:28","date_gmt":"2014-12-18T15:00:28","guid":{"rendered":"http:\/\/labs.gree.jp\/blog\/?p=11959"},"modified":"2014-12-18T10:58:37","modified_gmt":"2014-12-18T01:58:37","slug":"%e5%85%a5%e9%96%80consul-with-docker","status":"publish","type":"post","link":"https:\/\/labs.gree.jp\/blog\/2014\/12\/11959\/","title":{"rendered":"\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u5165\u9580 - \u591a\u7a2e\u591a\u69d8\u5316\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u3092Consul\u3067\u9023\u643a\u3055\u305b\u308b"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u672c\u90e8\u306e\u3042\u3060\u3061(<a href=\"https:\/\/twitter.com\/foostan\">@foostan<\/a>)\u3067\u3059\u3002<br \/>\n\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u306f GREE Advent Calendar 2014 19\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002\u6628\u65e5\u306f\u306b\u3057\u3060(<a href=\"https:\/\/twitter.com\/hosi_mo\">@hosi_mo<\/a>)\u3055\u3093\u306b\u3088\u308b<a href=\"http:\/\/labs.gree.jp\/blog\/2014\/12\/12698\/\">\u30cd\u30a4\u30c6\u30a3\u30d6\u30b2\u30fc\u30e0\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5e78\u305b\u306a\u8a2d\u8a08\u56f3<\/a>\u3067\u3057\u305f\u3002<\/p>\n<p>\u4eca\u5e74\u306e\u30b0\u30ea\u30fc\u30a2\u30c9\u30d9\u30f3\u30c8\u30ab\u30ec\u30f3\u30c0\u30fc\u306e\u30c6\u30fc\u30de\u306f\u300cGREE\u3092\u652f\u3048\u308b\u6280\u8853\u300d\u3067\u3059\u304c\u3001\u79c1\u304b\u3089\u306f\u300cGREE\u3092\u652f\u3048\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u6280\u8853\u300d\u3068\u3057\u3066Consul\u306b\u3064\u3044\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>\u672c\u30a8\u30f3\u30c8\u30ea\u306e\u5bfe\u8c61\u8005<\/h2>\n<p>\u672c\u30a8\u30f3\u30c8\u30ea\u3067\u306f\u3001\u7c21\u5358\u306aWeb\u30b7\u30b9\u30c6\u30e0\u3092\u4f8b\u306b\u3068\u3063\u3066\u3001Consul\u3084\u305d\u306e\u5468\u8fba\u30c4\u30fc\u30eb\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3084\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u4ed5\u7d44\u307f\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067<\/p>\n<ul>\n<li>Consul\u3063\u3066\u4f55\uff1f<\/li>\n<li>Consul\u3063\u3066\u4fbf\u5229\u305d\u3046\u3060\u3051\u3069\u3069\u3046\u3084\u3063\u3066\u4f7f\u3046\u306e\uff1f<\/li>\n<li>Consul\u89e6\u3063\u3066\u307f\u305f\u3051\u3069\u3001\u4f7f\u3044\u3069\u3053\u308d\u5206\u304b\u3089\u306a\u3044\u3093\u3060\u3051\u3069\uff1f<\/li>\n<li>\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3063\u3066\uff1f<\/li>\n<\/ul>\n<p>\u3068\u601d\u308f\u308c\u305f\u65b9\u306b\u3068\u3063\u3066\u826f\u3044\u60c5\u5831\u6e90\u306b\u306a\u308b\u3053\u3068\u3092\u671f\u5f85\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>Consul\u3068\u306f<\/h2>\n<p><a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/consul_logo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-12130\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/consul_logo.png\" alt=\"consul_logo\" width=\"100\" height=\"100\" \/><\/a><br \/>\nWeb\u3092\u5229\u7528\u3057\u305f\u30b7\u30b9\u30c6\u30e0\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306a\u3069\u306f\u305d\u306e\u898f\u6a21\u304c\u5927\u304d\u304f\u306a\u308b\u3068\u3001\u5f53\u7136\u305d\u308c\u3092\u63d0\u4f9b\u3059\u308b\u305f\u3081\u306e\u30b5\u30fc\u30d3\u30b9(Web, DBMS, NoSQL, Storage, Load Balancer, Application\u306a\u3069)\u3084\u305d\u308c\u3089\u3092\u652f\u3048\u308b\u305f\u3081\u306e\u30b5\u30fc\u30d0\u6570\u304c\u5897\u52a0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u30b5\u30fc\u30d0\u3084\u305d\u306e\u4e0a\u3067\u52d5\u304f\u30b5\u30fc\u30d3\u30b9\u304c\u5897\u3048\u3066\u304f\u308b\u3068\u3001\u5197\u9577\u5316\u3092\u6c17\u306b\u3057\u305f\u308a\u3001\u8ca0\u8377\u5bfe\u7b56\u3092\u884c\u3063\u305f\u308a\u3001\u969c\u5bb3\u5bfe\u5fdc\u306b\u8ffd\u308f\u308c\u305f\u308a\u306a\u3069\u3001\u904b\u7528\u30b3\u30b9\u30c8\u304c\u5897\u52a0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u69cb\u6210\u306eWeb\u30b7\u30b9\u30c6\u30e0\u3092\u904b\u7528\u3057\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u3002<\/p>\n<div style=\"text-align: center;\"><a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/sample_app.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13100\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/sample_app-327x400.png\" alt=\"\" width=\"268\" height=\"327\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/sample_app-327x400.png 327w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/sample_app-163x200.png 163w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/sample_app.png 406w\" sizes=\"auto, (max-width: 268px) 100vw, 268px\" \/><\/a><br \/>\nWeb\u30b7\u30b9\u30c6\u30e0\u306e\u69cb\u6210\u4f8b<\/div>\n<p>\u3053\u306e\u3068\u304d\u6b21\u306e\u3088\u3046\u306a\u72b6\u6cc1\u306b\u306a\u3063\u305f\u3089\u3069\u306e\u3088\u3046\u306b\u5bfe\u51e6\u3059\u308b\u3079\u304d\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<ul>\n<li>Web\u306b\u969c\u5bb3\u304c\u767a\u751f\u3057\u30a2\u30af\u30bb\u30b9\u304c\u51fa\u6765\u306a\u3044\u72b6\u614b\u3068\u306a\u3063\u305f<\/li>\n<li>DB Master\u306b\u969c\u5bb3\u304c\u767a\u751f\u3057\u3001Web\u304b\u3089\u306e\u66f8\u304d\u8fbc\u307f\u304c\u3067\u304d\u306a\u304f\u306a\u3063\u305f<\/li>\n<li>DB Slave\u306b\u969c\u5bb3\u304c\u767a\u751f\u3057\u3001Web\u304b\u3089\u306e\u8aad\u307f\u8fbc\u307f\u304c\u3067\u304d\u306a\u304f\u306a\u3063\u305f<\/li>\n<li>\u8ca0\u8377\u3092\u5206\u6563\u3055\u305b\u308b\u305f\u3081\u306b\u65b0\u305f\u306bWeb\u3092\u8ffd\u52a0\u3057\u305f\u304f\u306a\u3063\u305f<\/li>\n<li>\u8ca0\u8377\u3092\u5206\u6563\u3055\u305b\u308b\u305f\u3081\u306b\u65b0\u305f\u306bDB Slave\u3092\u8ffd\u52a0\u3057\u305f\u304f\u306a\u3063\u305f<\/li>\n<\/ul>\n<p>\u898f\u6a21\u304c\u5c0f\u3055\u3044\u3046\u3061\u306f\u624b\u4f5c\u696d\u3067\u5341\u5206\u306a\u5834\u5408\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u904b\u7528\u5bfe\u8c61\u304c\u6570\u5341\u53f0-&gt;\u6570\u767e\u53f0-&gt;\u6570\u5343\u53f0\u3068\u306a\u3063\u305f\u5834\u5408\u306f\u3069\u3046\u3067\u3057\u3087\u3046\u304b\u3001\u6c17\u304c\u9060\u304f\u306a\u308a\u307e\u3059\u3088\u306d\u3002<br \/>\n\u306a\u306e\u3067\u51fa\u6765\u308b\u9650\u308a\u306e\u3053\u3068\u306f\u81ea\u52d5\u5316\u3057\u3066\u6700\u5c0f\u9650\u306e\u52b4\u529b\u3067\u904b\u7528\u3057\u305f\u3044\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u4eca\u56de\u7d39\u4ecb\u3059\u308b\u306e\u304c<a title=\"Consul\" href=\"https:\/\/www.consul.io\/\" target=\"_blank\">Consul<\/a>\u3067\u3059\u3002<br \/>\nConsul\u306f<a href=\"https:\/\/www.vagrantup.com\/\">Vagrant<\/a>\u3084<a href=\"https:\/\/www.packer.io\/\">Packer<\/a>\u306a\u3069\u3092\u958b\u767a\u3057\u3066\u3044\u308b<a title=\"Hashicorp\" href=\"https:\/\/www.hashicorp.com\/\" target=\"_blank\">Hashicorp<\/a>\u306b\u3088\u308b\u30d7\u30ed\u30c0\u30af\u30c8\u306e\u3072\u3068\u3064\u3067\u3001\u5404\u7a2e\u30b5\u30fc\u30d0\u3092\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3055\u305b\u308b\u305f\u3081\u306e\u69d8\u3005\u306a\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\"\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\"\u3068\u3044\u3046\u8a00\u8449\u306f\u62bd\u8c61\u5ea6\u304c\u9ad8\u3044\u306e\u3067\u672c\u30a8\u30f3\u30c8\u30ea\u3067\u306f<\/p>\n<blockquote><p>\u8907\u96d1\u306a\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30b7\u30b9\u30c6\u30e0\/\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\/\u30b5\u30fc\u30d3\u30b9\u306e\u914d\u5099\/\u8a2d\u5b9a\/\u7ba1\u7406\u306e\u81ea\u52d5\u5316\u3092\u6307\u3059\u7528\u8a9e(<a href=\"http:\/\/ja.wikipedia.org\/wiki\/%E3%82%AA%E3%83%BC%E3%82%B1%E3%82%B9%E3%83%88%E3%83%AC%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3_%28%E3%82%B3%E3%83%B3%E3%83%94%E3%83%A5%E3%83%BC%E3%82%BF%29\">Wikipedia<\/a>\u3088\u308a\u5f15\u7528)<\/p><\/blockquote>\n<p>\u3068\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<h2>Consul\u306e\u5b88\u5099\u7bc4\u56f2<\/h2>\n<p>Web\u30b7\u30b9\u30c6\u30e0\u3092\u958b\u767a(Develop)\/\u516c\u958b(Deploy)\/\u904b\u7528(Maintenance)\u306e\u30d5\u30a7\u30fc\u30ba\u306b\u5206\u3051\u308b\u3068\u3059\u308b\u3068\u3001Consul\u306e\u5b88\u5099\u7bc4\u56f2\u306f\u904b\u7528\u306e\u30d5\u30a7\u30fc\u30ba\u306b\u3042\u305f\u308a\u307e\u3059\u3002<br \/>\n\u5148\u65e5\u516c\u958b\u3055\u308c\u305fHashicorp\u306e\u65b0\u30b5\u30fc\u30d3\u30b9<a href=\"https:\/\/atlas.hashicorp.com\/\">ATLAS<\/a>\u3067\u306eConsul\u306e\u4f4d\u7f6e\u3065\u3051\u3092\u307f\u308b\u3068\u3001<br \/>\n<a href=\"https:\/\/www.terraform.io\/\">Terraform<\/a>\u306b\u3088\u308b\u30b5\u30fc\u30d3\u30b9\u516c\u958b\u5f8c\u306b\u5229\u7528\u3055\u308c\u308b\u3053\u3068\u3092\u60f3\u5b9a\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<div style=\"text-align: center;\"><a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/how_atlas_work.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12830 size-medium\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/how_atlas_work-600x393.png\" alt=\"how_atlas_work\" width=\"600\" height=\"393\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/how_atlas_work-600x393.png 600w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/how_atlas_work-276x180.png 276w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/how_atlas_work-830x544.png 830w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/how_atlas_work.png 836w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><br \/>\n<a href=\"https:\/\/atlas.hashicorp.com\/\">https:\/\/atlas.hashicorp.com\/<\/a>\u3088\u308a\u8ee2\u8f09<\/div>\n<p>\u305f\u3060\u3057\u3053\u306e\u3042\u305f\u308a\u306e\u5883\u754c\u306f\u66d6\u6627\u306a\u306e\u3067\u3001\u305f\u3068\u3048\u3070Chef\u306a\u3069\u306e\u30d7\u30ed\u30d3\u30b8\u30e7\u30cb\u30f3\u30b0\u30c4\u30fc\u30eb\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u3042\u308c\u3070\u3001Chef\u3067\u5404\u7a2e\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u306e\u8a2d\u5b9a\u3068Consul\u306e\u8a2d\u7f6e\u3092\u884c\u3044\u3001\u305d\u306e\u3042\u3068\u306e\u516c\u958b\u4f5c\u696d\u3084\u904b\u7528\u4f5c\u696d\u3092Consul\u3067\u884c\u3046\u3068\u304b\u3001Capistrano\u3092\u4f7f\u3063\u3066\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u914d\u7f6e\u304a\u3088\u3073\u516c\u958b\u3092\u884c\u3063\u3066\u3044\u308b\u306e\u3067\u3042\u308c\u3070\u3001\u305d\u306e\u5f8c\u306e\u904b\u7528\u4f5c\u696d\u3060\u3051\u3092Consul\u306b\u4efb\u305b\u308b\u3068\u304b\u3001\u7528\u9014\u306b\u5fdc\u3058\u3066\u5404\u30c4\u30fc\u30eb\u3092\u4f7f\u3044\u5206\u3051\u305f\u308a\u7d44\u307f\u5408\u308f\u305b\u308b\u306e\u304c\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u5165\u9580<\/h2>\n<p>\u5148\u307b\u3069\u6319\u3052\u305fWeb\u30b7\u30b9\u30c6\u30e0\u3092\u4f8b\u306b\u53d6\u308a\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u8df5\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>\u4e0b\u6e96\u50991 - Consul Agent\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8d77\u52d5<\/h3>\n<p>Consul\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u904b\u7528\u5bfe\u8c61\u3068\u306a\u308b\u5404\u30b5\u30fc\u30d0\u306bAgent\u3092\u8a2d\u7f6e\u3057\u307e\u3059\u3002<br \/>\nAgent\u306fGo\u8a00\u8a9e\u3067\u5b9f\u88c5\u3055\u308c\u3066\u304a\u308a\u3001\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3092\u3072\u3068\u3064\u8a2d\u7f6e\u3059\u308b\u3060\u3051\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<pre class=\"theme:github toolbar:2 striped:false marking:false ranges:false nums:false nums-toggle:false lang:sh highlight:0 decode:true\">$ wget -P \/tmp https:\/\/dl.bintray.com\/mitchellh\/consul\/0.4.1_linux_amd64.zip\r\n$ unzip \/tmp\/0.4.1_linux_amd64.zip -d \/tmp\r\n$ mv \/tmp\/consul \/usr\/bin\r\n<\/pre>\n<p>Agent\u306b\u306fServer\u3068Client\u304c\u3042\u308a\u3001Server\u304cRaft consensus algorithm(<a href=\"https:\/\/ramcloud.stanford.edu\/wiki\/download\/attachments\/11370504\/raft.pdf\">pdf<\/a>)\u3092\u7528\u3044\u3066\u3001\u30af\u30e9\u30b9\u30bf\u3092\u5f62\u6210\u3057\u307e\u3059\u3002\u307e\u305f\u3001Client\u3082\u30af\u30e9\u30b9\u30bf\u306e\u4e00\u54e1\u3067\u3059\u304c\u3001\u53d7\u3051\u53d6\u3063\u305f\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u81ea\u8eab\u3067\u306f\u89e3\u6c7a\u305b\u305a\u306bServer\u306b\u8ee2\u9001\u3057\u3066\u51e6\u7406\u3092\u59d4\u8a17\u3057\u307e\u3059\u3002<br \/>\n\u3053\u306e\u3042\u305f\u308a\u306e\u8a73\u3057\u3044\u52d5\u4f5c\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/www.consul.io\/docs\/internals\/consensus.html\">CONSENSUS PROTOCOL<\/a>\u306b\u307e\u3068\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Agent\u306e\u8d77\u52d5\u306fServer\u306e\u5834\u5408<\/p>\n<pre class=\"theme:github toolbar:2 striped:false marking:false ranges:false nums:false nums-toggle:false lang:sh highlight:0 decode:true\">$ consul agent -data-dir \/tmp -server -bootstrap-expect 3\r\n<\/pre>\n<p>\u306e\u3088\u3046 -server \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u3066\u8d77\u52d5\u3057\u3001\u3055\u3089\u306b1\u53f0\u76ee\u306eServer\u306b\u9650\u308a -bootstrap-expect \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u30012\u53f0\u76ee\u4ee5\u964d\u306f<\/p>\n<pre class=\"theme:github toolbar:2 striped:false marking:false ranges:false nums:false nums-toggle:false lang:sh highlight:0 decode:true\">$ consul agent -data-dir \/tmp -server -join {1\u53f0\u76ee\u306eServer\u306eIP}\r\n<\/pre>\n<p>\u306e\u3088\u3046\u306b\u3001-join \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u65e2\u306b\u8d77\u52d5\u6e08\u307f\u306eAgent\u306b\u5bfe\u3057\u3066Join\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001-bootstrap-expect \u306b\u4e0e\u3048\u305f\u6570\u306eServer\u6570\u304cJoin\u3057\u305f\u5730\u70b9\u3067Raft consensus algorithm\u306b\u3088\u3063\u3066\u30af\u30e9\u30b9\u30bf\u304c\u5f62\u6210\u3055\u308c\u3066Consul\u306e\u5404\u7a2e\u6a5f\u80fd\u304c\u5229\u7528\u53ef\u80fd\u306a\u72b6\u614b\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u306a\u304a -ui-dir \u30aa\u30d7\u30b7\u30e7\u30f3\u3067UI\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001<a href=\"http:\/\/demo.consul.io\/ui\/#\/ams2\/services\">http:\/\/demo.consul.io\/ui\/#\/ams2\/services<\/a>\u306e\u3088\u3046\u306aWebUI\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Client\u306f<\/p>\n<pre class=\"theme:github toolbar:2 striped:false marking:false ranges:false nums:false nums-toggle:false lang:sh highlight:0 decode:true\">$ consul agent -data-dir \/tmp -join {\u8d77\u52d5\u6e08\u307f\u306eAgent\u306eIP}\r\n<\/pre>\n<p>-server \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5916\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p>\u30af\u30e9\u30b9\u30bf\u5185\u306e\u30e1\u30f3\u30d0\u30fc\u306e\u78ba\u8a8d\u3092\u884c\u3046\u305f\u3081\u306b\u306f members \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"theme:github toolbar:2 striped:false marking:false ranges:false nums:false nums-toggle:false lang:sh highlight:0 decode:true\">$ consul members\r\nNode     Address             Status  Type    Build  Protocol\r\nlb-1     192.168.33.11:8301  alive   server  0.4.1  2\r\nlb-2     192.168.33.12:8301  alive   server  0.4.1  2\r\nweb-1    192.168.33.21:8301  alive   server  0.4.1  2\r\nweb-2    192.168.33.22:8301  alive   client  0.4.1  2\r\nweb-3    192.168.33.23:8301  alive   client  0.4.1  2\r\ndb-1     192.168.33.31:8301  alive   client  0.4.1  2\r\ndb-2     192.168.33.32:8301  alive   client  0.4.1  2\r\n<\/pre>\n<h3>\u4e0b\u6e96\u50992 - \u30b5\u30fc\u30d3\u30b9\u306e\u767b\u9332\u3068DNS\u306e\u8a2d\u5b9a<\/h3>\n<p>\u5404\u7a2e\u30b5\u30fc\u30d3\u30b9\u3092\u30af\u30e9\u30b9\u30bf\u5185\u3067\u8a8d\u8b58\u3067\u304d\u308b\u3088\u3046\u306b\u767b\u9332\u4f5c\u696d\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\n\u306a\u304a\u5404\u30b5\u30fc\u30d3\u30b9\u306f<\/p>\n<ul>\n<li>LB: HA Proxy<\/li>\n<li>Web: Apache + PHP<\/li>\n<li>DB: MySQL<\/li>\n<\/ul>\n<p>\u3067\u52d5\u4f5c\u3057\u3066\u3044\u308b\u3082\u306e\u3068\u3057\u3066\u8a71\u3092\u9032\u3081\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h4>\u30b5\u30fc\u30d3\u30b9\u306e\u767b\u9332<\/h4>\n<p>Consul\u306b\u306f\u30b5\u30fc\u30d3\u30b9\u3092\u767b\u9332\u3059\u308b\u65b9\u6cd5\u3068\u3057\u3066\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u884c\u3046\u65b9\u6cd5\u3068API\u3067\u884c\u3046\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u767b\u9332\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u3088\u3046\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306eJson\u3092Agent\u8d77\u52d5\u6642\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre>{\r\n  \"service\": {\r\n    \"name\": \"db\",\r\n    \"tags\": [\"master\"],\r\n    \"port\": 3306,\r\n    \"check\": {\r\n      \"script\": \"\/usr\/local\/bin\/check_mysql_master\",\r\n      \"interval\": \"10s\"\r\n    }\r\n  }\r\n}\r\n<\/pre>\n<p>\u30c1\u30a7\u30c3\u30af\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30b5\u30fc\u30d3\u30b9\u306e\u6b7b\u6d3b\u76e3\u8996\u3092\u884c\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u306a\u304a\u3001\u30c1\u30a7\u30c3\u30af\u30b9\u30af\u30ea\u30d7\u30c8\u306fAgent\u304c\u52d5\u3044\u3066\u3044\u308b\u30b5\u30fc\u30d0\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u3082\u306e\u3067\u3042\u308c\u3070\u8a00\u8a9e\u3092\u554f\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u6b7b\u6d3b\u76e3\u8996\u306f\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306eExit Code\u3092\u898b\u3066<\/p>\n<ul>\n<li>Exit code 0 - Check is passing<\/li>\n<li>Exit code 1 - Check is warning<\/li>\n<li>Any other code - Check is failing<\/li>\n<\/ul>\n<p>\u306e\u3088\u3046\u306b\u5224\u5b9a\u3057\u307e\u3059\u3002<br \/>\nSensu\u306a\u3069\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u4e92\u63db\u6027\u304c\u3042\u308b\u305f\u3081<a href=\"https:\/\/github.com\/sensu\/sensu-community-plugins\">https:\/\/github.com\/sensu\/sensu-community-plugins<\/a>\u306a\u3069\u304b\u3089\u6d41\u7528\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h4>DNS\u306e\u8a2d\u5b9a<\/h4>\n<p>\u30b5\u30fc\u30d3\u30b9\u3092\u767b\u9332\u3059\u308b\u3068\u3001API\u304a\u3088\u3073DNS\u304b\u3089\u53c2\u7167\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nAPI\u304a\u3088\u3073DNS\u306f\u5168\u3066\u306eConsul Agent\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u30678500\u30dd\u30fc\u30c8(API)\u304a\u3088\u30738600\u30dd\u30fc\u30c8(DNS)\u304b\u3089\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u3053\u308c\u3089\u306e\u30dd\u30fc\u30c8\u306f\u81ea\u7531\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001DNS\u309253\u30dd\u30fc\u30c8\u3067\u63d0\u4f9b\u3059\u308b\u969b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u8a18\u8ff0\u3057\u3066\u3001Agent\u8d77\u52d5\u6642\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre>{\r\n  \"ports\": {\r\n    \"dns\": 53\r\n  },\r\n  \"recursor\": \"8.8.8.8\"\r\n}\r\n<\/pre>\n<p>\u3053\u306eDNS\u306f\u30af\u30e9\u30b9\u30bf\u5185\u306e\u30b5\u30fc\u30d3\u30b9\u306b\u3064\u3044\u3066\u540d\u524d\u89e3\u6c7a\u3057\u3066\u304f\u308c\u308b\u3082\u306e\u3067\u3001\u305f\u3068\u3048\u3070\u3001'lb' \u3068\u3044\u3046\u30b5\u30fc\u30d3\u30b9\u540d\u306e\u5834\u5408\u3001lb.service.consul \u3067\u540d\u524d\u89e3\u6c7a\u3057\u3066\u304f\u308c\u307e\u3059(\u6b7b\u6d3b\u30c1\u30a7\u30c3\u30af\u3067failing\u306b\u306a\u308b\u3082\u306e\u306f\u9664\u304b\u308c\u307e\u3059)\u3002<br \/>\ndig \u30b3\u30de\u30f3\u30c9\u3067\u554f\u3044\u5408\u308f\u305b\u308b\u3068A\u30ec\u30b3\u30fc\u30c9\u304c\u8fd4\u3063\u3066\u304f\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"theme:github toolbar:2 striped:false marking:false ranges:false nums:false nums-toggle:false lang:sh highlight:0 decode:true\">$ dig @127.0.0.1 -p 53 proxy.service.consul. ANY\r\n-- \u7701\u7565 --\r\n\r\n;; ANSWER SECTION:\r\nlb.service.consul.  0   IN  A   192.168.33.11\r\nlb.service.consul.  0   IN  A   192.168.33.12\r\n\r\n-- \u7701\u7565 --\r\n<\/pre>\n<p>\u306a\u304aAgent\u304c\u63d0\u4f9b\u3059\u308bDNS\u306f\u30af\u30e9\u30b9\u30bf\u5185\u306e\u30b5\u30fc\u30d3\u30b9\u306b\u5bfe\u3059\u308b\u540d\u524d\u89e3\u6c7a\u3057\u304b\u884c\u3044\u307e\u305b\u3093\u304c\u3001recursor \u306b\u5916\u90e8\u306eDNS\u30b5\u30fc\u30d0\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u540d\u524d\u89e3\u6c7a\u304c\u51fa\u6765\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u3001\u5916\u90e8\u306b\u554f\u3044\u5408\u308f\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\/etc\/resolve.conf\u306a\u3069\u306b127.0.0.1\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067dig\u30b3\u30de\u30f3\u30c9\u4ee5\u5916\u3067\u3082\u540d\u524d\u89e3\u6c7a\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3064\u307e\u308a\u30af\u30e9\u30b9\u30bf\u5185\u306e\u5168\u30b5\u30fc\u30d3\u30b9\u306b\u5bfe\u3057\u3066\u540d\u524d\u30d9\u30fc\u30b9\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u4e0b\u6e96\u5099\u306f\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u4ee5\u964d\u304b\u3089\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>LB\u306e\u8a2d\u5b9a\u3092\u81ea\u52d5\u5316\u3059\u308b<\/h3>\n<p>HA Proxy\u3067\u306f\u632f\u308a\u5206\u3051\u5148\u3068\u306a\u308bWeb\u30b5\u30fc\u30d3\u30b9\u306eIP\u3092\u8a18\u8f09\u3057\u305f\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u8ffd\u52a0\u3084\u524a\u9664\u3092\u884c\u3046\u5834\u5408\u306f\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u66f8\u304d\u63db\u3048\u3066\u30ea\u30ed\u30fc\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305f\u3068\u3048\u3070\u3001\u3042\u308bWeb\u30b5\u30fc\u30d3\u30b9\u306b\u969c\u5bb3\u304c\u767a\u751f\u3057\u305f\u3068\u3057\u307e\u3059\u3002<br \/>\n\u969c\u5bb3\u304c\u767a\u751f\u3057\u305f\u30b5\u30fc\u30d0\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306f\u6b62\u3081\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u3067\u3001<\/p>\n<ul>\n<li>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u969c\u5bb3\u304c\u767a\u751f\u3057\u305f\u30b5\u30fc\u30d0\u3092\u9664\u304f<\/li>\n<li>LB\u3092\u518d\u8d77\u52d5\u3059\u308b<\/li>\n<li>\u4e0a\u8a18\u5bfe\u5fdc\u3092\u5168LB\u3067\u5b9f\u65bd\u3059\u308b<\/li>\n<\/ul>\n<p>\u3068\u3044\u3063\u305f\u4f5c\u696d\u304c\u767a\u751f\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u8ca0\u8377\u5bfe\u7b56\u306a\u3069\u3067Web\u30b5\u30fc\u30d3\u30b9\u3092HA Proxy\u914d\u4e0b\u306b\u8ffd\u52a0\u3059\u308b\u3068\u304d\u3082\u6642\u3082\u540c\u3058\u3088\u3046\u306a\u4f5c\u696d\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u4f5c\u696d\u3092\u81ea\u52d5\u5316\u3059\u308b\u305f\u3081\u306b\u3001<a href=\"https:\/\/github.com\/hashicorp\/consul-template\">Consul-template<\/a>\u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u5229\u7528\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<h4>Consul-template<\/h4>\n<p>Consul-template\u3092\u5229\u7528\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u69d8\u306a\u3053\u3068\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30af\u30e9\u30b9\u30bf\u5185\u306e\u5909\u5316(\u30b5\u30fc\u30d3\u30b9\u306e\u72b6\u614b\u5909\u5316\u3084KVS\u203b\u306e\u5909\u5316)\u3092\u691c\u77e5\u3059\u308b<\/li>\n<li>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304b\u3089\u30af\u30e9\u30b9\u30bf\u5185\u306e\u60c5\u5831\u3092\u5229\u7528\u3057\u3066\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3059\u308b<\/li>\n<li>\u4efb\u610f\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b<\/li>\n<\/ul>\n<p>\u203bConsul\u306b\u306f\u30af\u30e9\u30b9\u30bf\u5185\u3067\u5171\u6709\u3057\u3066\u5229\u7528\u53ef\u80fd\u306aKey\/Value Store\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001HA Proxy\u306e\u5834\u5408\u4ee5\u4e0b\u306e\u69d8\u306a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u7528\u610f\u3057\u307e\u3059\u3002<\/p>\n<pre>global\r\n    log \/dev\/log local0\r\n    log \/dev\/log local1 notice\r\n    chroot \/var\/lib\/haproxy\r\n    user  haproxy\r\n    group haproxy\r\n    daemon\r\n\r\nfrontend  main *:80\r\n    default_backend    web\r\n\r\nbackend web\r\n    balance roundrobin{{range service \"web\"}}\r\n    server {{.ID}} {{.Address}}:{{.Port}} check{{end}}\r\n<\/pre>\n<p>\u3053\u308c\u306fHA Proxy\u7528\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u7528\u306e\u8a2d\u5b9a\u3092\u52a0\u3048\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>backend \u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u3068\u3053\u308d\u3092Consul-template\u3067\u52d5\u7684\u306b\u751f\u6210\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u3053\u306e\u5834\u5408Web\u30b5\u30fc\u30d3\u30b9\u306eIP\u30a2\u30c9\u30ec\u30b9\u3068\u30dd\u30fc\u30c8\u3092\u5217\u6319\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u306a\u304a\u5bfe\u8c61\u3068\u306a\u308b\u30b5\u30fc\u30d3\u30b9\u306f\u6b7b\u6d3b\u30c1\u30a7\u30c3\u30af\u3092\u901a\u3063\u305f\u3082\u306e\u306b\u9650\u5b9a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\u3092 haproxy.ctmpl \u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057\u3066\u304a\u304d\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306bConsul-template\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"theme:github toolbar:2 striped:false marking:false ranges:false nums:false nums-toggle:false lang:sh highlight:0 decode:true\">$ sudo consul-template\\\r\n -consul=localhost:8500\\\r\n -template=\/vagrant\/haproxy.ctmpl:\/etc\/haproxy\/haproxy.cfg:\"\/etc\/init.d\/haproxy reload\"\r\n<\/pre>\n<p>\u3053\u308c\u3067\u3001Consul\u5185\u306e\u5909\u5316\u3092\u691c\u77e5\u3059\u308b\u3068 haproxy.ctmpl \u304b\u3089 haproxy.cfg \u3092\u751f\u6210\u3057\u3001HA Proxy\u3092\u30ea\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3053\u308d\u307e\u3067\u3084\u3063\u3066\u304f\u308c\u307e\u3059\u3002<br \/>\n\u3064\u307e\u308a\u3001Web\u30b5\u30fc\u30d3\u30b9\u3067\u969c\u5bb3\u304c\u767a\u751f\u3057\u3001\u6b7b\u6d3b\u30c1\u30a7\u30c3\u30af\u3067failing\u306b\u306a\u308b\u3068\u3001\u305d\u308c\u3092\u691c\u77e5\u3057\u3066\u81ea\u52d5\u7684\u306bLB\u304b\u3089\u629c\u304b\u308c\u307e\u3059\u3002<br \/>\n\u65b0\u898f\u8ffd\u52a0\u3059\u308b\u969b\u3082\u3001\u65b0\u3057\u3044Web\u30b5\u30fc\u30d3\u30b9\u304c\u691c\u77e5\u3055\u308c\u308b\u3068\u81ea\u52d5\u7684\u306bLB\u306b\u633f\u5165\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u5909\u308f\u308a\u7a2e\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u69d8\u306a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u3057\u3066\u3082\u9762\u767d\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre>global\r\n    log \/dev\/log local0\r\n    log \/dev\/log local1 notice\r\n    chroot \/var\/lib\/haproxy\r\n    user  haproxy\r\n    group haproxy\r\n    daemon\r\n\r\nfrontend  main *:80\r\n    default_backend    web\r\n\r\nbackend web\r\n{{$state := (key \"service\/web\/state\")}}\r\n    bind *:{{if eq $state \"green\"}}8080{{else}}80{{end}}{{range service \"blue.web\"}}\r\n    server {{.ID}} {{.Address}}:{{.Port}}{{end}}\r\n\r\n    bind *:{{if eq $state \"green\"}}80{{else}}8080{{end}}{{range service \"green.web\"}}\r\n    server {{.ID}} {{.Address}}:{{.Port}}{{end}}\r\n<\/pre>\n<p>\u3053\u308c\u306f\u3001KVS\u306b\u73fe\u5728\u306eWeb\u30b5\u30fc\u30d3\u30b9\u306e\u72b6\u614b(blue\u307e\u305f\u306fgreen)\u3092\u4fdd\u6301\u3057\u3066\u304a\u3044\u3066\u3001\u305d\u308c\u305e\u308cblue\u307e\u305f\u306fgreen\u3067\u30bf\u30b0\u4ed8\u3051\u3055\u308c\u305fWeb\u30b5\u30fc\u30d3\u30b9\u3092\u6709\u52b9\u306b\u3059\u308b\u305f\u3081\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u3059\u3002<br \/>\n\u72b6\u614b\u304cblue\u306e\u5834\u5408\u306fblue.web\u306f80\u30dd\u30fc\u30c8\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3067\u304d\u3001green\u306f8080\u304b\u3089\u30a2\u30af\u30bb\u30b9\u51fa\u6765\u308b\u72b6\u614b\u3068\u306a\u308a\u3001KVS\u306e\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u30dd\u30fc\u30c8\u304c\u5207\u308a\u66ff\u308f\u308b\u305f\u3081\u3001blue-green deployment\u304c\u51fa\u6765\u305f\u308a\u3057\u307e\u3059(\u73fe\u5b9f\u7684\u304b\u306f\u7f6e\u3044\u3066\u304a\u3044\u3066\u67d4\u8edf\u306a\u4f7f\u3044\u65b9\u304c\u53ef\u80fd\u3068\u3044\u3046\u308f\u3051\u3067\u3059)\u3002<\/p>\n<p>\u4f59\u8ac7\u3092\u306f\u3055\u307f\u307e\u3057\u305f\u304c\u3001LB\u306e\u8a2d\u5b9a\u306e\u81ea\u52d5\u5316\u306f\u4ee5\u4e0a\u3067\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<div style=\"text-align: center;\"><a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/ha_proxy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13101\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/ha_proxy.png\" alt=\"\" width=\"380\" height=\"240\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/ha_proxy.png 588w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/ha_proxy-276x174.png 276w\" sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><\/a><br \/>\n\u3053\u3053\u307e\u3067\u306e\u69cb\u6210<\/div>\n<h3>DB\u306e\u904b\u7528\u3092\u81ea\u52d5\u5316\u3059\u308b<\/h3>\n<p>DB\u306b\u3064\u3044\u3066\u306fSlave\u3068Master\u306b\u5206\u3051\u3066\u81ea\u52d5\u5316\u306e\u8a71\u3092\u9032\u3081\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h4>DB Slave\u3078\u306e\u53c2\u7167\u3092\u540d\u524d\u30d9\u30fc\u30b9\u3067\u884c\u3046<\/h4>\n<p>MySQL\u306b\u304b\u304e\u3089\u305aDB\u306eSlave\u306fRead Only\u3067\u3042\u308b\u3053\u3068\u304c\u307b\u3068\u3093\u3069\u3067\u3042\u308a\u3001\u3042\u307e\u308a\u6c17\u306b\u305b\u305a\u4e26\u5217\u5ea6\u3092\u4e0a\u3052\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3057\u3001Web\u304b\u3089IP\u30a2\u30c9\u30ec\u30b9\u30d9\u30fc\u30b9\u3067\u63a5\u7d9a\u3059\u308b\u3088\u3046\u306a\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3001\u4e26\u5217\u5ea6\u3092\u4e0a\u3052\u305f\u3068\u3053\u308d\u3067Web\u30b5\u30fc\u30d3\u30b9\u5074\u3067\u3082\u5bfe\u5fdc\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u305a\u3001\u6570\u304c\u591a\u3044\u307b\u3069\u5927\u5909\u306a\u4f5c\u696d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>HA Proxy\u3092\u524d\u6bb5\u306b\u631f\u3080\u3068\u3044\u3046\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u5148\u307b\u3069\u306eLB\u306e\u4f8b\u3068\u304b\u3076\u308b\u306e\u3067\u3001\u4eca\u56de\u306fDNS\u306b\u3088\u308b\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u5404\u7a2e\u30b5\u30fc\u30d3\u30b9\u304c\u30af\u30e9\u30b9\u30bf\u5185\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308c\u3070\u3001\u5404Web\u30b5\u30fc\u30d3\u30b9\u304b\u3089 slave.db.service.consul \u3067DB Slave\u3078\u306e\u30a2\u30af\u30bb\u30b9\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"theme:github toolbar:2 striped:false marking:false ranges:false nums:false nums-toggle:false lang:sh highlight:0 decode:true\">$ dig @127.0.0.1 -p 53 slave.db.service.consul. ANY\r\n-- \u7701\u7565 --\r\n\r\n;; ANSWER SECTION:\r\nslave.db.service.consul.  0   IN  A   192.168.33.32\r\nslave.db.service.consul.  0   IN  A   192.168.33.33\r\n\r\n-- \u7701\u7565 --\r\n<\/pre>\n<p>\u306a\u306e\u3067Web\u30b5\u30fc\u30d3\u30b9\u3067\u306e\u5bfe\u5fdc\u306fIP\u30a2\u30c9\u30ec\u30b9\u30d9\u30fc\u30b9\u3067\u53c2\u7167\u3057\u3066\u3044\u305f\u7b87\u6240\u3092 slave.db.service.consul \u306b\u5909\u3048\u308b\u3060\u3051\u3067\u6e08\u307f\u3001Slave\u3078\u306e\u30a2\u30af\u30bb\u30b9\u304cDNS round robbin\u3067\u5206\u6563\u3055\u308c\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3067\u3001Slave\u306b\u969c\u5bb3\u304c\u8d77\u304d\u305f\u5834\u5408\u306fDNS\u306b\u3088\u308b\u540d\u524d\u89e3\u6c7a\u306e\u5bfe\u8c61\u304b\u3089\u81ea\u52d5\u3067\u5916\u308c\u3001\u65b0\u898f\u306b\u8ffd\u52a0\u3059\u308b\u5834\u5408\u306f\u540d\u524d\u89e3\u6c7a\u306e\u5bfe\u8c61\u306b\u81ea\u52d5\u3067\u8ffd\u52a0\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>DB Master\u969c\u5bb3\u767a\u751f\u6642\u306e\u624b\u9806\u3092\u81ea\u52d5\u5316\u3059\u308b<\/h4>\n<p>DB Master\u306b\u969c\u5bb3\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001DB Slave\u3092Master\u306b\u6607\u683c(\u30d5\u30a7\u30fc\u30eb\u30aa\u30fc\u30d0\u30fc)\u3055\u305b\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nMySQL\u306e\u5834\u5408\u306f<\/p>\n<ul>\n<li>Master\u304b\u3089binary log events\u3092\u53d6\u5f97(\u53ef\u80fd\u3067\u3042\u308c\u3070)<\/li>\n<li>Slave\u7fa4\u304b\u3089\u6700\u65b0\u306e\u3082\u306e\u3092\u9078\u629e<\/li>\n<li>\u6700\u65b0\u306e\u30c7\u30fc\u30bf\u3092Slave\u9593\u3067\u540c\u671f<\/li>\n<li>Master\u304b\u3089\u53d6\u5f97\u3057\u305f\u30ed\u30b0\u3092\u9069\u5fdc\u3057\u3066Master\u306b\u6607\u683c\u3055\u305b\u308b<\/li>\n<\/ul>\n<p>\u3068\u3044\u3063\u305f\u4f5c\u696d\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3057\u3053\u308c\u3089\u306e\u4f5c\u696d\u306f\u8a00\u8449\u3067\u3044\u3046\u4ee5\u4e0a\u306b\u8907\u96d1\u306a\u51e6\u7406\u3068\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u3082\u3057\u65e2\u306b\u30d5\u30a7\u30fc\u30eb\u30aa\u30fc\u30d0\u30fc\u7528\u306e\u30c4\u30fc\u30eb\u3084\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u5b58\u5728\u3059\u308b\u306e\u3067\u3042\u308c\u3070\u3001Consul\u306b\u3088\u3063\u3066\u969c\u5bb3\u3092\u691c\u77e5\u3057\u3066\u3001<br \/>\n\u305d\u308c\u3089\u3092\u30d5\u30c3\u30af\u3057\u3066\u3042\u3052\u308b\u306e\u304c\u59a5\u5f53\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>Consul\u306b\u306f\u76e3\u8996\u5bfe\u8c61\u3092\u6307\u5b9a\u3057\u3066\u3001\u5909\u5316\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30d5\u30c3\u30af\u3059\u308b\u305f\u3081\u306ewatch\u3068\u3044\u3046\u30b3\u30de\u30f3\u30c9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"theme:github toolbar:2 striped:false marking:false ranges:false nums:false nums-toggle:false lang:sh highlight:0 decode:true \">$ consul watch -type service -service master.db \/user\/local\/bin\/mysql-failover.sh\r\n<\/pre>\n<p>\u306a\u304a<a href=\"https:\/\/code.google.com\/p\/mysql-master-ha\/\">MHA for MySQL<\/a>\u3092\u5229\u7528\u3059\u308b\u3068\u3001Consul\u306b\u3088\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30d5\u30c3\u30af\u3082\u4e0d\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001MHA\u306f\u30d5\u30a7\u30fc\u30eb\u30aa\u30fc\u30d0\u30fc\u304c\u5b8c\u4e86\u3057\u305f\u969b\u306b\u3001\u4efb\u610f\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30d5\u30c3\u30af\u3059\u308b\u4ed5\u7d44\u307f\u304c\u5099\u308f\u3063\u3066\u3044\u308b\u306e\u3067\u3001Consul\u306b\u5bfe\u3057\u3066\u65b0DB Master\u306e\u30b5\u30fc\u30d3\u30b9\u767b\u9332\u3092\u884c\u3046\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30d5\u30c3\u30af\u3059\u308b\u3088\u3046\u306b\u3059\u308c\u3070MHA\u3068Consul\u304c\u30b7\u30fc\u30e0\u30ec\u30b9\u306b\u9023\u643a\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<div style=\"text-align: center;\"><a href=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/finished.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-13102 size-medium alignnone\" src=\"http:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/finished-386x400.png\" alt=\"\" width=\"386\" height=\"400\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/finished-386x400.png 386w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/finished-193x200.png 193w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2014\/12\/finished.png 592w\" sizes=\"auto, (max-width: 386px) 100vw, 386px\" \/><\/a><br \/>\n\u6700\u7d42\u7684\u306a\u69cb\u6210<\/div>\n<h3>\u81ea\u52d5\u8ffd\u52a0\u306b\u5bfe\u3059\u308b\u4e0d\u5b89\u306e\u89e3\u6d88<\/h3>\n<p>\u904b\u7528\u3092\u81ea\u52d5\u5316\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001\"\u671f\u5f85\u901a\u308a\u306b\u52d5\u304f\u304b\u3069\u3046\u304b\" \u4e0d\u5b89\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u7279\u306bWeb\u30b5\u30fc\u30d3\u30b9\u3084DB Slave\u306e\u8ffd\u52a0\u306b\u95a2\u3057\u3066\u306f\u3001\u305d\u308c\u3089\u304c\u6b63\u5e38\u306b\u52d5\u3044\u3066\u3044\u308b\u304b\u62c5\u4fdd\u3057\u305f\u4e0a\u3067\u81ea\u52d5\u8ffd\u52a0\u3055\u308c\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3093\u306a\u4e0d\u5b89\u3092\u89e3\u6d88\u3059\u308b\u305f\u3081\u306bConsul\u306e\u6b7b\u6d3b\u76e3\u8996\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5185\u5bb9\u3092\u5de5\u592b\u3057\u3066\u307f\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070Web\u30b5\u30fc\u30d3\u30b9\u306e\u6b7b\u6d3b\u30c1\u30a7\u30c3\u30af\u304c<\/p>\n<ul>\n<li>Apache\u304c\u6b63\u5e38\u306b\u52d5\u3044\u3066\u3044\u308b<\/li>\n<\/ul>\n<p>\u3060\u3051\u3060\u3063\u305f\u3089\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\n\u5185\u90e8\u306ePHP\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u3069\u3046\u3067\u3042\u308c\u3001Apache\u3055\u305b\u6b63\u5e38\u306b\u52d5\u3044\u3066\u3044\u308c\u3070\u3001Web\u30b5\u30fc\u30d3\u30b9\u5168\u4f53\u304c\u6b63\u5e38\u3068\u307f\u306a\u3055\u308c\u3066HA Proxy\u914d\u4e0b\u306b\u7f6e\u304b\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067\u81ea\u52d5\u5316\u306e\u4e0d\u5b89\u306f<\/p>\n<ul>\n<li>Apache\u304c\u6b63\u5e38\u306b\u52d5\u3044\u3066\u3044\u308b<\/li>\n<li>PHP\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u6b63\u5e38\u306b\u52d5\u3044\u3066\u3044\u308b<\/li>\n<li>\u63a5\u7d9a\u3057\u3066\u3044\u308bMySQL\u304c\u6b63\u5e38\u306b\u52d5\u3044\u3066\u3044\u308b<\/li>\n<li>\u5404\u7a2e\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2(CPU, Memory, Disk\u306a\u3069)\u304c\u6b63\u5e38\u306b\u52d5\u3044\u3066\u3044\u308b<\/li>\n<\/ul>\n<p>\u306e\u3088\u3046\u306b\u3001\u3088\u308a\u53b3\u5bc6\u306b\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u3067\u89e3\u6d88\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u203b \u4e0a\u8a18\u4ee5\u5916\u306b\u3082\u30c1\u30a7\u30c3\u30af\u9805\u76ee\u306f\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u672c\u30a8\u30f3\u30c8\u30ea\u3067\u306f\u3001\u7c21\u5358\u306aWeb\u30b7\u30b9\u30c6\u30e0\u3092\u4f8b\u306b\u3068\u3063\u3066\u3001Consul\u3084\u305d\u306e\u5468\u8fba\u30c4\u30fc\u30eb\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3084\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u4ed5\u7d44\u307f\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u56de\u306f\u8a71\u3092\u5358\u7d14\u306b\u3059\u308b\u305f\u3081\u306b\u7c21\u5358\u306a\u4f8b\u3067\u8aac\u660e\u3057\u307e\u3057\u305f\u304c\u3001Consul\u306f\u6c4e\u7528\u7684\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308a\u3001\u69d8\u3005\u306a\u5229\u7528\u65b9\u6cd5\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u8eab\u306e\u56de\u308a\u3067\u624b\u4f5c\u696d\u306b\u3088\u308b\u904b\u7528\u3092\u884c\u3063\u3066\u3044\u308b\u90e8\u5206\u304c\u3042\u308c\u3070\u3001Consul\u3084\u305d\u306e\u5468\u8fba\u30c4\u30fc\u30eb(\u3082\u3057\u304f\u306fConsul\u4ee5\u5916\u306e\u30c4\u30fc\u30eb)\u306b\u3088\u3063\u3066\u89e3\u6c7a\u3067\u304d\u306a\u3044\u304b\u8003\u3048\u3066\u307f\u308b\u3068\u6848\u5916\u7c21\u5358\u306b\u51fa\u6765\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u672c\u30a8\u30f3\u30c8\u30ea\u3067\u4e16\u306e\u4e2d\u306e\u624b\u4f5c\u696d\u306b\u3088\u308b\u904b\u7528\u304c\u3072\u3068\u3064\u3067\u3082\u81ea\u52d5\u5316\u3067\u304d\u308b\u4e8b\u3092\u671f\u5f85\u3057\u3066\u3044\u307e\u3059\uff01<\/p>\n<p>\u660e\u65e5\u306e\u8a18\u4e8b\u306f\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u672c\u90e8\u306e\u5800\u53e3\u3055\u3093\u3067\u3059\u3002\u304a\u697d\u3057\u307f\u306b\uff01<\/p>\n<h2>\u95a2\u9023\u30ea\u30f3\u30af<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.consul.io\/\" target=\"_blank\">Consul<\/a><\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=eR0899h_1Ac\" target=\"_blank\">Consul: Service Oriented at Scale<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/progrium\/registrator\" target=\"_blank\">progrium\/registrator<\/a><\/li>\n<li><a href=\"http:\/\/www.slideshare.net\/zembutsu\/introduce-orchestration-serf-and-consul-presentation\" target=\"_blank\">Serf \/ Consul \u5165\u9580 \uff5e\u4ed5\u4e8b\u3092\u697d\u3057\u304f\u3057\u3088\u3046<\/a><\/li>\n<li><a href=\"https:\/\/hashicorp.com\/blog\/introducing-consul-template.html\" target=\"_blank\">Introducing Consul Template<\/a><\/li>\n<li><a href=\"http:\/\/ijin.github.io\/blog\/2014\/07\/11\/mysql-failover-with-consul\/\" target=\"_blank\">Consul\u306b\u3088\u308bMySQL\u30d5\u30a7\u30fc\u30eb\u30aa\u30fc\u30d0\u30fc<\/a><\/li>\n<li><a href=\"http:\/\/tech.kayac.com\/archive\/10_stretcher.html\" target=\"_blank\">#10 Consul\u3068\u9023\u643a\u3059\u308bpull\u578b\u30c7\u30d7\u30ed\u30a4\u30c4\u30fc\u30eb stretcher<\/a><\/li>\n<li><a href=\"http:\/\/philzim.com\/2014\/11\/12\/service-discovery-orchestration-with-mesos-and-consul\/\" target=\"_blank\">Service Discovery &amp; Orchestration With Mesos and Consul<\/a><\/li>\n<li><a href=\"http:\/\/www.slideshare.net\/IvanGlushkov\/zookeeper-vs-consul-41882991\" target=\"_blank\">Comparing ZooKeeper and Consul<\/a><\/li>\n<li><a href=\"http:\/\/qiita.com\/foostan\/items\/a679ffcf3e20ff2f6032\" target=\"_blank\">Docker\u30b3\u30f3\u30c6\u30ca\u3092Consul\u3067\u7ba1\u7406\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u672c\u90e8\u306e\u3042\u3060\u3061(@foostan)\u3067\u3059\u3002 \u3053\u306e\u30a8\u30f3\u30c8\u30ea\u306f GREE Advent Calendar 2014 19\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002\u6628\u65e5\u306f\u306b\u3057\u3060(@hosi_mo)\u3055\u3093\u306b\u3088\u308b\u30cd\u30a4\u30c6\u30a3\u30d6\u30b2\u30fc\u30e0\u30af [&hellip;]<\/p>\n","protected":false},"author":117,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[54,84,85],"class_list":["post-11959","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-advent-calendar","tag-consul","tag-85"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/11959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/users\/117"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/comments?post=11959"}],"version-history":[{"count":3,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/11959\/revisions"}],"predecessor-version":[{"id":13104,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/11959\/revisions\/13104"}],"wp:attachment":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/media?parent=11959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/categories?post=11959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/tags?post=11959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}