| |
| <!DOCTYPE HTML> |
| <html lang="" > |
| <head> |
| <meta charset="UTF-8"> |
| <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> |
| <title>1.3 Zookeeper注册中心安装 · GitBook</title> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| <meta name="description" content=""> |
| <meta name="generator" content="GitBook 3.2.2"> |
| |
| |
| |
| |
| <link rel="stylesheet" href="../gitbook/style.css"> |
| |
| |
| |
| |
| <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css"> |
| |
| |
| |
| <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css"> |
| |
| |
| |
| <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <meta name="HandheldFriendly" content="true"/> |
| <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> |
| <meta name="apple-mobile-web-app-capable" content="yes"> |
| <meta name="apple-mobile-web-app-status-bar-style" content="black"> |
| <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png"> |
| <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon"> |
| |
| |
| <link rel="next" href="Redis注册中心安装.html" /> |
| |
| |
| <link rel="prev" href="示例消费者安装.html" /> |
| |
| |
| </head> |
| <body> |
| |
| <div class="book"> |
| <div class="book-summary"> |
| |
| |
| <div id="book-search-input" role="search"> |
| <input type="text" placeholder="Type to search" /> |
| </div> |
| |
| |
| <nav role="navigation"> |
| |
| |
| |
| <ul class="summary"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <li class="chapter " data-level="1.1" data-path="../"> |
| |
| <a href="../"> |
| |
| |
| Introduction |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.2" > |
| |
| <span> |
| |
| |
| 1 安装手册 |
| |
| </span> |
| |
| |
| |
| <ul class="articles"> |
| |
| |
| <li class="chapter " data-level="1.2.1" data-path="示例提供者安装.html"> |
| |
| <a href="示例提供者安装.html"> |
| |
| |
| 1.1 示例提供者安装 |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.2.2" data-path="示例消费者安装.html"> |
| |
| <a href="示例消费者安装.html"> |
| |
| |
| 1.2 示例消费者安装 |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter active" data-level="1.2.3" data-path="Zookeeper注册中心安装.html"> |
| |
| <a href="Zookeeper注册中心安装.html"> |
| |
| |
| 1.3 Zookeeper注册中心安装 |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.2.4" data-path="Redis注册中心安装.html"> |
| |
| <a href="Redis注册中心安装.html"> |
| |
| |
| 1.4 Redis注册中心安装 |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.2.5" data-path="简单注册中心安装.html"> |
| |
| <a href="简单注册中心安装.html"> |
| |
| |
| 1.5 Simple注册中心安装 |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.2.6" data-path="简单注册中心安装.html"> |
| |
| <a href="简单注册中心安装.html"> |
| |
| |
| 1.6 Simple监控中心安装 |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.2.7" data-path="管理控制台安装.html"> |
| |
| <a href="管理控制台安装.html"> |
| |
| |
| 1.7 管理控制台安装 |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| |
| </ul> |
| |
| </li> |
| |
| <li class="chapter " data-level="1.3" > |
| |
| <span> |
| |
| |
| 2 运维手册 |
| |
| </span> |
| |
| |
| |
| <ul class="articles"> |
| |
| |
| <li class="chapter " data-level="1.3.1" data-path="../ops-mannual/管理控制台运维.html"> |
| |
| <a href="../ops-mannual/管理控制台运维.html"> |
| |
| |
| 2.1 管理控制台运维 |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| |
| </ul> |
| |
| </li> |
| |
| |
| |
| |
| <li class="divider"></li> |
| |
| <li> |
| <a href="https://www.gitbook.com" target="blank" class="gitbook-link"> |
| Published with GitBook |
| </a> |
| </li> |
| </ul> |
| |
| |
| </nav> |
| |
| |
| </div> |
| |
| <div class="book-body"> |
| |
| <div class="body-inner"> |
| |
| |
| |
| <div class="book-header" role="navigation"> |
| |
| |
| <!-- Title --> |
| <h1> |
| <i class="fa fa-circle-o-notch fa-spin"></i> |
| <a href=".." >1.3 Zookeeper注册中心安装</a> |
| </h1> |
| </div> |
| |
| |
| |
| |
| <div class="page-wrapper" tabindex="-1" role="main"> |
| <div class="page-inner"> |
| |
| <div id="book-search-results"> |
| <div class="search-noresults"> |
| |
| <section class="normal markdown-section"> |
| |
| <blockquote> |
| <p><img src="../sources/images/check.gif" alt="warning">建议使用dubbo-2.3.3以上版本的zookeeper注册中心客户端</p> |
| <p><img src="../sources/images/check.gif" alt="warning">Zookeeper是Apache Hadoop的子项目,强度相对较好,建议生产环境使用该注册中心。</p> |
| <p><img src="../sources/images/check.gif" alt="warning">Dubbo未对Zookeeper服务器端做任何侵入修改,只需安装原生的Zookeeper服务器即可,所有注册中心逻辑适配都在调用Zookeeper客户端时完成。</p> |
| <p><img src="../sources/images/check.gif" alt="warning">如果需要,可以考虑使用taobao的zookeeper监控:<a href="http://rdc.taobao.com/team/jm/archives/1450" target="_blank">http://rdc.taobao.com/team/jm/archives/1450</a></p> |
| </blockquote> |
| <ul> |
| <li>安装:</li> |
| </ul> |
| <pre><code class="lang-shell">wget http://www.apache.org/dist//zookeeper/zookeeper-3.3.3/zookeeper-3.3.3.tar.gz |
| tar zxvf zookeeper-3.3.3.tar.gz |
| cd zookeeper-3.3.3 |
| cp conf/zoo_sample.cfg conf/zoo.cfg |
| </code></pre> |
| <ul> |
| <li>配置:</li> |
| </ul> |
| <pre><code class="lang-shell">vi conf/zoo.cfg |
| </code></pre> |
| <p>如果不需要集群,zoo.cfg的内容如下:(其中data目录需改成你真实输出目录)</p> |
| <blockquote> |
| <p>zoo.cfg</p> |
| </blockquote> |
| <pre><code>tickTime=2000 |
| initLimit=10 |
| syncLimit=5 |
| dataDir=/home/dubbo/zookeeper-3.3.3/data |
| clientPort=2181 |
| </code></pre><p>如果需要集群,zoo.cfg的内容如下:(其中data目录和server地址需改成你真实部署机器的信息)</p> |
| <blockquote> |
| <p>zoo.cfg</p> |
| </blockquote> |
| <pre><code>tickTime=2000 |
| initLimit=10 |
| syncLimit=5 |
| dataDir=/home/dubbo/zookeeper-3.3.3/data |
| clientPort=2181 |
| server.1=10.20.153.10:2555:3555 |
| server.2=10.20.153.11:2555:3555 |
| </code></pre><p>并在data目录下放置myid文件:(上面zoo.cfg中的dataDir)</p> |
| <pre><code class="lang-shell">mkdir data |
| vi myid |
| </code></pre> |
| <p>myid指明自己的id,对应上面zoo.cfg中server.后的数字,第一台的内容为1,第二台的内容为2,内容如下:</p> |
| <blockquote> |
| <p>myid</p> |
| </blockquote> |
| <pre><code>1 |
| </code></pre><ul> |
| <li>启动:</li> |
| </ul> |
| <pre><code class="lang-shell">./bin/zkServer.sh start |
| </code></pre> |
| <ul> |
| <li>停止:</li> |
| </ul> |
| <pre><code class="lang-shell">./bin/zkServer.sh stop |
| </code></pre> |
| <ul> |
| <li>命令行: (See: <a href="http://zookeeper.apache.org/doc/r3.3.3/zookeeperAdmin.html" target="_blank">http://zookeeper.apache.org/doc/r3.3.3/zookeeperAdmin.html</a>)</li> |
| </ul> |
| <pre><code class="lang-shell">telnet 127.0.0.1 2181 |
| dump |
| </code></pre> |
| <p>Or:</p> |
| <pre><code class="lang-shell">echo dump | nc 127.0.0.1 2181 |
| </code></pre> |
| <ul> |
| <li>用法:</li> |
| </ul> |
| <pre><code>dubbo.registry.address=zookeeper://10.20.153.10:2181?backup=10.20.153.11:2181 |
| </code></pre><p>Or:</p> |
| <pre><code class="lang-xml"><span class="hljs-tag"><<span class="hljs-name">dubbo:registry</span> <span class="hljs-attr">protocol</span>=<span class="hljs-string">"zookeeper"</span> <span class="hljs-attr">address</span>=<span class="hljs-string">"10.20.153.10:2181,10.20.153.11:2181"</span> /></span> |
| </code></pre> |
| |
| |
| </section> |
| |
| </div> |
| <div class="search-results"> |
| <div class="has-results"> |
| |
| <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1> |
| <ul class="search-results-list"></ul> |
| |
| </div> |
| <div class="no-results"> |
| |
| <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1> |
| |
| </div> |
| </div> |
| </div> |
| |
| </div> |
| </div> |
| |
| </div> |
| |
| |
| |
| <a href="示例消费者安装.html" class="navigation navigation-prev " aria-label="Previous page: 1.2 示例消费者安装"> |
| <i class="fa fa-angle-left"></i> |
| </a> |
| |
| |
| <a href="Redis注册中心安装.html" class="navigation navigation-next " aria-label="Next page: 1.4 Redis注册中心安装"> |
| <i class="fa fa-angle-right"></i> |
| </a> |
| |
| |
| |
| </div> |
| |
| <script> |
| var gitbook = gitbook || []; |
| gitbook.push(function() { |
| gitbook.page.hasChanged({"page":{"title":"1.3 Zookeeper注册中心安装","level":"1.2.3","depth":2,"next":{"title":"1.4 Redis注册中心安装","level":"1.2.4","depth":2,"path":"install-mannual/Redis注册中心安装.md","ref":"install-mannual/Redis注册中心安装.md","articles":[]},"previous":{"title":"1.2 示例消费者安装","level":"1.2.2","depth":2,"path":"install-mannual/示例消费者安装.md","ref":"install-mannual/示例消费者安装.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"install-mannual/Zookeeper注册中心安装.md","mtime":"2017-08-02T06:13:38.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-08-02T07:12:30.204Z"},"basePath":"..","book":{"language":""}}); |
| }); |
| </script> |
| </div> |
| |
| |
| <script src="../gitbook/gitbook.js"></script> |
| <script src="../gitbook/theme.js"></script> |
| |
| |
| <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script> |
| |
| |
| |
| <script src="../gitbook/gitbook-plugin-search/search.js"></script> |
| |
| |
| |
| <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script> |
| |
| |
| |
| <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script> |
| |
| |
| |
| <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script> |
| |
| |
| |
| <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script> |
| |
| |
| |
| </body> |
| </html> |
| |