[转]ZooKeeper 集群环境搭建 (本机3个节点)
ZooKeeper 集群环境搭建 (本机3个节点)
是一个简单的分布式同步数据库(或者是小文件系统)
--------------------------------------------------------
1、建立目录
server1
server1/dataDir
server1/dataLogDir
server1/logs
server1/zookeeper3.4.6
server2
server2/dataDir
server2/dataLogDir
server2/logs
server2/zookeeper3.4.6
server3
server3/dataDir
server3/dataLogDir
server3/logs
server3/zookeeper3.4.6
-------------------------------------------------------
2、myid
server1/dataDir/myid
1
server2/dataDir/myid
2
server3/dataDir/myid
3
--------------------------------------------------------
3、zoo.cfg
server1/dataDir/zookeeper3.4.6/conf/zoo.cfg
tickTime=2000
initLimit=5
syncLimit=2
dataDir=D:/Tools/zookeeper3.4.6/server1/dataDir
dataLogDir=D:/Tools/zookeeper3.4.6/server1/dataLogDir
clientPort=2181
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889
server2/dataDir/zookeeper3.4.6/conf/zoo.cfg
tickTime=2000
initLimit=5
syncLimit=2
dataDir=D:/Tools/zookeeper3.4.6/server2/dataDir
dataLogDir=D:/Tools/zookeeper3.4.6/server2/dataLogDir
clientPort=2182
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889
server3/dataDir/zookeeper3.4.6/conf/zoo.cfg
tickTime=2000
initLimit=5
syncLimit=2
dataDir=D:/Tools/zookeeper3.4.6/server3/dataDir
dataLogDir=D:/Tools/zookeeper3.4.6/server3/dataLogDir
clientPort=2183
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889
--------------------------------------------------------
3、log4j.properties
server1/dataDir/zookeeper3.4.6/conf/log4j.properties
# Define some default values that can be overridden by system properties
zookeeper.root.logger=INFO, CONSOLE
zookeeper.console.threshold=INFO
zookeeper.log.dir=D:/Tools/zookeeper3.4.6/server1/logs
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=DEBUG
zookeeper.tracelog.dir=D:/Tools/zookeeper3.4.6/server1/logs
zookeeper.tracelog.file=zookeeper_trace.log
#
# ZooKeeper Logging Configuration
#
# Format is "<default threshold> (, <appender>)+
# DEFAULT: console appender only
log4j.rootLogger=${zookeeper.root.logger}
# Example with rolling log file
#log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE
# Example with rolling log file and tracing
#log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE
#
# Log INFO level and above messages to the console
#
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
#
# Add ROLLINGFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}
# Max log file size of 10MB
log4j.appender.ROLLINGFILE.MaxFileSize=10MB
# uncomment the next line to limit number of backup files
#log4j.appender.ROLLINGFILE.MaxBackupIndex=10
log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
#
# Add TRACEFILE to rootLogger to get log file output
# Log DEBUG level and above messages to a log file
log4j.appender.TRACEFILE=org.apache.log4j.FileAppender
log4j.appender.TRACEFILE.Threshold=TRACE
log4j.appender.TRACEFILE.File=${zookeeper.tracelog.dir}/${zookeeper.tracelog.file}
log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout
### Notice we are including log4j's NDC here (%x)
log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L][%x] - %m%n
[转]ZooKeeper 集群环境搭建 (本机3个节点)的更多相关文章
- zookeeper集群环境搭建详细图文教程
zookeeper集群环境搭建详细图文教程 zhoubang @ 2018-01-02 [文档大纲] 友情介绍 软件环境 注意点 环境安装 1. 新建用于存储安装包以及软件安装的目录 2. 下载安装z ...
- Linux环境下ZooKeeper集群环境搭建关键步骤
ZooKeeper版本:zookeeper-3.4.9 ZooKeeper节点:3个节点 以下为Linux环境下ZooKeeper集群环境搭建关键步骤: 前提条件:已完成在Linux环境中安装JDK并 ...
- Apache Zookeeper 集群环境搭建
Zookeeper 是 一个分布式.开放源码的分布式应用程序协调服务,是Google Chubby的一个开源实现,大多数的分布式应用都需要Zookeeper的支持,这篇文章先简单的和大家分享如何搭建一 ...
- hadoop2.x配合ZooKeeper集群环境搭建
前期准备就不详细说了,课堂上都介绍了1.修改Linux主机名2.修改IP3.修改主机名和IP的映射关系 ######注意######如果你们公司是租用的服务器或是使用的云主机(如华为用主机.阿里云主机 ...
- zookeeper集群环境搭建(使用kafka的zookeeper搭建zk集群)
---恢复内容开始--- 使用kafka的zookeeper来搞集群的话和单纯用zk的其实差不了多少. 0.说在前头,搭建kafka集群之前请把每个服务器的jdk搞起来. 1.安装kafka wget ...
- zookeeper集群环境搭建(纯zookeeper)
1.首先在三台机子上放上zookeeper的解压包,解压. 然后的话zookeeper是依赖于jdk的,那么也应该安装jdk,这里不详细说明了. mv zookeeper-3.4.5 zookeepe ...
- ZooKeeper 集群环境搭建 (本机3个节点)
--------------------------------------------------------1.建立目录server1server1/dataDirserver1/dataLogD ...
- ZooKeeper 介绍及集群环境搭建
本篇由鄙人学习ZooKeeper亲自整理的一些资料 包括:ZooKeeper的介绍,我们要学习ZooKeeper的话,首先就要知道他是干嘛的对吧. 其次教大家如何去安装这个精巧的智慧品! 相信你能研究 ...
- 【Zookeeper】集群环境搭建
一.概述 1.1 Zookeeper的角色 1.2 Zookeeper的读写机制 1.3 Zookeeper的保证 1.4 Zookeeper节点数据操作流程 二.Zookeeper 集群环境搭建 2 ...
随机推荐
- WDA基础三:简单的INPUT选择,简单的TABLE显示
先从基本的开始,简单的单选和TABLE显示 1.创建选择条件节点,CONTEXT页签,右键CONTEXT创建NODE,对应1:1 1:1 lead selection 2.创建结果节点,对应0:n ...
- [LeetCode] 23. Merge k Sorted Lists ☆☆☆☆☆
转载:https://leetcode.windliang.cc/leetCode-23-Merge-k-Sorted-Lists.html 描述 Merge k sorted linked list ...
- nodejs利用sequelize-auto 根据数据库的table 生成model
1.打开cmd命令窗口,安装sequelize-auto npm install -g sequelize-auto 在使用sequelize-auto之前需要安装全局的mysql(举例mysql) ...
- --save-dev 与 --save区别
npm install 在安装 npm 包时,有两种命令参数可以把它们的信息写入 package.json 文件,一个是npm install --save另一个是 npm install --sav ...
- grep console
FF6464 9F6B00 8A8A00 4B5E76 8A7674 980B4F 980B4F
- Mac下安装和配置Maven
1.下载Maven 官网:http://maven.apache.org/download.cgi 下载版本:apache-maven-3.5.3-bin.tar.gz 2.配置环境变量 打开term ...
- latex 公式距离
\setlength{\abovedisplayshortskip}{0cm} 公式和文本之间的间距 \setlength{\belowdisplayshortskip}{0cm} \setlengt ...
- samba共享文件夹设置
sudo apt-get install samba(4) mkdir /home/用户名/share (新建share文件夹) sudo cp /etc/samba/smb.conf /etc/sa ...
- laravel查找某个类拥有的方法:
1.在当前项目下,使用cmd窗口,输入: php artisan tinker 在输入: app('log') 显示出:Illuminate\Log\Writer 2.在phpstorm中按:shif ...
- Ubuntu16.04无法使用WiFi
本人联想431,安装ubuntu16.04 lts,打开之后没有wife,参考这个解决 http://blog.csdn.net/bubblem/article/details/53575017 U ...