zookeeper learning environment to build a cluster -3

Installation preparation:

1, the installation JDK

1) extracting installation package
     the tar -zxvf JDK-7u45-Linux-x64.tar.gz -C Apps /
2) modify environment variables
      vi / etc / profile
    in file add
      Export the JAVA_HOME = / the root / Apps / jdk1.7.0_45
      Export PATH = $ PATH: $ JAVA_HOME / bin
     save and exit

3) then reload the environment variable
    source / etc / profile

2, upload the installation package zookeeper

Installation zookeeper

1, extracting archive

tar -zxvf zookeeper-3.4.5.tar.gz -C /usr/local

2, zoo.cfg modify configuration files, configuration zookeeper cluster machine

3, create a data storage path

mkdir -p  /usr/local/data/zkdata

4, generating myid

echo 2 > myid

5, the zookeeper copied to the other two machines

scp -r zookeeper-3.4.5 root@mini1:/usr/local

scp -r zookeeper-3.4.5 root@mini2:/usr/local

6, create a data storage path and on the other two machines generate myid

mkdir -p  /usr/local/data/zkdata

echo 1 > myid

7, start zookeeper

/usr/local/zookeeper-3.4.5/bin/zkServer.sh start

8 role, see the zookeeper

/usr/local/zookeeper-3.4.5/bin/zkServer.sh status

 

Guess you like

Origin www.cnblogs.com/zzzmublog/p/11125632.html