Install zookeeper under Linux (standalone version)

Source: Internet
Author: User
Tags serialization zookeeper

Zookeeper Distributed Service Framework is used to solve some data management problems commonly encountered in distributed applications, such as: Unified Naming Service, State Synchronization service, cluster management, distributed application configuration item management, etc. This paper mainly introduces the installation, configuration and application of zookeeper from the angle of users.

Stand-alone mode

Zookeeper can be installed in a single machine, this application mode is mainly used in the test or demo case, in the production environment is generally not used.

1. You can first download the latest installation package from Zookeeper's official website: http://www.apache.org/dist/zookeeper/

2. Upload the zookeeper-3.4.8.tar.gz to the/home/hadoop directory that you just downloaded

3, Decompression:

TAR-ZXVF zookeeper-3.4.8.tar.gz

4. Rename:

MV Zookeeper-3.4.8.tar.gz Zookeeper

5. Modify Environment variables:

Vim/etc/profile

At the end of the file add:

Export Zookeeper_home=/home/hadoop/zookeeperexport path= $PATH: $ZOOKEEPER _home/bin

Recompile the file:

Source/etc/profile

6, modify the Zookeeper configuration file

CD/HOME/HADOOP/ZOOKEEPER/CONFCP zoo_sample.cfg Zoo.cfgvim zoo.cfg

Modify:

Datadir=/home/hadoop/zookeeper/data

(Create the Data directory under the/home/hadoop/zookeeper/directory)

7. Start Zookeeper:

zkserver.sh

zkserver.sh status #可查看zookeeper是否正常启动, if normal startup should be as


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/8A/9F/wKiom1g1XLGCy55oAAAocIgiWTA665.png "title=" 2.png " alt= "Wkiom1g1xlgcy55oaaaocigiwta665.png"/>

8. Client Connection Zookeeper

zkcli.sh

Connect to Zkserver after a few seconds:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8A/9C/wKioL1g1XXrSxDgJAACvOq9LslU664.png "title=" 333. PNG "alt=" Wkiol1g1xxrsxdgjaacvoq9lslu664.png "/>

To this zookeeper has been installed and started to complete 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0028.gif "alt=" J_0028.gif "/>


Zookeeper command-line operations:

Run zkcli.sh– Server <ip> go to command line tool

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/8a/a0/wkiom1g1y5md_bxjaaswx2hnsqw153.png "title=" 33311.png "alt=" wKiom1g1Y5mD_ Bxjaaswx2hnsqw153.png "/>

Analysis Creation Node:

-S: Serialization

-E: Short.

Type:

To create a transient non-serialized node:-E

Create short Serialization:-S – e

Create persistent non-serialization: Empty

Create persistent Serialization:-S

1. Use ls command to view the current ZooKeeper What is included in the:

[Zk:202.115.36.251:2181 (CONNECTED) 1] LS/

2. Create a new Znode , using Create/zk MyData . This command creates a new Znode node " ZK " and the string associated with it:

[Zk:202.115.36.251:2181 (CONNECTED) 2] Create/zk MyData

3. We run Get command to confirm Znode whether to include the string we created:

[Zk:202.115.36.251:2181 (CONNECTED) 3] Get/zk

4, below we pass Set command to ZK to set the associated string:

[Zk:202.115.36.251:2181 (CONNECTED) 4] set/zk "ZSL"

5, below we will just create the Znode Delete:

[Zk:202.115.36.251:2181 (CONNECTED) 5] Delete/zk

This article is from the "Simplelife" blog, make sure to keep this source http://simplelife.blog.51cto.com/9954761/1875882

Install zookeeper under Linux (standalone version)

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.