Getting started with zookeeper (2): getting started with zookeeper

Source: Internet
Author: User

Getting started with zookeeper (2): getting started with zookeeper

Install zookeeper

Standalone Mode

Download zookeeper-3.4.8.tar.gz

Create/usr/zookeeper and decompress it to the zookeeper directory.

[Root @ localhost zookeeper] # tar-zxvf zookeeper-3.4.8.tar.gz

Configure Environment Variables:

To facilitate future operations, we need to configure the Zookeeper environment variables by adding the following content to the/etc/profile file:

[Root @ localhost liutie] # vi/etc/profile

# Set java environment
JAVA_HOME =/usr/java/jdk1.8.0 _ 131
JRE_HOME =/usr/java/jdk1.8.0 _ 131/jre
ZOOKEEPER_HOME =/usr/zookpeer/zookpeer-3.4.8
CLASS_PATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JRE_HOME/lib
PATH = $ PATH: $ JAVA_HOME/bin: $ JRE_HOME/bin: ZOOKEEPER_HOME/bin

Make environment variables take effect

[Root @ localhost liutie] # source/etc/profile

Go to the bin directory of the zookeeper folder and change zoo_simple.cfg to zoo. cfg.

[Root @ localhost conf] # mv zoo_sample.cfg zoo. cfg

Modify zoo. cfg

[Root @ localhost conf] # vi zoo. 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 an acknowledgement  syncLimit=5  # the directory where the snapshot is stored.  # do not use /tmp for storage, /tmp here is just   # example sakes.  dataDir=/tmp/zookeeper  # the port at which the clients will connect  clientPort=2181  #  # Be sure to read the maintenance section of the   # administrator guide before turning on autopurge.  #  # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance  #  # The number of snapshots to retain in dataDir  #autopurge.snapRetainCount=3  # Purge task interval in hours  # Set to "0" to disable auto purge feature  #autopurge.purgeInterval=1 

Save and enter the bin directory to start the server.

[Root @ localhost bin] #./zkServer. sh start

ZooKeeper JMX enabled by default
Using config:/usr/zookeeper/zookeeper-3.4.8/bin/../conf/zoo. cfg
Starting zookeeper... already running as process 9176.

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.