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,打算近期深入了解一下其使用和原理.之所以说是重拾,是 ...
随机推荐
- 在emacs里用w3m浏览网页
给w3m配置个~/.emacs老是暴错误,在配置里把这个注掉就OK了;(require 'mime-w3m) ;;支持w3m (add-to-list 'load-path "/usr/sh ...
- 八、mysql视图、存储过程、函数以及时间调度器
.create or replace view emp_view as select * from t4 ;给t4表创建一个名为emp_view的视图 .drop view emp_view 删除视图 ...
- SQL Server 2008 的gis函数
居然不知道sql有gis函数,孤陋寡闻了 https://msdn.microsoft.com/zh-cn/library/bb933904.aspx STContains(geometry 数据 ...
- Solr + Hadoop = Big Data Love
FROM:http://architects.dzone.com/articles/solr-hadoop-big-data-love 许多人使用Hadoop的开源项目来处理大数据的大数据集,因为它是 ...
- python学习笔记6(字典)
映射:键值对的关系,键(key)映射值(value) 字典是Python唯一的映射类型 >>> phonebook = {'} >>> phonebook {'} ...
- poj 1236 Network of Schools(又是强连通分量+缩点)
http://poj.org/problem?id=1236 Network of Schools Time Limit: 1000MS Memory Limit: 10000K Total Su ...
- 【分块】bzoj3343: 教主的魔法
3343: 教主的魔法 Time Limit: 10 Sec Memory Limit: 256 MBSubmit: 631 Solved: 272[Submit][Status][Discuss ...
- Matlab中rand('state',sum(clock))解析
一.问题来源 来自于一份PSO代码,PSO中需要初始化粒子位置和速度. 二.问题探究 众所周知,Matlab中的rand()函数产生的是伪随机数,但一般用来也可以接受.但是,如果我们知道伪随机数的初始 ...
- Eclipse console文本换行
Eclipse换行主要有3个方面 格式化时编辑器文本换行 源代码注释文本换行 Eclipse控制台console显示文本换行 1和2参考 http://hi.baidu.com/ae6623/item ...
- XML 创建
using unityEngine; using System.Collections; using System.Linq; using System.Xml.Linq; using System; ...