一、zookeeper windows部署

1、下载安装

到官网下载解压版后解压至F:\server\zookeeper-3.4.8,剩下为文件配置工作;

2、本地伪集群

1) 在F:\server\zookeeper-3.4.8\conf 创建 zoo1.cfg,内容如下:

# The number of milliseconds of each tick  心跳间隔 毫秒每次

tickTime=2000

# The number of ticks that the initial

# synchronization phase can take

initLimit=10

# The number of ticks that can pass between

# sending a request and getting anacknowledgement

syncLimit=5

# the directory where the snapshot isstored.  //镜像数据位置

dataDir=F:\\server\\zookeeper-3.4.8\\data\\1

#日志位置

dataLogDir=F:\\server\\zookeeper-3.4.8\\log\\1

# the port at which the clients willconnect  客户端连接的端口

clientPort=2181

# server.id=host:port:port
# 在服务器的 data (dataDir 参数所指定的目录)目录下创建一个文件名为 myid 的文件,
# 这个文件中仅含有一行的内容,指定的是自身的 id 值。
# 比如,服务器"1"应该在 myid 文件中写入"1"。这个 id 值必须是 ensemble 中唯一的,且大小在 1 到 255 之间。
# 这一行配置中,第一个端口( port )是从( follower )机器连接到主( leader )机器的端口,
# 第二个端口是用来进行 leader 选举的端口。
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889

2) 创建目录:F:\server\zookeeper-3.4.8\data\1 ,并在该目录下创建"myid"文件,内容为"1";
3) 创建目录:F:\server\zookeeper-3.4.8\log\1 ;

4) 创建文件 F:\server\zookeeper-3.4.8\bin\zkServer-1.cmd  ,内容如下:

@echo off
REM Licensed to the Apache Software Foundation (ASF) under one or more
REM contributor license agreements. See the NOTICE file distributed with
REM this work for additional information regarding copyright ownership.
REM The ASF licenses this file to You under the Apache License, Version 2.0
REM (the "License"); you may not use this file except in compliance with
REM the License. You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License. setlocal
call "%~dp0zkEnv.cmd" set ZOOMAIN=org.apache.zookeeper.server.quorum.QuorumPeerMain
set ZOOCFG=..\conf\zoo1.cfg
echo on
call %JAVA% "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" "-Dzookeeper.root.logger=%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% "%ZOOCFG%" %* endlocal

5) 重复上述步骤依次创建 zoo2.cfg, zoo3.cfg 及相应的目录、文件;

6) 依次运行 zkServer-1.cmd 、 zkServer-2.cmd 、zkServer-3.cmd 即可,前面启动的端口报错问题可以忽略,全部启动完毕后自动恢复正常。

二、dubbo 代码示例参考

http://blog.csdn.net/wxwzy738/article/details/16330383

dubbo + zookeeper 环境搭建的更多相关文章

  1. 【转载】Maven+druid+MyBatis+Spring+Oracle+Dubbo开发环境搭建

    原地址:http://blog.csdn.net/wp1603710463/article/details/48247817#t16 Maven+druid+MyBatis+spring+Oracle ...

  2. hadoop2.6.2+hbase+zookeeper环境搭建

    1.hadoop环境搭建,版本:2.6.2,参考:http://www.cnblogs.com/bookwed/p/5251393.html 启动服务:在master机器上,进入hadoop安装目录, ...

  3. [转]云计算之hadoop、hive、hue、oozie、sqoop、hbase、zookeeper环境搭建及配置文件

     云计算之hadoop.hive.hue.oozie.sqoop.hbase.zookeeper环境搭建及配置文件已经托管到githubhttps://github.com/sxyx2008/clou ...

  4. 【Hadoop离线基础总结】CDH版本的zookeeper环境搭建

    CDH版本的zookeeper环境搭建 下载 下载地址 http://archive.cloudera.com/cdh5/cdh/5/ 修改配置文件 创建ZooKeeper数据存放目录 mkdir - ...

  5. Zookeeper+Dubbo+SpringMVC环境搭建

    项目码云GIT地址:https://gitee.com/xshuai/dubbo/ 开发工具 MyEclipse 10.7 JDK 1.7 容器 Tomcat 8(运行dubbo) zookeeper ...

  6. zookeeper 环境搭建

    1.准备三台服务器 ip分别为:192.168.100.128.192.168.100.129.192.168.100.133 a.修改主机名称 vi /etc/sysconfig/network 修 ...

  7. Dubbo简单环境搭建

    Dubbo服务的发展和作用: 首先,看下一般网站架构随着业务的发展,逻辑越来越复杂,数据量越来越大,交互越来越多之后的常规方案演进历程. 其次,当服务越来越多之后,我们需要做哪些服务治理? 最后,是d ...

  8. Dubbo系列(二)dubbo的环境搭建

    dubbo是一个分布式服务框架,提供一个SOA的解决方案.简单的说,dubbo就像在生产者和消费者中间架起了一座桥梁,使之能透明交互.本文旨在搭建一个可供使用和测试的dubbo环境,使用了spring ...

  9. 【2020-03-21】Dubbo本地环境搭建-实现服务注册和消费

    前言 本周主题:加班工作.本周内忙于CRUD不能自拔,基本每天都是九点半下班,下周上线,明天还要加班推进进度.今天是休息日,于是重拾起了dubbo,打算近期深入了解一下其使用和原理.之所以说是重拾,是 ...

随机推荐

  1. Python+PyQt 数据库基本操作

    Sqlite: 使用Python的sqlite3: 需要注意下commit方式与qt稍有不同 import sqlite3 class DBManager(): def __init__(self): ...

  2. IBM MQ

    一,安装 1,先安装必备MQ\MQ60\Prereqs\IES\Setup.exe 2,再安装MQ\MQParms.exe 二,发送方 刚装好后,默认有一个管理器名,可以删除,自己重新建,以防有不可知 ...

  3. iOS 基础 第四天(0809)

    0809 - 内存管理,只对oc对象生效. alloc.retain.release.retainCount 局部变量是放在栈里面的,oc对象是放在堆里面的.栈里面的内容系统自动回收,而堆里面的内容还 ...

  4. sharepoint 2010 masterpage中必须的Content PlaceHolder

    Professional SharePoint 2010 Branding and Use

  5. 【转】代码控制UI,View

    [转]Android 步步为营 第5营 代码控制UI,View   http://www.cnblogs.com/vivid-stanley/archive/2012/08/22/2651399.ht ...

  6. 字符串截取 方法 String b=a.substring(0, a.indexOf("乘坐"));

    String b=a.substring(0, a.indexOf("乘坐"));

  7. 1055: [HAOI2008]玩具取名 - BZOJ

    Description 某人有一套玩具,并想法给玩具命名.首先他选择WING四个字母中的任意一个字母作为玩具的基本名字.然后他会根据自己的喜好,将名字中任意一个字母用“WING”中任意两个字母代替,使 ...

  8. MVC4多语言IHttpModule实现

    最近项目需要多语言环境了. 由于项目页面较多,逐个Action去读取资源文件不大现实.就想到了使用 IHttpModule配合MVC的路由规则来实现. 首先创建以个mvc4的应用程序,添加资源文件夹( ...

  9. uva 10306

    有点不同的完全背包问题  但思路还是一样的 /************************************************************************* > ...

  10. spoj 665

    直接判  没什么算法  也没什么技巧  水水~~ #include <cstdio> #include <cstring> #include <algorithm> ...