zookeeper 注册中心的简单搭建 Posted on 2018-02-18 | Edited on 2019-02-02 | In registration center zookeeper 官网官网地址 zookeeper 部署123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778➜ ~ sftp root@106.15.xxx.xxxConnected to 106.15.xxx.xxx.sftp> put /Users/niuhesm/resouces/major/remoteServer/zookeeper-3.4.10.tar.gz /usr/local/zookeeperUploading /Users/niuhesm/resouces/major/remoteServer/zookeeper-3.4.10.tar.gz to /usr/local/zookeeper/zookeeper-3.4.10.tar.gz/Users/niuhesm/resouces/major/remoteServer/zookeeper-3.4.10.tar.gz 100% 33MB 1.2MB/s 00:28sftp>[root@iZuf6iq8e7ya9v3ix71k0pZ zookeeper]# tar zxf zookeeper-3.4.10.tar.gz[root@iZuf6iq8e7ya9v3ix71k0pZ zookeeper]# ll总用量 34228drwxr-xr-x 10 www www 4096 3月 23 2017 zookeeper-3.4.10-rw-r--r-- 1 root root 35042811 2月 18 13:59 zookeeper-3.4.10.tar.gz[root@iZuf6iq8e7ya9v3ix71k0pZ zookeeper-3.4.10]# ll总用量 1588drwxr-xr-x 2 www www 4096 3月 23 2017 bin-rw-rw-r-- 1 www www 84725 3月 23 2017 build.xmldrwxr-xr-x 2 www www 4096 3月 23 2017 confdrwxr-xr-x 10 www www 4096 3月 23 2017 contribdrwxr-xr-x 2 www www 4096 3月 23 2017 dist-mavendrwxr-xr-x 6 www www 4096 3月 23 2017 docs-rw-rw-r-- 1 www www 1709 3月 23 2017 ivysettings.xml-rw-rw-r-- 1 www www 5691 3月 23 2017 ivy.xmldrwxr-xr-x 4 www www 4096 3月 23 2017 lib-rw-rw-r-- 1 www www 11938 3月 23 2017 LICENSE.txt-rw-rw-r-- 1 www www 3132 3月 23 2017 NOTICE.txt-rw-rw-r-- 1 www www 1770 3月 23 2017 README_packaging.txt-rw-rw-r-- 1 www www 1585 3月 23 2017 README.txtdrwxr-xr-x 5 www www 4096 3月 23 2017 recipesdrwxr-xr-x 8 www www 4096 3月 23 2017 src-rw-rw-r-- 1 www www 1456729 3月 23 2017 zookeeper-3.4.10.jar-rw-rw-r-- 1 www www 819 3月 23 2017 zookeeper-3.4.10.jar.asc-rw-rw-r-- 1 www www 33 3月 23 2017 zookeeper-3.4.10.jar.md5-rw-rw-r-- 1 www www 41 3月 23 2017 zookeeper-3.4.10.jar.sha1[root@iZuf6iq8e7ya9v3ix71k0pZ zookeeper-3.4.10]# cd bin[root@iZuf6iq8e7ya9v3ix71k0pZ bin]# ll总用量 36-rwxr-xr-x 1 www www 232 3月 23 2017 README.txt-rwxr-xr-x 1 www www 1937 3月 23 2017 zkCleanup.sh-rwxr-xr-x 1 www www 1056 3月 23 2017 zkCli.cmd-rwxr-xr-x 1 www www 1534 3月 23 2017 zkCli.sh-rwxr-xr-x 1 www www 1628 3月 23 2017 zkEnv.cmd-rwxr-xr-x 1 www www 2696 3月 23 2017 zkEnv.sh-rwxr-xr-x 1 www www 1089 3月 23 2017 zkServer.cmd-rwxr-xr-x 1 www www 6773 3月 23 2017 zkServer.sh[root@iZuf6iq8e7ya9v3ix71k0pZ bin]# cd ..[root@iZuf6iq8e7ya9v3ix71k0pZ zookeeper-3.4.10]# mkdir data[root@iZuf6iq8e7ya9v3ix71k0pZ zookeeper-3.4.10]### 记录 data 路径[root@iZuf6iq8e7ya9v3ix71k0pZ zookeeper-3.4.10]# cd data[root@iZuf6iq8e7ya9v3ix71k0pZ data]# pwd/usr/local/zookeeper/zookeeper-3.4.10/data[root@iZuf6iq8e7ya9v3ix71k0pZ data]# cd ../conf[root@iZuf6iq8e7ya9v3ix71k0pZ conf]# ll总用量 12-rw-rw-r-- 1 www www 535 3月 23 2017 configuration.xsl-rw-rw-r-- 1 www www 2161 3月 23 2017 log4j.properties-rw-rw-r-- 1 www www 922 3月 23 2017 zoo_sample.cfg[root@iZuf6iq8e7ya9v3ix71k0pZ conf]# mv zoo_sample.cfg zoo.cfg[root@iZuf6iq8e7ya9v3ix71k0pZ conf]# vim zoo.cfgdataDir=/tmp/zookeeper改成dataDir=/usr/local/zookeeper/zookeeper-3.4.10/data## 服务相关命令[root@iZuf6iq8e7ya9v3ix71k0pZ bin]# ./zkServer.sh startZooKeeper JMX enabled by defaultUsing config: /usr/local/zookeeper/zookeeper-3.4.10/bin/../conf/zoo.cfgStarting zookeeper ... STARTED[root@iZuf6iq8e7ya9v3ix71k0pZ bin]# ./zkServer.sh statusZooKeeper JMX enabled by defaultUsing config: /usr/local/zookeeper/zookeeper-3.4.10/bin/../conf/zoo.cfgMode: standalone[root@iZuf6iq8e7ya9v3ix71k0pZ bin]# ./zkServer.sh stopZooKeeper JMX enabled by defaultUsing config: /usr/local/zookeeper/zookeeper-3.4.10/bin/../conf/zoo.cfgStopping zookeeper ... STOPPED[root@iZuf6iq8e7ya9v3ix71k0pZ bin]# dubbo-admin 管理平台的结合123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566# 推收文件➜ ~ sftp root@106.15.191.27Connected to 106.15.191.27.sftp> put /Users/niuhesm/resouces/major/remoteServer/apache-tomcat-8.5.28.tar.gz /usr/local/tomcatUploading /Users/niuhesm/resouces/major/remoteServer/apache-tomcat-8.5.28.tar.gz to /usr/local/tomcat/apache-tomcat-8.5.28.tar.gz/Users/niuhesm/resouces/major/remoteServer/apache 100% 9321KB 1.5MB/s 00:06# 解压配置tomcat[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# ll总用量 9324-rw-r--r-- 1 root root 9544774 4月 4 21:21 apache-tomcat-8.5.28.tar.gz[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# tar zxf apache-tomcat-8.5.28.tar.gz[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# ll总用量 9328drwxr-xr-x 9 root root 4096 4月 4 21:22 apache-tomcat-8.5.28-rw-r--r-- 1 root root 9544774 4月 4 21:21 apache-tomcat-8.5.28.tar.gz[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# ll总用量 9328drwxr-xr-x 9 root root 4096 4月 4 21:22 apache-tomcat-8.5.28-rw-r--r-- 1 root root 9544774 4月 4 21:21 apache-tomcat-8.5.28.tar.gz[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# rm -rf apache-tomcat-8.5.28.tar.gz[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# cp -r apache-tomcat-8.5.28/ /usr/local/tomcat/tomcat-8081[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# ll总用量 8drwxr-xr-x 9 root root 4096 4月 4 21:22 apache-tomcat-8.5.28drwxr-xr-x 9 root root 4096 4月 4 21:24 tomcat-8081[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# vim tomcat-8081/conf/server.xml...# 接受dubbo-admi管理工程sftp> put /Users/niuhesm/resouces/major/remoteServer/dubbo-admin-2.6.0.war /usr/local/tomcat/tomcat-8081/webappsUploading /Users/niuhesm/resouces/major/remoteServer/dubbo-admin-2.6.0.war to /usr/local/tomcat/tomcat-8081/webapps/dubbo-admin-2.6.0.war/Users/niuhesm/resouces/major/remoteServer/dubbo- 100% 31MB 1.3MB/s 00:24sftp># 配置[root@iZuf6iq8e7ya9v3ix71k0pZ webapps]# ll总用量 31416drwxr-x--- 14 root root 4096 4月 4 21:24 docsdrwxr-x--- 8 root root 4096 4月 4 21:30 dubbo-admin-2.6.0-rw-r--r-- 1 root root 32089280 4月 4 21:28 dubbo-admin-2.6.0.war-rw-r----- 1 root root 51229 4月 4 21:30 dubbo-governance.logdrwxr-x--- 6 root root 4096 4月 4 21:24 examplesdrwxr-x--- 5 root root 4096 4月 4 21:24 host-managerdrwxr-x--- 5 root root 4096 4月 4 21:24 managerdrwxr-x--- 3 root root 4096 4月 4 21:24 ROOT[root@iZuf6iq8e7ya9v3ix71k0pZ webapps]# mv dubbo-admin-2.6.0.war dubbo-admin.war[root@iZuf6iq8e7ya9v3ix71k0pZ webapps]# /usr/local/tomcat/tomcat-8081/bin/startup.sh[root@iZuf6iq8e7ya9v3ix71k0pZ webapps]# ll总用量 31400drwxr-x--- 14 root root 4096 4月 4 21:24 docsdrwxr-x--- 8 root root 4096 4月 4 21:33 dubbo-admin-rw-r--r-- 1 root root 32089280 4月 4 21:28 dubbo-admin.war-rw-r----- 1 root root 35083 4月 4 21:33 dubbo-governance.logdrwxr-x--- 6 root root 4096 4月 4 21:24 examplesdrwxr-x--- 5 root root 4096 4月 4 21:24 host-managerdrwxr-x--- 5 root root 4096 4月 4 21:24 managerdrwxr-x--- 3 root root 4096 4月 4 21:24 ROOT[root@iZuf6iq8e7ya9v3ix71k0pZ dubbo-admin]# vim WEB-INF/dubbo.propertiesdubbo.registry.address=zookeeper://127.0.0.1:2181dubbo.admin.root.password=rootdubbo.admin.guest.password=guest~~