Install zookeeper under Linux (standalone version)

Source: Internet
Author: User
Tags serialization zookeeper

Install zookeeper under Linux (standalone version)

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.

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

2. upload the downloaded redis-3.2.1.tar.gz to /usr/local/src

3. Unzip:

[email protected] src]# tar Z x v F zookeeper-3.4.9.tar.gz

4. Renaming

[Email protected] src]# mv zookeeper-3.4.9 Zookeeper

5. Mobile

[email protected] src]# MV zookeeper/usr/local/

6. Modify the environment variables:

# Vim/etc/profile

At the end of the file add:

Export Zookeeper_home= /usr/local /zookeeper

Export path= $PATH: $ZOOKEEPER _home/bin

Re-apply:

Source/etc/profile

7. Modify the configuration file:

# cd/usr/local /zookeeper /conf

# CP Zoo_sample.cfg Zoo.cfg

Modify:

datadir=/usr/local /zookeeper /data

(Create the Data directory under /usr/local/zookeeper/directory )

8. Start

[Email protected] zookeeper]# zkserver.sh

To see if the startup was successful:

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8B/4A/wKioL1hJGrPCXVYWAAAdxeMVT9Q041.png-wh_500x0-wm_3 -wmp_4-s_2630763106.png "title=" image 1.png "alt=" wkiol1hjgrpcxvywaaadxemvt9q041.png-wh_50 "/>

9. Client Connection

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/4E/wKiom1hJGsHw2wVkAAKyM9MbRnU506.png-wh_500x0-wm_3 -wmp_4-s_3763840316.png "title=" image 2.png "alt=" wkiom1hjgshw2wvkaakym9mbrnu506.png-wh_50 "/>

common commands:

, use  LS  command to view the current  ZOOKEEPER 

, create a new  ZNODE    create /zk mydata   ZNODE  node "  zk  

, we run  GET  command to confirm   ZNODE&NBSP, Contains the string we created:

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

5, below we will just create the Znode Delete:

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8B/4E/wKiom1hJGtLC5AeRAACRXE4Bz1E103.png-wh_500x0-wm_3 -wmp_4-s_1778951803.png "title=" image 3.png "alt=" wkiom1hjgtlc5aeraacrxe4bz1e103.png-wh_50 "/>

Zookeeper command-line operations:

run zkcli.sh–server <ip> go to command line tool

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8B/4A/wKioL1hJGt7CxOoRAABSfZc_rPQ026.png-wh_500x0-wm_3 -wmp_4-s_3458576907.png "title=" image 4.png "alt=" wkiol1hjgt7cxooraabsfzc_rpq026.png-wh_50 "/>

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


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.