1. Download zookeeper-3.4.6.tar.gz
2. Decompression Compression Package TAR-ZXVF zookeeper-3.4.6.tar.gz
3. Rename folder zookeeper-3.4.6 to Zookeeper1
4. The same steps performed 2 times
5.CD zookeeper1/conf/
6.VI zoo.cfg
7. Modify the directory where the zookeeper saves data--------Datadir=/opt/
Zookeeper itself is not to provide load balancing strategy, need to implement themselves, so here is exactly, in the load balancer applied to the zookeeper to do the coordination of the cluster.For load balancing of HTTP requests, the mature solution is nginx (or haproxy) +keepalived. Where Niginx is responsible for proxy HTTP requests, through some kind of equalization policy to access the server in the
://s3.51cto.com/wyfs02/M00/8C/8A/wKiom1hvQcnyJRLvAABVaQSSoYI199.png "title=" 1.png "alt=" Wkiom1hvqcnyjrlvaabvaqssoyi199.png "/>At this point the entire ZK cluster is built and started to complete.Validation resultsThe configuration tool for zookeeper is called Zooinspector, which is:Https://issues.apache.org/jira/secure/attachment/12436620/ZooInspector.zip, download the direct decompression can be used in
Brief introductionMesosphereMesosMarathonZookeeperThe Mesos/marathon configuration file for master, which ensures that Master is more lightweight.Presumably for these concepts, to find here is basically to know what they are doing, here is no nonsense. Do not know can be self-repairing.
Environment:
Hostname
Function
IP Address
Master1
Mesos Master
172.18.2.94
Master2
Mesos Master
172.18.2.95
Master3
Installation of ZookeeperTAR-ZXVF zookeeper-3.4.8.tar.gzMV zookeeper-3.4.8/usr/local/Modifying ZK's configuration fileCP Zoo_sample.cfg Zoo.cfg
ticktime:zookeeper.
datadir: Data Catalog. Can be any directory. The
datalogdir:log directories can also be any directory. If this parameter is not set, the same settings are used and DataDir.
clientport: Listening for the port
First, the server environment basic configuration1. Configure the host name Mapping in the/etc/hosts file1, such as 3 host IP 192.168.1.101,192.168.1.102.192.168.1.103, configure the corresponding host alias Zk1,zk2,zk3192.168.1.101 zk1192.168.1.102 zk2192.168.1.103 zk3Ii. Zookeeper Deployment 1, install zookeeper package or download unzip package1, immediately send out: http://apache.fayea.com/
Working with scenes
The entire system is divided into master and server two roles, and each master and server needs to know the list of servers currently available within the cluster.
The original processing mode: Master is responsible for the collection and distribution of cluster server information. Server startup and master establish long connections and heartbeat detection, master collects new and disc
1.zookeeper InstallationMove the extracted files from the desktop to the installation directory softwareExtractShow FilesModify the Zoo.cfg fileMy Cong is the mainframe.Note: If more than one cluster machine should matchCreate DataDir specify directories and create myID filesI was on a machine, the host is the cluster machine, if you want to configure more than o
Installation of ZookeeperTAR-ZXVF zookeeper-3.4.8.tar.gzMV zookeeper-3.4.8/usr/local/Modifying ZK's configuration fileCP Zoo_sample.cfg Zoo.cfg
ticktime:zookeeper.
datadir: Data Catalog. Can be any directory. The
datalogdir:log directories can also be any directory. If this parameter is not set, the same settings are used and DataDir.
clientport: Listening for the port
Dubbo How to use please refer to my previous article: Dubbo Distributed Service Framework and Springmvc+zookeeper implementation service delivery and consumption
This article continues to delve into the previous content and to organize more detailed documentation: http://pan.baidu.com/s/1kUMx3inDubbo and Zookeeper cluster architecture
Tomcat registration servic
We are reading some of the source code, if you can debug the source will greatly improve our reading efficiency. Recently in learning zookeeper source code, sharing under How to debug zookeeper cluster.Zookeeper code, Debug Environment Setup1. Download zookeeper3.4.9Copy 3 copies for Node0, Node1, Node22. Modify Zoo.cfgAdd toserver.1=127.0.0.1:3330:4440server.2=127.0.0.1:3331:4441server.3=127.0.0.1:3332:444
Synchronize the cluster configuration with ZooKeeper, when you need to modify all the node configuration, update the configuration to a node of ZooKeeper, causing the node data to change,Local watcher on all other nodes that need to be configured synchronously immediately discovers the change in node state and updates the latest data to a localChange the official
The first attempt to build a ZK cluster on Windows is done on the basis of a single-machine ZK.The Zoo.cfg file is displayed as follows and can be started normally.#The number of milliseconds of each tickticktime=2000#The number of ticks that initial#synchronization phase can takeinitlimit=10#The number of ticks that can pass between#sending a request and getting an acknowledgementSynclimit=5#The directory where the snapshot is stored.#Don't use/tmp f
First, prepare three Linux virtual machinesthree machines centos01:192.168.1.168(lxs001) centos03:192.168.1.178( lxs003) centos03:192.168.1.188(lxs003) three machinesDownload Zookeeper:go to opt catalogueDownload Zookeeper:wget http://apache.fayea.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gzDecompression ZOOKEEPER:TAR-ZXVF
Create zoo1.cfg,zoo2.cfg,zoo3.cfg under the Conf directoryZoo1.cfgticktime=2000initlimit=10synclimit=5datadir=e:\\programfiles\\zookeeper-3.4.10\\data\\1datalogdir=e:\\ Programfiles\\zookeeper-3.4.10\\logs\\1clientport=2181server.1=localhost:2287:3387server.2=localhost : 2288:3388server.3=localhost:2289:3389Zoo2.cfgticktime=2000initlimit=10synclimit=5datadir=e:\\programfiles\\
Zookeeper unable to start AdminServer, exiting abnormally when pseudo-cluster test on a single machineThe cause of this problem is known to everyone because after starting a zookeeper server, the default zkserver.cmd does not have a corresponding non-boot adminserver mask.The code in Adminserverfactory.java is as follows public static AdminServer Createadminserve
, indicating the success of the start;Next look at the cluster is the success of the build:Execution: Bin/zkcli.sh-server master:2181 (Master and slave1, choose one)Go to the Zookeeper Client command line below, execute LS/, will output [zookeeper], this time create a node create/test, and then view get/test, print the informationTestValueCzxid = 0x200000005CTime
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.