{"id":10412,"date":"2015-07-07T11:30:39","date_gmt":"2015-07-07T02:30:39","guid":{"rendered":"http:\/\/www.creationline.com\/?p=10412"},"modified":"2023-08-29T14:16:55","modified_gmt":"2023-08-29T05:16:55","slug":"chef-provisioning%e3%81%a8vagrant%e3%81%a7consul%e3%82%af%e3%83%a9%e3%82%b9%e3%82%bf%e7%92%b0%e5%a2%83%e3%82%92%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b-getchef-vagrant-consul","status":"publish","type":"post","link":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412","title":{"rendered":"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul"},"content":{"rendered":"<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u672c\u7a3f\u3067\u306f\u3001Chef Provisioning \u3068 Vagrant (VirtualBox) \u3092\u7528\u3044\u3066\u3001\u30c6\u30b9\u30c8\u7528\u306e Consul \u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002\u975e\u5e38\u306b\u7c21\u5358\u306a\u4f8b\u306a\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u5b9f\u74b0\u5883\u306b\u6d41\u7528\u3067\u304d\u308b\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u305f\u3060\u3001Chef Provisioning \u306e\u5229\u7528\u4f8b\u3084 consul \u30af\u30e9\u30b9\u30bf\u306e\u6319\u52d5\u3092\u3064\u304b\u3080\u306b\u306f\u5341\u5206\u3060\u3068\u601d\u3044\u307e\u3059\u3002\u672c\u7a3f\u3067\u4f7f\u7528\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u3059\u3079\u3066 <a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\">https:\/\/github.com\/cl-lab-k\/chef-consul-cluster<\/a> \u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>Consul\u3001Vagrant \u3068\u306f<\/h3>\n<p><a href=\"https:\/\/www.consul.io\/\">Consul<\/a> \u3068\u306f\u3001\u7c73 <a href=\"https:\/\/www.hashicorp.com\/\">HashiCorp<\/a> \u793e\u304c\u958b\u767a\u3059\u308b\u3001\u30b5\u30fc\u30d3\u30b9\u306e\u691c\u51fa\u3068\u8a2d\u5b9a\u3092\u884c\u3046\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3067\u3059\u3002\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30fb\u30b5\u30fc\u30d0\u578b\u306e\u69cb\u6210\u3067\u52d5\u4f5c\u3057\u3001\u30ad\u30fc\u30d0\u30ea\u30e5\u30fc\u30b9\u30c8\u30a2(KVS) \u306b\u4fdd\u6301\u3057\u305f\u30c7\u30fc\u30bf\u3092 DNS \u3084 HTTP \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u30b5\u30fc\u30d0\u306f\u305d\u308c\u305e\u308c\u304c\u30af\u30e9\u30b9\u30bf\u3092\u69cb\u6210\u3057\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u8d8a\u3057\u306b\u5225\u3005\u306e\u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u3092\u307e\u305f\u3044\u3067\u63a5\u7d9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.vagrantup.com\/\">Vagrant<\/a> \u3068\u306f\u3001\u3053\u3061\u3089\u3082\u7c73 HashiCorp \u793e\u304c\u958b\u767a\u3059\u308b\u3001\u4eee\u60f3\u74b0\u5883\u3092\u81ea\u52d5\u3067\u69cb\u7bc9\u3059\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002\u7c21\u5358\u306a\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u975e\u5e38\u306b\u624b\u8efd\u306b\u4eee\u60f3\u4eee\u60f3\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u53c2\u8003: <a href=\"\/news\/9272\">\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\u304c\u7c73\u56fdHashiCorp\u793e\u30d7\u30ed\u30c0\u30af\u30c8\u306e\u65e5\u672c\u56fd\u5185\u3067\u306e\u5c0e\u5165\u652f\u63f4\u4e8b\u696d\u3092\u958b\u59cb<\/a><\/li>\n<\/ul>\n<h3>Chef Provisioning\u3068\u306f<\/h3>\n<p><a href=\"https:\/\/docs.chef.io\/provisioning.html\">Chef Provisioning<\/a> (\u65e7\u79f0:Chef Metal) \u3068\u306f\u3001\u7c73 <a href=\"https:\/\/www.chef.io\/\">Chef<\/a> \u793e\u304c\u958b\u767a\u3059\u308b\u30af\u30e9\u30b9\u30bf\u7ba1\u7406\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002Chef \u306e Recipe \u3067\u30de\u30b7\u30f3\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u3068\u540c\u3058\u3088\u3046\u306b\u3001\u30af\u30e9\u30b9\u30bf\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u53c2\u8003: <a href=\"\/lab\/6410\">[\u548c\u8a33] Chef Provisioning (\u65e7Chef Metal): Infrastructure As Code<\/a><\/li>\n<\/ul>\n<h2>\u4e8b\u524d\u6e96\u5099<\/h2>\n<p>\u5b9f\u9a13\u306f Debian GNU\/Linux 8.1 \u4e0a\u3067\u884c\u3044\u307e\u3057\u305f\u3002\u4ee5\u4e0b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057<br \/>\n\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/downloads.chef.io\/chef-dk\/\">Chef-DK<\/a> 0.6.0<\/li>\n<li><a href=\"https:\/\/www.vagrantup.com\/\">Vagrant<\/a> 1.7.2\n<ul>\n<li>Vagrant \u30d7\u30e9\u30b0\u30a4\u30f3: <a href=\"https:\/\/github.com\/cogitatio\/vagrant-hostsupdater\">vagrant-hostsupdater<\/a> 0.0.11<\/li>\n<li>Vagrant \u30d7\u30e9\u30b0\u30a4\u30f3: <a href=\"https:\/\/github.com\/fgrehm\/vagrant-cachier\">vagrant-cachier<\/a> 1.2.0<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/www.virtualbox.org\/\">VirtualBox<\/a> 4.3.28<\/li>\n<\/ul>\n<h2>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u53d6\u5f97<\/h2>\n<p><a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/sample_blog\">https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/tree\/sample_blog<\/a> \u3092 clone \u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% git clone https:\/\/github.com\/cl-lab-k\/chef-consul-cluster -b sample_blog<br \/>\nCloning into 'chef-consul-cluster'...<br \/>\n:<br \/>\n% cd chef-consul-cluster<br \/>\n%<br \/>\n<\/code><\/p>\n<p>\u4ee5\u964d\u306f\u3053\u306e\u30c4\u30ea\u30fc\u5185\u3067\u4f5c\u696d\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<h2>Chef-Server VM \u306e\u4f5c\u6210<\/h2>\n<p>Chef Provisioning \u3092\u7528\u3044\u3066\u3001Chef-Server 12 \u7528\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<strong>provisioning\/chef-server<\/strong> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% cd provisioning\/chef-server<br \/>\n% ls -la<br \/>\n\u5408\u8a08 24<br \/>\ndrwxr-xr-x 2 d-higuchi d-higuchi 4096  6\u6708 12 11:57 .<br \/>\ndrwxr-xr-x 4 d-higuchi d-higuchi 4096  6\u6708 12 11:21 ..<br \/>\n-rw-r--r-- 1 d-higuchi d-higuchi   73  6\u6708 11 18:23 Berksfile<br \/>\n-rw-r--r-- 1 d-higuchi d-higuchi  405  6\u6708 12 11:24 Rakefile<br \/>\n-rw-r--r-- 1 d-higuchi d-higuchi  971  6\u6708 12 11:57 chef-server.rb<br \/>\n-rw-r--r-- 1 d-higuchi d-higuchi  181  6\u6708 12 11:25 destroy.rb<br \/>\n%<br \/>\n<\/code><\/p>\n<p>\u8a2d\u5b9a\u306f <a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/provisioning\/chef.json\">chef.json<\/a> \u30d5\u30a1\u30a4\u30eb\u3067\u884c\u3048\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u5909\u66f4\u3059\u308b\u5fc5\u8981\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u3002\u4e00\u9023\u306e\u4f5c\u696d\u306f\u57fa\u672c\u7684\u306b <strong>rake<\/strong> \u30bf\u30b9\u30af\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3042\u308a\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f <strong>berks vendor<\/strong> \u30b5\u30d6\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066 <a href=\"https:\/\/supermarket.chef.io\/cookbooks\/chef-server\">chef-server<\/a> Cookbook \u3092\u53d6\u5f97\u3057\u3001Chef Provisioning \u306b\u3088\u3063\u3066 Chef-Server 12 \u7528\u306e VirtualBox VM \u3092 Vagrant \u3067\u4f5c\u6210\u3057\u307e\u3059\u3002<a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/provisioning\/chef-server\/Rakefile\">Rakefile<\/a> \u3092\u898b\u3066\u306e\u901a\u308a\u3001Chef Provisioning \u306f Chef \u30ed\u30fc\u30ab\u30eb\u30e2\u30fc\u30c9\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059(<strong>chef-client -z<\/strong>)\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% rake<br \/>\nberks vendor cookbooks<br \/>\nResolving cookbook dependencies...<br \/>\nFetching cookbook index from https:\/\/supermarket.chef.io...<br \/>\nUsing chef-server (3.1.1)<br \/>\nUsing packagecloud (0.0.19)<br \/>\nUsing chef-server-ingredient (0.4.0)<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\nRunning handlers:<br \/>\nRunning handlers complete<br \/>\nChef Client finished, 1\/1 resources updated in 244.394462204 seconds<br \/>\n%<br \/>\n<\/code><\/p>\n<p>\u3053\u308c\u3067 <strong>https:\/\/chef-server.example.jp<\/strong> (192.168.33.10) \u306b Chef-Server 12 \u7528\u306e VM \u304c\u8d77\u52d5\u3057\u307e\u3057\u305f\u3002\u672c\u5b9f\u9a13\u3067\u306f\u5fc5\u8981\u306a\u3044\u305f\u3081\u3001<a href=\"https:\/\/docs.chef.io\/manage.html\">Chef Manage<\/a> \u30a2\u30c9\u30aa\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u306a\u3044\u306e\u3067 Web UI \u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2>Chef-Server \u306b\u30dd\u30ea\u30b7\u30fc\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9<\/h2>\n<p>Chef-Server \u306b User \u3068 Organization \u3092\u4f5c\u6210\u3057\u3001\u4e21\u8005\u306e\u9375\u3092\u53d6\u5f97\u3001<a href=\"https:\/\/docs.chef.io\/config_rb_knife.html\">knife.rb<\/a> \u3092\u4f5c\u6210\u3001<a href=\"https:\/\/docs.chef.io\/knife_ssl_fetch.html\">knife ssl fetch<\/a> \u3092\u5b9f\u884c\u3057\u3066\u9375\u53d6\u5f97(\u53c2\u8003: <a href=\"\/lab\/6644\">Chef 12\u306e\u65b0\u6a5f\u80fd: knife ssl check\/fetch<\/a>)\u3001berks vendor \u30b3\u30de\u30f3\u30c9\u3068 berks upload \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u5fc5\u8981\u306a Cookbook \u306e\u7fd2\u5f97\u3068\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3001Role \u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3092\u884c\u3044\u307e\u3059\u3002\u5404\u30dd\u30ea\u30b7\u30fc\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u5b9f\u969b\u306e\u30af\u30e9\u30b9\u30bf\u306e\u52d5\u4f5c\u306e\u8aac\u660e\u306e\u969b\u306b\u4f75\u305b\u3066\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u8a2d\u5b9a\u306f Chef-Server \u7528 VM \u306e\u5834\u5408\u3068\u540c\u3058\u304f <a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/provisioning\/chef.json\">chef.json<\/a> \u30d5\u30a1\u30a4\u30eb\u3067\u884c\u3048\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u5909\u66f4\u3059\u308b\u5fc5\u8981\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u3002<a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/roles\/chef-consul-cluster-base.json\">roles\/chef-consul-cluster-base.json<\/a> \u306f\u3001HashiCorp \u793e\u304c\u63d0\u4f9b\u3059\u308b\u3055\u307e\u3056\u307e\u306a\u30c4\u30fc\u30eb\u3092\u7d71\u5408\u3057\u305f\u30a4\u30f3\u30d5\u30e9\u7ba1\u7406\u30b5\u30fc\u30d3\u30b9\u3067\u3042\u308b <a href=\"https:\/\/atlas.hashicorp.com\/\">Atlas<\/a> \u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u60c5\u5831\u3092\u8a18\u8f09\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u3092\u7528\u3044\u3066\u81ea\u52d5\u7684\u306b Consul \u30af\u30e9\u30b9\u30bf\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002\u8a73\u3057\u304f\u306f <a href=\"\/lab\/10353\">Consul\u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u69cb\u6210\u624b\u9806\u306e\u6b74\u53f2<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u3061\u3089\u3082\u4f5c\u696d\u306f <strong>rake<\/strong> \u30bf\u30b9\u30af\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3042\u308a\u307e\u3059\u3002\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30c8\u30c3\u30d7\u306b\u623b\u308a\u3001<strong>rake config<\/strong> \u3068\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% rake config<br \/>\nssh -i ~\/.chef\/vms\/.vagrant\/machines\/chef-server\/virtualbox\/private_key vagrant@chef-server.example.jp 'sudo chef-server-ctl user-create testuser TEST USER testuser@example.jp<br \/>\ntestpswd --filename testuser.pem'<br \/>\nscp -i ~\/.chef\/vms\/.vagrant\/machines\/chef-server\/virtualbox\/private_key vagrant@chef-server.example.jp:testuser.pem \/tmp\/chef-serf-cluster\/provisioning\/vms\/..\/..\/.chef\/testuser.pem<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\nknife role from file roles\/chef-consul-cluster-*.json<br \/>\nUpdated Role chef-consul-cluster-client!<br \/>\nUpdated Role chef-consul-cluster-lb!<br \/>\nUpdated Role chef-consul-cluster-server!<br \/>\n%<br \/>\n<\/code><\/p>\n<h2>\u30af\u30e9\u30b9\u30bf\u7528 VM \u306e\u4f5c\u6210<\/h2>\n<p>\u3053\u3053\u3067\u306f\u6b21\u306e VM \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>Consul \u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u7528 VM ... 3\u53f0<\/li>\n<li>Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8 + Nginx \u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u7528 VM ... 2\u53f0<\/li>\n<li>Nginx \u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u7528 VM ... 1\u53f0<\/li>\n<\/ul>\n<p>\u8a08 6\u53f0\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Consul \u306f Serf \u3068\u7570\u306a\u308a\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30fb\u30b5\u30fc\u30d0\u69cb\u6210\u3092\u53d6\u308a\u307e\u3059\u3002\u307e\u305f\u3001Consul \u30b5\u30fc\u30d0\u306f\u30af\u30e9\u30b9\u30bf\u3068\u3057\u3066\u52d5\u4f5c\u3057\u307e\u3059\u30021\u53f0\u3067\u3082\u52d5\u4f5c\u3057\u307e\u3059\u304c\u3001\u5197\u9577\u6027\u30fb\u8010\u969c\u5bb3\u6027\u3092\u9ad8\u3081\u308b\u305f\u3081\u306b 3\u53f0\u3042\u308b\u3044\u306f 5\u53f0\u3067\u306e\u904b\u7528\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059(\u53c2\u8003: <a href=\"https:\/\/www.consul.io\/docs\/internals\/consensus.html#deployment_table\">Deployment Table<\/a>)\u3002\u3053\u3053\u3067\u306f 3\u53f0\u306e Consul \u30b5\u30fc\u30d0\u306b\u3088\u308b\u30af\u30e9\u30b9\u30bf\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b Serf \u3068\u7570\u306a\u308b\u70b9\u3068\u3057\u3066\u3001Consul \u306f\u30b5\u30fc\u30d3\u30b9\u306e\u76e3\u8996\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Serf \u3067\u306f Serf \u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u304c\u8d77\u52d5\u3057\u3066\u3044\u308b\u304b\u505c\u6b62\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u304c\u4e3b\u8981\u306a\u30c8\u30ea\u30ac\u30fc\u3067\u3057\u305f\u3002Consul \u3067\u306f\u3001Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u5b9a\u7fa9\u5185\u5bb9\u306b\u5f93\u3063\u3066\u884c\u3046\u30b5\u30fc\u30d3\u30b9\u306e\u6b7b\u6d3b\u76e3\u8996\u304c\u30c8\u30ea\u30ac\u30fc\u3068\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f\u751f\u304d\u3066\u3044\u308b\u304c\u30b5\u30fc\u30d3\u30b9\u306e\u5fdc\u7b54\u304c\u306a\u3044\u3001\u3068\u3044\u3046\u3088\u3046\u306a\u72b6\u614b\u3092\u77e5\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u81ea\u30de\u30b7\u30f3\u4e0a\u306e Nginx \u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u306e\u6b7b\u6d3b\u76e3\u8996\u3092\u884c\u3046\u3053\u3068\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>Nginx \u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u306f Consul \u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u306b\u554f\u3044\u5408\u308f\u305b\u3092\u884c\u3044\u3001\u305d\u306e\u7d50\u679c\u3092\u5229\u7528\u3057\u3066 2\u53f0\u3042\u308b Nginx \u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u3078\u306e\u632f\u308a\u5206\u3051\u3092\u884c\u3044\u307e\u3059\u3002Consul \u306f\u30ad\u30fc\u30d0\u30ea\u30e5\u30fc\u30b9\u30c8\u30a2\u6a5f\u80fd\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u3001Web UI\u3001HTTP\u3001DNS \u3067\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f DNS \u3092\u7528\u3044\u3066 Consul \u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u3078\u306e\u554f\u3044\u5408\u308f\u305b\u3092\u884c\u3046\u3053\u3068\u3068\u3057\u307e\u3059\u3002<\/p>\n<p><strong>provisioning\/vms<\/strong> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% cd provisioning\/vms<br \/>\n\u5408\u8a08 16<br \/>\ndrwxr-xr-x 2 d-higuchi d-higuchi 4096  6\u6708 24 16:23 .<br \/>\ndrwxr-xr-x 4 d-higuchi d-higuchi 4096  6\u6708 12 11:21 ..<br \/>\n-rw-r--r-- 1 d-higuchi d-higuchi  620  6\u6708 19 12:55 Rakefile<br \/>\n-rw-r--r-- 1 d-higuchi d-higuchi 1828  6\u6708 24 16:23 vms.rb<br \/>\n%<br \/>\n<\/code><\/p>\n<p>\u8a2d\u5b9a\u306f\u3084\u306f\u308a <a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/provisioning\/chef.json\">chef.json<\/a> \u30d5\u30a1\u30a4\u30eb\u3067\u884c\u3048\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u5909\u66f4\u3059\u308b\u5fc5\u8981\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u3002<br \/>\n\u3053\u3061\u3089\u3082\u4f5c\u696d\u306f <strong>rake<\/strong> \u30bf\u30b9\u30af\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3042\u308a\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f Chef Provisioning \u306b\u3088\u3063\u3066\u30af\u30e9\u30b9\u30bf\u7528\u306e VirtualBox VM \u3092 Vagrant \u3067 6\u53f0\u4f5c\u6210\u3057\u307e\u3059\u3002\u4f5c\u6210\u3057\u305f Serf \u30ce\u30fc\u30c9\u7528 VM \u306e Node Object \u306f Chef-Server 12 \u306b\u767b\u9332\u3055\u308c\u3001\u5148\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u3042\u3063\u305f\u30dd\u30ea\u30b7\u30fc\u3092\u9069\u7528\u3057\u3066\u53ce\u675f\u3092\u884c\u3044\u307e\u3059\u3002<a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/provisioning\/vms\/Rakefile\">Rakefile<\/a> \u3067\u306f Chef Provisioning \u306f Chef \u30ed\u30fc\u30ab\u30eb\u30e2\u30fc\u30c9\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059(<strong>chef-client -z<\/strong>)\u304c\u3001\u3053\u308c\u306f\u3042\u304f\u307e\u3067 Chef Provisioning \u304c\u5fc5\u8981\u3068\u3057\u3066\u3044\u308b\u3082\u306e\u306a\u306e\u3067\u3001\u6df7\u540c\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u540c\u3058\u3088\u3046\u306a\u591a\u6570\u306e VM \u3092\u8d77\u52d5\u3059\u308b\u305f\u3081\u3001vagrant-cachier \u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u7528\u3044\u3066\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u3001\u5c11\u3057\u3067\u3082\u304b\u304b\u308b\u6642\u9593\u3092\u77ed\u304f\u3057\u3088\u3046\u3068\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% rake<br \/>\nCHEF_DRIVER=vagrant chef-client -z vms.rb<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\nRunning handlers:<br \/>\nRunning handlers complete<br \/>\nChef Client finished, 6\/6 resources updated in 1040.9932162979999 seconds<br \/>\n<\/code><\/p>\n<ul>\n<li>192.168.33.101 (srv101, Consul \u30b5\u30fc\u30d0 1)<\/li>\n<li>192.168.33.102 (srv102, Consul \u30b5\u30fc\u30d0 2)<\/li>\n<li>192.168.33.103 (srv103, Consul \u30b5\u30fc\u30d0 3)<\/li>\n<li>192.168.33.201 (node201, Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8 1)<\/li>\n<li>192.168.33.202 (node202, Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8 2)<\/li>\n<li>192.168.33.211 (lb211, \u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5)<\/li>\n<\/ul>\n<p>\u306e 6\u53f0\u306e\u30af\u30e9\u30b9\u30bf\u7528 VM \u304c\u8d77\u52d5\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u672c\u5b9f\u9a13\u3067\u306f <a href=\"https:\/\/github.com\/cogitatio\/vagrant-hostsupdater\">vagrant-hostsupdater<\/a> \u3092\u7528\u3044\u3066\u3001\u30db\u30b9\u30c8\u5074\u306e \/etc\/hosts \u3092\u66f4\u65b0\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% tail -8 \/etc\/hosts<br \/>\n192.168.33.10  chef-server  # VAGRANT: 001f4c711f6f0fe6cb9c2fbe9deff7f9 (chef-server) \/ 335c6551-df64-4875-abaf-93bdab933ddb<br \/>\n192.168.33.10  chef-server.example.jp  # VAGRANT: 001f4c711f6f0fe6cb9c2fbe9deff7f9 (chef-server) \/ 335c6551-df64-4875-abaf-93bdab933ddb<br \/>\n192.168.33.101  srv101  # VAGRANT: f84444817f9ea53b0146d36b798032b2 (srv101) \/ eb4242da-9ec0-4649-a029-a4b610e7aebd<br \/>\n192.168.33.102  srv102  # VAGRANT: 87ae7195da722db43fcfafd9e4116a40 (srv102) \/ 50a467b9-2f30-4a95-931c-41ac3cb39490<br \/>\n192.168.33.103  srv103  # VAGRANT: 9bb557abb97848f38ea26d613b17839f (srv103) \/ e8381324-69b8-43a0-9cba-e08c4721d5f6<br \/>\n192.168.33.201  node201  # VAGRANT: 51bfdec166295f56b51d8aac2d0f2178 (node201) \/ 2f9689b8-3791-4ba6-ae65-30b75ab4e814<br \/>\n192.168.33.202  node202  # VAGRANT: bebe23337a2616c382d13cfe7c0a4ae6 (node202) \/ 4bf047d4-6359-4505-8acb-a4e60377ee55<br \/>\n192.168.33.211  lb211  # VAGRANT: 88fc4c9b4e629ed1288eb21c473ed89c (lb211) \/ 00185a52-8f7c-4f5a-83c4-3a60473c869a<br \/>\n%<br \/>\n<\/code><\/p>\n<h2>\u30af\u30e9\u30b9\u30bf\u306e\u52d5\u4f5c<\/h2>\n<p><!-- chef-consul-cluster-overview.png \/\/--><a href=\"\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10413\" src=\"\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview.png\" alt=\"chef-consul-cluster-overview\" width=\"605\" height=\"236\" srcset=\"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview.png 605w, https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview-360x140.png 360w, https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview-225x88.png 225w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/a><\/p>\n<p>\u3053\u306e\u30af\u30e9\u30b9\u30bf\u69cb\u6210\u56f3\u3067\u793a\u3055\u308c\u308b\u3001\u5404\u30de\u30b7\u30f3\u306e\u5f79\u5272\u3068\u52d5\u4f5c\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>Consul \u30b5\u30fc\u30d0<\/h3>\n<p>Consul \u30b5\u30fc\u30d0\u306f <a href=\"https:\/\/supermarket.chef.io\/cookbooks\/consul\">consul<\/a> Cookbook \u3092\u9069\u7528\u3057\u3066\u3044\u307e\u3059\u3002Atlas \u306b\u3088\u308b\u81ea\u52d5\u30af\u30e9\u30b9\u30bf\u69cb\u7bc9\u3092\u5229\u7528\u3057\u30013\u53f0\u306e Consul \u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u3092\u69cb\u7bc9\u3057\u3066\u3044\u307e\u3059\u3002\u8a73\u3057\u304f\u306f <a href=\"\/lab\/10353\">Consul\u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u69cb\u6210\u624b\u9806\u306e\u6b74\u53f2<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u307e\u305f\u3001Web UI\u3001HTTP\u3001DNS \u306e\u5404\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u30d1\u30d6\u30ea\u30c3\u30af\u306b\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<strong>\u30a2\u30af\u30bb\u30b9\u5236\u9650\u3084\u6697\u53f7\u5316\u3092\u884c\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u30d1\u30d6\u30ea\u30c3\u30af\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u5411\u3051\u3066\u3053\u306e\u307e\u307e\u6d41\u7528\u3057\u306a\u3044\u3067\u304f\u3060\u3055\u3044<\/strong>\u3002<\/p>\n<h3>Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8 + Nginx \u30a6\u30a7\u30d6\u30b5\u30fc\u30d0<\/h3>\n<p>Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f\u30b5\u30fc\u30d0\u3068\u540c\u69d8 <a href=\"https:\/\/supermarket.chef.io\/cookbooks\/consul\">consul<\/a> Cookbook \u3092\u9069\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u3061\u3089\u3082 Atlas \u306b\u3088\u308b\u81ea\u52d5\u30af\u30e9\u30b9\u30bf\u69cb\u7bc9\u3092\u5229\u7528\u3057\u3001\u81ea\u52d5\u7684\u306b\u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u306b\u53c2\u52a0\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/recipes\/web.rb\">chef-consul-cluster::web<\/a> Recipe \u3067\u306f <a href=\"https:\/\/supermarket.chef.io\/cookbooks\/nginx\">nginx<\/a> Cookbook \u3092\u9069\u7528\u3057\u3066\u306e Nginx \u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u306e\u8a2d\u5b9a\u3068\u3001Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u76e3\u8996\u3092\u884c\u3046\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f <strong>script<\/strong> \u3067\u6307\u5b9a\u3057\u305f\u30b3\u30de\u30f3\u30c9\u3092 <strong>interval<\/strong> \u3067\u6307\u5b9a\u3057\u305f\u9593\u9694\u3067\u5b9f\u884c\u3057\u3001\u8fd4\u308a\u5024\u306b\u3088\u3063\u3066\u6b7b\u6d3b\u76e3\u8996\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<h3>Nginx \u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5<\/h3>\n<p>Nginx \u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u306f\u3001Consul \u30b5\u30fc\u30d0\u3082 Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3082\u5b9f\u884c\u3057\u3066\u3044\u307e\u305b\u3093\u3002<a href=\"https:\/\/supermarket.chef.io\/cookbooks\/dnsmasq\">dnsmasq<\/a> Cookbook \u3092\u9069\u7528\u3057\u3066\u8a2d\u5b9a\u3057\u305f dnsmasq \u3092\u901a\u3057\u3066 Consul \u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u306b DNS \u554f\u3044\u5408\u308f\u305b\u3092\u884c\u3044\u3001\u305d\u306e\u7d50\u679c\u3067\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u306e\u632f\u308a\u5206\u3051\u3092\u884c\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u4e00\u4f53\u3069\u3046\u3044\u3046\u3053\u3068\u3067\u3057\u3087\u3046\u304b\u3002\u7406\u5c48\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a <a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/roles\/chef-consul-cluster-lb.json\">chef-consul-cluster-lb<\/a> Role \u306b\u3066\u3001dnsmasq \u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f <strong>consul<\/strong> \u3068\u3044\u3046\u30c9\u30e1\u30a4\u30f3\u3078\u306e\u554f\u3044\u5408\u308f\u305b\u306f Consul \u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u306b\u5bfe\u3057\u3066 DNS \u554f\u3044\u5408\u308f\u305b\u3092\u884c\u3046\u3068\u3044\u3046\u8a2d\u5b9a\u3067\u3059\u3002\u6b21\u306b <a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/recipes\/lb.rb\">lb<\/a> Recipe \u3067\u306f\u3001<strong>web.service.consul<\/strong> \u3092\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u3068\u306a\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Consul \u304b\u3089 DNS \u3067\u30af\u30e9\u30b9\u30bf\u306e\u72b6\u6cc1\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u3001<strong>consul<\/strong> \u3068\u3044\u3046\u30c9\u30e1\u30a4\u30f3\u3092\u901a\u3057\u3066\u554f\u3044\u5408\u308f\u305b\u3092\u884c\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001<strong>srv101<\/strong> \u3068\u3044\u3046\u30db\u30b9\u30c8\u306e IP \u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<strong>8600<\/strong> \u306f Consul \u304c\u63d0\u4f9b\u3059\u308b DNS \u30b5\u30fc\u30d0\u306e\u30dd\u30fc\u30c8\u756a\u53f7\u3067\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% dig @192.168.33.101 -p 8600 srv101.node.consul<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">; &lt;&lt;&gt;&gt; DiG 9.9.5-9-Debian &lt;&lt;&gt;&gt; @192.168.33.101 -p 8600 srv101.node.consul<br \/>\n; (1 server found)<br \/>\n;; global options: +cmd<br \/>\n;; Got answer:<br \/>\n;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 34476<br \/>\n;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0<br \/>\n;; WARNING: recursion requested but not available<\/p>\n<p>;; QUESTION SECTION:<br \/>\n;srv101.node.consul.\t\tIN\tA<\/p>\n<p>;; ANSWER SECTION:<br \/>\nsrv101.node.consul.\t0\tIN\tA\t192.168.33.101<\/p>\n<p>;; Query time: 2 msec<br \/>\n;; SERVER: 192.168.33.101#8600(192.168.33.101)<br \/>\n;; WHEN: Thu Jun 25 18:32:46 JST 2015<br \/>\n;; MSG SIZE  rcvd: 70<br \/>\n<\/code><\/p>\n<p>\u5148\u306b Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3067\u306f\u3001<a href=\"https:\/\/github.com\/cl-lab-k\/chef-consul-cluster\/blob\/sample_blog\/recipes\/web.rb\">chef-consul-cluster::web<\/a> Recipe \u3067\u30b5\u30fc\u30d3\u30b9\u306e\u5b9a\u7fa9\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u30b5\u30fc\u30d3\u30b9\u306e\u540d\u524d\u306f <strong>name<\/strong> \u3067\u6307\u5b9a\u3057\u3001\u3053\u3053\u3067\u306f <strong>web<\/strong> \u3068\u3057\u3066\u3044\u307e\u3059\u3002<strong>web<\/strong> \u30b5\u30fc\u30d3\u30b9\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b Consul \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e IP \u30a2\u30c9\u30ec\u30b9\u3092\u3059\u3079\u3066\u53d6\u5f97\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% dig @192.168.33.101 -p 8600 web.service.consul<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">; &lt;&lt;&gt;&gt; DiG 9.9.5-9-Debian &lt;&lt;&gt;&gt; @192.168.33.101 -p 8600 web.service.consul<br \/>\n; (1 server found)<br \/>\n;; global options: +cmd<br \/>\n;; Got answer:<br \/>\n;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 12164<br \/>\n;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0<br \/>\n;; WARNING: recursion requested but not available<\/p>\n<p>;; QUESTION SECTION:<br \/>\n;web.service.consul.\t\tIN\tA<\/p>\n<p>;; ANSWER SECTION:<br \/>\nweb.service.consul.\t0\tIN\tA\t192.168.33.202<br \/>\nweb.service.consul.\t0\tIN\tA\t192.168.33.201<\/p>\n<p>;; Query time: 2 msec<br \/>\n;; SERVER: 192.168.33.101#8600(192.168.33.101)<br \/>\n;; WHEN: Thu Jun 25 18:35:11 JST 2015<br \/>\n;; MSG SIZE  rcvd: 104<br \/>\n<\/code><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001<strong>node201<\/strong> \u3068 <strong>node202<\/strong> \u306e IP \u30a2\u30c9\u30ec\u30b9\u304c\u53d6\u5f97\u3067\u304d\u307e\u3057\u305f\u3002\u3082\u3046\u304a\u308f\u304b\u308a\u3067\u3057\u3087\u3046\u3002<strong>web.service.consul<\/strong> \u306b\u5bfe\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001Consul \u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u306b DNS \u554f\u3044\u5408\u308f\u305b\u304c\u884c\u308f\u308c\u3001<strong>node201<\/strong> \u3068 <strong>node202<\/strong> \u306e IP \u30a2\u30c9\u30ec\u30b9\u304c\u5f97\u3089\u308c\u3001\u305d\u306e\u3069\u3061\u3089\u304b\u306b\u5b9f\u969b\u306e\u30a2\u30af\u30bb\u30b9\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u3082\u3057\u30b5\u30fc\u30d3\u30b9\u304c\u505c\u6b62\u3057\u305f\u5834\u5408\u3001DNS \u306e\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u305d\u306e\u30ce\u30fc\u30c9\u306f\u53d6\u308a\u9664\u304b\u308c\u307e\u3059\u3002<\/p>\n<h2>\u5b9f\u969b\u306e\u52d5\u4f5c<\/h2>\n<p>\u3067\u306f\u3001\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<strong>curl<\/strong> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"html\"><br \/>\n% curl http:\/\/lb211\/<br \/>\n<\/code><\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node202<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node202<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node202<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node202<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node202<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><br \/>\n<\/code><\/p>\n<p><code lang=\"html\"><br \/>\n%<br \/>\n<\/code><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3073\u306b\u3001\u8fd4\u3063\u3066\u304f\u308b\u5024\u304c\u7570\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n<strong>dig<\/strong> \u30b3\u30de\u30f3\u30c9\u3067 DNS \u3082\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n192.168.33.202<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.202<br \/>\n192.168.33.201<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n192.168.33.202<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.202<br \/>\n192.168.33.201<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n192.168.33.202<br \/>\n%<br \/>\n<\/code><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b node201 \u3068 node202 \u304c\u4ea4\u4e92\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u60f3\u5b9a\u901a\u308a\u306b\u52d5\u4f5c\u3057\u3066\u3044\u308b\u3068\u8a00\u3063\u3066\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3053\u3053\u3067\u3001node202 \u5074\u306e Nginx \u3092\u505c\u6b62\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@node202:~$ sudo service nginx stop<br \/>\nvagrant@node202:~$<br \/>\n<\/code><\/p>\n<p>\u518d\u3073 curl \u30b3\u30de\u30f3\u30c9\u3067\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code lang=\"html\"><br \/>\n% curl http:\/\/lb211\/<br \/>\n<\/code><\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><br \/>\n<\/code><\/p>\n<p><code lang=\"html\"><br \/>\n%<br \/>\n<\/code><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b node201 \u3057\u304b\u8fd4\u3063\u3066\u3053\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002dig \u30b3\u30de\u30f3\u30c9\u3067 DNS \u3082\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n%<br \/>\n<\/code><\/p>\n<p>\u3084\u306f\u308a node201 \u3057\u304b\u8fd4\u3089\u306a\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u60f3\u5b9a\u3057\u305f\u901a\u308a\u306e\u52d5\u4f5c\u3067\u3059\u3002<\/p>\n<p>node202 \u306e Nginx \u3092\u8d77\u52d5\u3057\u3001curl \u30b3\u30de\u30f3\u30c9\u3068 dig \u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@node202:~$ sudo service nginx start<br \/>\nvagrant@node202:~$<br \/>\n<\/code><\/p>\n<p><code lang=\"html\"><br \/>\n% curl http:\/\/lb211\/<br \/>\n<\/code><\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node202<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node202<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node201<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p>% curl http:\/\/lb211\/<\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>node202<\/h1>\n<p><code lang=\"html\"><br \/>\n<\/code><\/p>\n<p><code lang=\"html\"><br \/>\n%<br \/>\n<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n192.168.33.202<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.202<br \/>\n192.168.33.201<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n192.168.33.202<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.202<br \/>\n192.168.33.201<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.201<br \/>\n192.168.33.202<br \/>\n% dig @srv101 -p 8600 web.service.consul +short<br \/>\n192.168.33.202<br \/>\n192.168.33.201<br \/>\n<\/code><\/p>\n<p>\u518d\u3073 node202 \u3082\u8fd4\u3063\u3066\u304f\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f node202 \u306e Nginx \u3092\u505c\u6b62\u3057\u305f\u3060\u3051\u3067\u3059\u304c\u3001node202 \u306e Consul \u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u505c\u6b62\u3057\u305f\u308a\u3001node202 \u306e\u30de\u30b7\u30f3\u305d\u306e\u3082\u306e\u3092\u505c\u6b62\u3057\u3066\u3082\u540c\u69d8\u306e\u7d50\u679c\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u672c\u7a3f\u3067\u306f\u3001Chef Provisioning \u3068 Vagrant (VirtualBox) \u3092\u7528\u3044\u3066\u3001\u30c6\u30b9\u30c8\u7528\u306e Consul \u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u305f\u3002Chef Provisioning \u3092\u4f7f\u3063\u305f Chef-Server\/Client \u74b0\u5883\u306e\u4f5c\u6210\u3001Consul \u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u52d5\u4f5c\u3068\u6d3b\u7528\u4f8b\u306b\u3064\u3044\u3066\u3001\u6982\u8981\u3092\u3064\u304b\u3093\u3067\u3044\u305f\u3060\u3051\u305f\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u672c\u5b9f\u9a13\u3067\u306f Chef \u306f Consul \u30af\u30e9\u30b9\u30bf\u74b0\u5883\u306e\u4f5c\u6210\u306e\u307f\u306b\u4f7f\u3044\u3001\u305d\u306e\u5f8c\u306e\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u306e\u5909\u66f4\u306b\u306f\u7528\u3044\u3066\u3044\u307e\u305b\u3093\u3002Consul \u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3068 Chef Client \u306e\u7d44\u307f\u5408\u308f\u305b\u306f\u4eca\u5f8c\u306e\u8ab2\u984c\u3067\u3059\u3002<\/p>\n<h3>\u53c2\u8003\u6587\u732e<\/h3>\n<h4>\u95a2\u9023\u8a18\u4e8b<\/h4>\n<ul>\n<li><a href=\"\/lab\/10270\">Chef Provisioning\u3068Vagrant\u3067Serf\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b<\/a><\/li>\n<li><a href=\"\/lab\/10353\">Consul\u30b5\u30fc\u30d0\u30af\u30e9\u30b9\u30bf\u69cb\u6210\u624b\u9806\u306e\u6b74\u53f2<\/a><\/li>\n<\/ul>\n<h4>Consul<\/h4>\n<ul>\n<li><a href=\"http:\/\/gihyo.jp\/admin\/feature\/01\/serf-consul\">Serf\uff0fConsul\u3067\u7ba1\u7406\u3092\u81ea\u52d5\u5316\uff01\u3000\uff5e\u5b9f\u8df5\u7684\u306a\u624b\u6cd5\u3092\u7d39\u4ecb\uff5e<\/a><\/li>\n<li><a href=\"http:\/\/pocketstudio.jp\/log3\/archives\/consul\/\">Consul | Pocketstudio.jp log3<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f\u3001Chef Provisioning \u3068 Vagrant (VirtualBox) \u3092\u7528\u3044\u3066\u3001\u30c6\u30b9\u30c8\u7528\u306e Consul \u30af\u30e9\u30b9\u30bf\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002\u975e\u5e38\u306b\u7c21\u5358\u306a\u4f8b\u306a\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u5b9f\u74b0\u5883\u306b\u6d41\u7528\u3067\u304d\u308b\u3082\u306e\u3067\u306f [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":10413,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[36,31,42],"tags":[],"class_list":["post-10412","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chef","category-higuchi","category-hashicorp"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3<\/title>\n<meta name=\"description\" content=\"Chef, d-higuchi, HashiCorp |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f\u3001Chef Provisioning \u3068 Vagrant (VirtualBox) \u3092\u7528\u3044\u3066\u3001\u30c6\u30b9\u30c8\u7528\u306e Consul\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"og:description\" content=\"Chef, d-higuchi, HashiCorp |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f\u3001Chef Provisioning \u3068 Vagrant (VirtualBox) \u3092\u7528\u3044\u3066\u3001\u30c6\u30b9\u30c8\u7528\u306e Consul\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412\" \/>\n<meta property=\"og:site_name\" content=\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/creationline\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-07T02:30:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-29T05:16:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview.png\" \/>\n\t<meta property=\"og:image:width\" content=\"605\" \/>\n\t<meta property=\"og:image:height\" content=\"236\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Daisuke Higuchi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@creationline\" \/>\n<meta name=\"twitter:site\" content=\"@creationline\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daisuke Higuchi\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412\"},\"author\":{\"name\":\"Daisuke Higuchi\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"headline\":\"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul\",\"datePublished\":\"2015-07-07T02:30:39+00:00\",\"dateModified\":\"2023-08-29T05:16:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412\"},\"wordCount\":408,\"image\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/chef-consul-cluster-overview.png\",\"articleSection\":[\"Chef\",\"d-higuchi\",\"HashiCorp\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412\",\"name\":\"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/chef-consul-cluster-overview.png\",\"datePublished\":\"2015-07-07T02:30:39+00:00\",\"dateModified\":\"2023-08-29T05:16:55+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"description\":\"Chef, d-higuchi, HashiCorp |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f\u3001Chef Provisioning \u3068 Vagrant (VirtualBox) \u3092\u7528\u3044\u3066\u3001\u30c6\u30b9\u30c8\u7528\u306e Consul\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412#primaryimage\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/chef-consul-cluster-overview.png\",\"contentUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/chef-consul-cluster-overview.png\",\"width\":605,\"height\":236},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10412#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"HOME\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Chef\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/\",\"name\":\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"description\":\"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\",\"name\":\"Daisuke Higuchi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"contentUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"caption\":\"Daisuke Higuchi\"},\"description\":\"Chef\u30fbDocker\u30fbMirantis\u88fd\u54c1\u306a\u3069\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"Chef, d-higuchi, HashiCorp |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f\u3001Chef Provisioning \u3068 Vagrant (VirtualBox) \u3092\u7528\u3044\u3066\u3001\u30c6\u30b9\u30c8\u7528\u306e Consul","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412","og_locale":"ja_JP","og_type":"article","og_title":"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","og_description":"Chef, d-higuchi, HashiCorp |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f\u3001Chef Provisioning \u3068 Vagrant (VirtualBox) \u3092\u7528\u3044\u3066\u3001\u30c6\u30b9\u30c8\u7528\u306e Consul","og_url":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412","og_site_name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","article_publisher":"https:\/\/www.facebook.com\/creationline","article_published_time":"2015-07-07T02:30:39+00:00","article_modified_time":"2023-08-29T05:16:55+00:00","og_image":[{"width":605,"height":236,"url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview.png","type":"image\/png"}],"author":"Daisuke Higuchi","twitter_card":"summary_large_image","twitter_creator":"@creationline","twitter_site":"@creationline","twitter_misc":{"\u57f7\u7b46\u8005":"Daisuke Higuchi","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"5\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412#article","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412"},"author":{"name":"Daisuke Higuchi","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"headline":"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul","datePublished":"2015-07-07T02:30:39+00:00","dateModified":"2023-08-29T05:16:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412"},"wordCount":408,"image":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412#primaryimage"},"thumbnailUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview.png","articleSection":["Chef","d-higuchi","HashiCorp"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412","url":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412","name":"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412#primaryimage"},"image":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412#primaryimage"},"thumbnailUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview.png","datePublished":"2015-07-07T02:30:39+00:00","dateModified":"2023-08-29T05:16:55+00:00","author":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"description":"Chef, d-higuchi, HashiCorp |\u306f\u3058\u3081\u306b \u672c\u7a3f\u3067\u306f\u3001Chef Provisioning \u3068 Vagrant (VirtualBox) \u3092\u7528\u3044\u3066\u3001\u30c6\u30b9\u30c8\u7528\u306e Consul","breadcrumb":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412#primaryimage","url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview.png","contentUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2015\/06\/chef-consul-cluster-overview.png","width":605,"height":236},{"@type":"BreadcrumbList","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10412#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"HOME","item":"https:\/\/www.creationline.com\/tech-blog"},{"@type":"ListItem","position":2,"name":"\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6","item":"https:\/\/www.creationline.com\/tech-blog\/cloudnative"},{"@type":"ListItem","position":3,"name":"Chef","item":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef"},{"@type":"ListItem","position":4,"name":"Chef Provisioning\u3068Vagrant\u3067Consul\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b #getchef #vagrant #consul"}]},{"@type":"WebSite","@id":"https:\/\/www.creationline.com\/tech-blog\/#website","url":"https:\/\/www.creationline.com\/tech-blog\/","name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.creationline.com\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206","name":"Daisuke Higuchi","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","contentUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","caption":"Daisuke Higuchi"},"description":"Chef\u30fbDocker\u30fbMirantis\u88fd\u54c1\u306a\u3069\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002","url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi"}]}},"_links":{"self":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/10412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=10412"}],"version-history":[{"count":1,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/10412\/revisions"}],"predecessor-version":[{"id":65792,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/10412\/revisions\/65792"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/media\/10413"}],"wp:attachment":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=10412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=10412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=10412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}