dubbo + zookeeper 环境搭建
一、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 环境搭建的更多相关文章
- 【转载】Maven+druid+MyBatis+Spring+Oracle+Dubbo开发环境搭建
原地址:http://blog.csdn.net/wp1603710463/article/details/48247817#t16 Maven+druid+MyBatis+spring+Oracle ...
- hadoop2.6.2+hbase+zookeeper环境搭建
1.hadoop环境搭建,版本:2.6.2,参考:http://www.cnblogs.com/bookwed/p/5251393.html 启动服务:在master机器上,进入hadoop安装目录, ...
- [转]云计算之hadoop、hive、hue、oozie、sqoop、hbase、zookeeper环境搭建及配置文件
云计算之hadoop.hive.hue.oozie.sqoop.hbase.zookeeper环境搭建及配置文件已经托管到githubhttps://github.com/sxyx2008/clou ...
- 【Hadoop离线基础总结】CDH版本的zookeeper环境搭建
CDH版本的zookeeper环境搭建 下载 下载地址 http://archive.cloudera.com/cdh5/cdh/5/ 修改配置文件 创建ZooKeeper数据存放目录 mkdir - ...
- Zookeeper+Dubbo+SpringMVC环境搭建
项目码云GIT地址:https://gitee.com/xshuai/dubbo/ 开发工具 MyEclipse 10.7 JDK 1.7 容器 Tomcat 8(运行dubbo) zookeeper ...
- zookeeper 环境搭建
1.准备三台服务器 ip分别为:192.168.100.128.192.168.100.129.192.168.100.133 a.修改主机名称 vi /etc/sysconfig/network 修 ...
- Dubbo简单环境搭建
Dubbo服务的发展和作用: 首先,看下一般网站架构随着业务的发展,逻辑越来越复杂,数据量越来越大,交互越来越多之后的常规方案演进历程. 其次,当服务越来越多之后,我们需要做哪些服务治理? 最后,是d ...
- Dubbo系列(二)dubbo的环境搭建
dubbo是一个分布式服务框架,提供一个SOA的解决方案.简单的说,dubbo就像在生产者和消费者中间架起了一座桥梁,使之能透明交互.本文旨在搭建一个可供使用和测试的dubbo环境,使用了spring ...
- 【2020-03-21】Dubbo本地环境搭建-实现服务注册和消费
前言 本周主题:加班工作.本周内忙于CRUD不能自拔,基本每天都是九点半下班,下周上线,明天还要加班推进进度.今天是休息日,于是重拾起了dubbo,打算近期深入了解一下其使用和原理.之所以说是重拾,是 ...
随机推荐
- 由底层和逻辑说开去——c++之类与对象的深入剖析
类是什么,对象是什么, 这两个问题在各个c++书里面都以一种抽象的描述方式,给了我们近乎完美的答案,然后我好像就知道什么是类什么是对象了,但是当扪心自问,类在哪儿,对象在哪儿,成员方法在哪儿,成员变 ...
- String Subtraction
Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining string after taking all the ...
- 【转】O'Reilly Java系列书籍建议阅读顺序(转自蔡学庸)
Learning Java the O'Reilly's Way (Part I) Java 技术可以说是越来越重要了,不但可以用在计算机上,甚至连电视等家电用品,行动电话.个人数字助理(PDA)等电 ...
- ios app - 打开系统设置URL
ios --- 调用系统"设置"里的功能(转) 安装后第一次运行软件时,系统会弹出提示用户是否允许软件获取当前位置,如果用户不允许的话,之后运行时系统不会在弹出提示设置,这点很不方 ...
- 相似元素存在的意义---HTML&CSS
1.<q> 效果: 告诉浏览器这是一段短引用,让浏览器以合适的方法来显示 注: 不能直接以双引号直接代替<q>,因为有些浏览器<q>的效果不是双引号. 不要忘了移动 ...
- 严重: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it.
今日在重新部署项目时出现此问题,虽然对项目无影响,但问题就是问题.完整信息如下(使用idea工具): 十二月 05, 2015 11:44:27 上午 org.apache.catalina.star ...
- CQRS学习——一个例子(其六)
[先上链接:http://pan.baidu.com/s/1o62AHbc ] 多图杀猫 先用一组图看看实现的功能: 添加一个功能 假定现在要添加一个书本录入的功能,那么执行如下的操作: 1.添加Co ...
- 深入了解nagios的各配置文件
转自http://wolfword.blog.51cto.com/4892126/1220209 对每个配置文件进行讲解,深入理解nagios,好好学习,天天向上~ (1)templates.cf ...
- 正确使用STL-MAP中Erase函数
一切尽在代码中. #include <iostream> #include <map> #include <string> using namespace std ...
- POJ1002487-3279(map)
http://poj.org/problem?id=1002 题意:是说很多公司用了容易记住的电话号码,例如有英文字母的或者是用了很多连字符或没有连字符的.每个电话号码都有标准模式,而为了统计有没有重 ...