First step: Unzip the ZK tar package to/opt
TAR-ZXVF zookeeper-3.4.5.tar.gz-c/opt
Step Two: rename it to zookeeper
MV Zookeeper-3.4.5/zookeeper
Step Three: Modify environment Variables
vi/etc/profile
Export Zookeeper_home=/opt/zookeeper export java_home=/opt/jdk1.7.0_71 export path=.: $JAVA _home/bin: $ZOOKEEPER _h Ome/bin: $PATH
Fourth Step: Refresh profile configuration file
Source/etc/profile
Fifth Step: Configure Zookeeper
to modify the configuration file under Zookeeper:
1 . Rename the zoo_sample.cfg under Zookeeper/conf to Zoo.cfg
MV Zoo_sample.cfg Zoo.cfg
2. Modify the zoo.cfg file
A, modify DataDir to save the data directory
Datadir=/opt/zookeeper/data
B. add the last side
server.0=192.168.91.3:2888:3888 #如果有多个 #server. 1=192.168.91.4:2888:3888 #server. 2=192.168.91.5: 2,888:3,888
3. Create the Data folder below zookeeper
mkdir data
4. Create the myID file under the Data folder and fill in the appropriate content
VI myID
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/8C/32/wKioL1hk_mGhkAdAAAAFVkG02uA870.png "title=" _) q_ EFI4) 3f3403p61om ' 47.png "alt=" Wkiol1hk_mghkadaaaafvkg02ua870.png "/>
Sixth step: Start
Path:/usr/local/zookeeper/bin
execution:zkserver.sh start
Status:zkserver.sh status
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8C/35/wKiom1hlFGng30KEAAA5Uj1CIbc352.png "title=" EFJRC9 {3Q] P ' 6cdh8mdc{(6.png "alt=" Wkiom1hlfgng30keaaa5uj1cibc352.png "/>
This article is from "I Love Big gold" blog, please be sure to keep this source http://1754966750.blog.51cto.com/7455444/1887486
Linux Learning: Building a zookeeper environment