{"id":3190,"date":"2018-03-17T14:51:22","date_gmt":"2018-03-17T06:51:22","guid":{"rendered":"http:\/\/switch.linesno.com\/?p=3190"},"modified":"2018-03-17T14:51:22","modified_gmt":"2018-03-17T06:51:22","slug":"centos7%e4%b8%8amesos%e5%92%8cmarathon%e7%9a%84%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"http:\/\/switch.linesno.com\/?p=3190","title":{"rendered":"Centos7\u4e0aMesos\u548cMarathon\u7684\u5b89\u88c5"},"content":{"rendered":"<p>\u5bf9Mesos\u548cMarathon\u7684\u5b89\u88c5\u5b98\u65b9\u6587\u6863\u6709\u8f83\u8be6\u7ec6\u7684\u5b89\u88c5\u8bf4\u660e\uff0c\u4f46\u662f\u82f1\u6587\u7684\u3002\u6211\u53c2\u7167\u5b98\u65b9\u5b89\u88c5\u6587\u6863\uff08<a href=\"https:\/\/open.mesosphere.com\/getting-started\/install\/\" target=\"_blank\" rel=\"noopener\">https:\/\/open.mesosphere.com\/getting-started\/install\/<\/a>\uff09\uff0c\u5728\u6d4b\u8bd5\u73af\u5883\u8bd5\u88c5\u4e86\u4e00\u4e0b\uff0c\u8fd9\u91cc\u6574\u7406\u4e0b\u5b89\u88c5\u914d\u7f6e\u7684\u6b65\u9aa4\u3002<\/p>\n<h3 id=\"\u6d4b\u8bd5\u73af\u5883\"><a name=\"t0\"><\/a>\u6d4b\u8bd5\u73af\u5883<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u670d\u52a1\u5668IP<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>192.168.0.101<\/td>\n<td>Master\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>192.168.0.102<\/td>\n<td>Master\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>192.168.0.103<\/td>\n<td>Master\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>192.168.0.104<\/td>\n<td>Slave\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>192.168.0.105<\/td>\n<td>Slave\u8282\u70b9<\/td>\n<\/tr>\n<tr>\n<td>192.168.0.106<\/td>\n<td>Slave\u8282\u70b9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6211\u4eec\u901a\u5e38\u91c7\u7528\u591a\u4e2amaster\u8282\u70b9\u548c\u591a\u4e2aslave\u8282\u70b9\u6765\u5b9e\u73b0\u9ad8\u53ef\u7528\u3002\u8fd9\u91cc\u4f7f\u75283\u4e2amaster\u8282\u70b9\u6765\u8fdb\u884c\u9ad8\u53ef\u7528\u914d\u7f6e\uff0c\u6bcf\u4e2amaster\u8282\u70b9\u4e0a\u90fd\u8fd0\u884cmesos-master\uff0cmarathon\u548c\u63d0\u4f9b\u9009\u4e3b\u673a\u5236\u7684zookeeper\u670d\u52a1\u3002slave\u8282\u70b9\u4e0a\u53ea\u9700\u8981\u8fd0\u884cmesos-slave\u670d\u52a1\uff0c\u540e\u671f\u5982\u679c\u9700\u8981\u6dfb\u52a0slave\u8282\u70b9\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u7684\u6dfb\u52a0\u3002\u4e3a\u4e86\u7b80\u5355\uff0c\u4e0b\u9762\u76f4\u63a5\u91c7\u7528yum\u65b9\u5f0f\u5b89\u88c5\uff08\u9664\u6b64\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u91c7\u7528\u7f16\u8bd1\u5b89\u88c5\uff09\u3002<\/p>\n<h3 id=\"master\u8282\u70b9\u5b89\u88c5\u548c\u914d\u7f6e\"><a name=\"t1\"><\/a>Master\u8282\u70b9\u5b89\u88c5\u548c\u914d\u7f6e<\/h3>\n<h4 id=\"1-\u5b89\u88c5\u670d\u52a1\">1 \u5b89\u88c5\u670d\u52a1<\/h4>\n<p>\u5728\u6240\u6709\u7684Master\u8282\u70b9\u4e0a\u6267\u884c\u4e0b\u9762\u7684\u64cd\u4f5c\u3002<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs lasso has-numbering\">rpm <span class=\"hljs-attribute\">-Uvh<\/span> http:<span class=\"hljs-comment\">\/\/repos.mesosphere.io\/el\/7\/noarch\/RPMS\/mesosphere-el-repo-7-1.noarch.rpm<\/span>\r\nrpm <span class=\"hljs-subst\">--<\/span><span class=\"hljs-keyword\">import<\/span> \/etc\/pki\/rpm<span class=\"hljs-attribute\">-gpg<\/span>\/RPM<span class=\"hljs-attribute\">-GPG<\/span><span class=\"hljs-attribute\">-KEY<\/span><span class=\"hljs-attribute\">-mesosphere<\/span>\r\nyum install mesos marathon mesosphere<span class=\"hljs-attribute\">-zookeeper<\/span> <span class=\"hljs-attribute\">-y<\/span><\/code><\/pre>\n<h4 id=\"2-zookeeper\u914d\u7f6e\">2 zookeeper\u914d\u7f6e<\/h4>\n<p>1\uff09\u6bcf\u4e2amaster\u8282\u70b9\u8bbe\u7f6e\u4e0d\u540c\u7684myid\u503c<br \/>\n\u5728\/var\/lib\/zookeeper\/myid\u4e2d\u5199\u5165\u4e00\u4e2a1\u5230255\u8303\u56f4\u7684\u6570\u503c\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6bcf\u4e2a\u8282\u70b9\u7684myid\u4e0d\u8981\u91cd\u590d\u3002\u8fd9\u91cc\u5c063\u4e2amaster\u8282\u70b9\u7684myid\u5206\u522b\u8bbe\u7f6e\u4e3a\uff1a1\uff0c2\uff0c3<\/p>\n<p>2\uff09\u6bcf\u4e2amaster\u8282\u70b9\u8bbe\u7f6ezoo.cfg<br \/>\n\u5728\u914d\u7f6e\u6587\u4ef6\/etc\/zookeeper\/conf\/zoo.cfg\u4e2d\u52a0\u5165\u4e0b\u9762\u5185\u5bb9\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs profile has-numbering\"><span class=\"hljs-filename\">server.1=192.168.0.101<\/span>:<span class=\"hljs-number\">2888<\/span>:<span class=\"hljs-number\">3888<\/span>\r\n<span class=\"hljs-filename\">server.2=192.168.0.102<\/span>:<span class=\"hljs-number\">2888<\/span>:<span class=\"hljs-number\">3888<\/span>\r\n<span class=\"hljs-filename\">server.3=192.168.0.103<\/span>:<span class=\"hljs-number\">2888<\/span>:<span class=\"hljs-number\">3888<\/span><\/code><\/pre>\n<p>3\uff09\u542f\u52a8zookeeper\u670d\u52a1<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs sql has-numbering\">systemctl <span class=\"hljs-operator\"><span class=\"hljs-keyword\">start<\/span> zookeeper<\/span><\/code><\/pre>\n<h4 id=\"3-mesos-master\u548cmarathon\u914d\u7f6e\">3 mesos-master\u548cmarathon\u914d\u7f6e<\/h4>\n<p>1\uff09\u6bcf\u4e2amaster\u8282\u70b9\u7684\/etc\/mesos\/zk\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6ezk\u7684\u5730\u5740<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs cs has-numbering\">zk:<span class=\"hljs-comment\">\/\/192.168.0.101:2181,192.168.0.102:2181,192.168.0.103:2181\/mesos<\/span><\/code><\/pre>\n<p>2\uff09\/etc\/mesos-master\/quorum\u4e2d\u8bbe\u7f6equorum\u503c<br \/>\n\u8fd9\u4e2a\u503c\u8981\u5927\u4e8emaster\u6570\/2\uff0c\u8fd9\u91ccmaster\u6570\u4e3a3\uff0c\u5219\u8981\u8bbe\u4e3a2<\/p>\n<p>3\uff09\u505c\u6389mesos-slave<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs avrasm has-numbering\">systemctl stop mesos-slave<span class=\"hljs-preprocessor\">.service<\/span>\r\nsystemctl disable mesos-slave<span class=\"hljs-preprocessor\">.service<\/span><\/code><\/pre>\n<p>4\uff09\u542f\u52a8mesos-master marathon<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs sql has-numbering\">systemctl <span class=\"hljs-operator\"><span class=\"hljs-keyword\">start<\/span> mesos-master\r\nsystemctl <span class=\"hljs-keyword\">start<\/span> marathon<\/span><\/code><\/pre>\n<h3 id=\"slave\u8282\u70b9\u5b89\u88c5\u548c\u914d\u7f6e\"><a name=\"t2\"><\/a>Slave\u8282\u70b9\u5b89\u88c5\u548c\u914d\u7f6e<\/h3>\n<h4 id=\"1-\u5b89\u88c5\u670d\u52a1-1\">1 \u5b89\u88c5\u670d\u52a1<\/h4>\n<p>\u5728\u6240\u6709\u7684Slave\u8282\u70b9\u4e0a\u6267\u884c\u4e0b\u9762\u7684\u64cd\u4f5c\u3002<\/p>\n<pre class=\"prettyprint\"><code class=\"language-shell hljs lasso has-numbering\">rpm <span class=\"hljs-attribute\">-Uvh<\/span> http:<span class=\"hljs-comment\">\/\/repos.mesosphere.io\/el\/7\/noarch\/RPMS\/mesosphere-el-repo-7-1.noarch.rpm<\/span>\r\nrpm <span class=\"hljs-subst\">--<\/span><span class=\"hljs-keyword\">import<\/span> \/etc\/pki\/rpm<span class=\"hljs-attribute\">-gpg<\/span>\/RPM<span class=\"hljs-attribute\">-GPG<\/span><span class=\"hljs-attribute\">-KEY<\/span><span class=\"hljs-attribute\">-mesosphere<\/span>\r\nyum install mesos <span class=\"hljs-attribute\">-y<\/span><\/code><\/pre>\n<h4 id=\"2-mesos-slave\u914d\u7f6e\">2 mesos-slave\u914d\u7f6e<\/h4>\n<p>1\uff09\u5728\/etc\/mesos\/zk\u4e2d\u8bbe\u7f6ezk\u7684\u5730\u5740<br \/>\n\u8fd9\u91cc\u7684zk\u5730\u5740\u5c31\u662fmaster\u8282\u70b9\u6240\u4f7f\u7528\u7684\u540c\u4e00\u5957zookeeper\u670d\u52a1\u7684\u5730\u5740\u3002<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs cs has-numbering\">zk:<span class=\"hljs-comment\">\/\/192.168.0.101:2181,192.168.0.102:2181,192.168.0.103:2181\/mesos<\/span><\/code><\/pre>\n<p>2\uff09\u5173\u95edmesos-master\u670d\u52a1<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs avrasm has-numbering\">systemctl stop mesos-master<span class=\"hljs-preprocessor\">.service<\/span>\r\nsystemctl disable mesos-master<span class=\"hljs-preprocessor\">.service<\/span><\/code><\/pre>\n<p>3\uff09\u542f\u52a8mesos-slave\u670d\u52a1<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs sql has-numbering\">systemctl <span class=\"hljs-operator\"><span class=\"hljs-keyword\">start<\/span> mesos-slave<\/span><\/code><\/pre>\n<p>\u6309\u7167\u4ee5\u4e0a\u7684\u5b89\u88c5\u548c\u914d\u7f6e\uff0c\u4e00\u4e2a\u9ad8\u53ef\u7528\u7684Mesos\u548cMarathon\u670d\u52a1\u5c31\u642d\u5efa\u5b8c\u6210\u4e86\u3002\u53ef\u4ee5\u901a\u8fc7http:\/\/:5050\u6765\u8bbf\u95eeMesos\u7684web\u754c\u9762\uff0c\u901a\u8fc7http:\/\/:8080\u6765\u8bbf\u95eeMarathon\u7684web\u754c\u9762\u3002\u53ef\u4ee5\u662f\u4efb\u610f\u4e00\u4e2amaster\u8282\u70b9\u7684IP\u3002<\/p>\n<p>\u6700\u540e\u63d0\u9192\u4e00\u4e0b\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a<br \/>\n1\uff09\u670d\u52a1\u5668\u7684jdk\u8981\u662f1.8\u4ee5\u4e0a\u7248\u672c\u7684\uff0c\u4e0d\u7136\u4f1a\u6709\u62a5\u9519\uff0c\u56e0\u4e3amarathon\u662f\u8981\u6c42jdk1.8\u4ee5\u4e0a\u7684\uff1b<br \/>\n2\uff09\u5404\u8282\u70b9\u914d\u4e00\u4e0b\/etc\/hosts\u6216\u6307\u5411\u4e00\u4e2a\u5171\u7528\u7684DNS\uff0c\u786e\u4fdd\u76f8\u4e92\u80fd\u591f\u8bbf\u95ee\u3002\u5982\u679c\u4e0d\u60f3\u914dhosts\uff0c\u5728\u542f\u52a8\u65f6\u6307\u5b9a\u2013hostname\u4e3aIP\u5373\u53ef\uff1b<br \/>\n3\uff09\u5982\u679c\u60f3\u5728marathon\u4e0a\u8fd0\u884cdocker\uff0c\u5219\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u914d\u7f6e\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs lasso has-numbering\"><span class=\"hljs-comment\">\/\/\u6307\u5b9a\u4f7f\u7528docker\u5bb9\u5668\u5316<\/span>\r\necho <span class=\"hljs-string\">'docker,mesos'<\/span> <span class=\"hljs-subst\">&gt;<\/span> \/etc\/mesos<span class=\"hljs-attribute\">-slave<\/span>\/containerizers\r\n<span class=\"hljs-comment\">\/\/\u8003\u8651\u5230\u62c9\u53d6\u5bb9\u5668\u955c\u50cf\u7b49\u7684\u64cd\u4f5c\uff0c\u9002\u5f53\u589e\u52a0timeout\u7684\u65f6\u95f4<\/span>\r\necho <span class=\"hljs-string\">'5mins'<\/span> <span class=\"hljs-subst\">&gt;<\/span> \/etc\/mesos<span class=\"hljs-attribute\">-slave<\/span>\/executor_registration_timeout\r\n<span class=\"hljs-comment\">\/\/\u91cd\u542fmesos-slave\u4ee5\u4f7f\u4e0a\u9762\u914d\u7f6e\u751f\u6548<\/span>\r\nsystemctl restart mesos<span class=\"hljs-attribute\">-slave<\/span><\/code><\/pre>\n<p>4\uff09\u51e0\u4e2a\u914d\u7f6e\u542f\u52a8\u53c2\u6570\u7684\u76ee\u5f55\uff1a<br \/>\n\/etc\/mesos-master\/<br \/>\n\/etc\/mesos-slave\/<br \/>\n\/etc\/marathon\/conf\/<br \/>\n\u5728\u8fd9\u4e9b\u76ee\u5f55\u5206\u522b\u7528\u6765\u914d\u7f6emesos-master\uff0cmesos-slave\uff0cmarathon\u7684\u542f\u52a8\u53c2\u6570\u3002\u4ee5\u53c2\u6570\u540d\u4e3a\u6587\u4ef6\u540d\uff0c\u53c2\u6570\u503c\u4e3a\u6587\u4ef6\u5185\u5bb9\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bf9Mesos\u548cMarathon\u7684\u5b89\u88c5\u5b98\u65b9\u6587\u6863\u6709\u8f83\u8be6\u7ec6\u7684\u5b89\u88c5\u8bf4\u660e\uff0c\u4f46\u662f\u82f1\u6587\u7684\u3002\u6211\u53c2\u7167\u5b98\u65b9\u5b89\u88c5\u6587\u6863\uff08https:\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[],"class_list":["post-3190","post","type-post","status-publish","format-standard","hentry","category-headth"],"_links":{"self":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3190"}],"version-history":[{"count":1,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3190\/revisions"}],"predecessor-version":[{"id":3191,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3190\/revisions\/3191"}],"wp:attachment":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3190"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}