際際滷

際際滷Share a Scribd company logo
Create Znodes
=============
Syntax
------
create /path /data
create -s /path /data
create -e /path /data
Ex
--
create /FirstZnode "Myfirstzookeeper-app"
create -s /FirstZnode "second-data"
create -e /SecondZnode "Ephemeral-data"
--------------------------------------------------------------------------------
------------------------------------------------------
Get Data of a znode
===================
Syntax
------
get /path
Ex
--
get /FirstZnode
get /FirstZnode0000000003
--------------------------------------------------------------------------------
------------------------------------------------------
Watch Znode for Changes
=======================
Syntax
------
get /path [watch] 1
Ex
--
get /FirstZnode 1
--------------------------------------------------------------------------------
------------------------------------------------------
Set Data of a znode
===================
Syntax
------
set /path /data
Ex
--
set /SecondZnode "Data-updated"
set /FirstZnode "Mysecondzookeeper-app"
--------------------------------------------------------------------------------
------------------------------------------------------
Create Children of a znode
==========================
Syntax
------
create /parent/path/subnode/path /data
Ex
--
create /FirstZnode/Child1 "firstchildren"
create /FirstZnode/Child2 "secondchildren"
--------------------------------------------------------------------------------
------------------------------------------------------
List children of a znode
========================
Syntax
------
ls /path
Ex
--
ls /FirstZnode
--------------------------------------------------------------------------------
------------------------------------------------------
Check Status of a znode
=======================
Syntax
------
stat /path
Ex
--
stat /FirstZnode
--------------------------------------------------------------------------------
------------------------------------------------------
Remove / Delete a znode
=======================
Syntax
------
rmr /path
delete /path
Ex
--
rmr /FirstZnode
delete /FirstZnode
Verification
------------
get /FirstZnode

More Related Content

Quick reference for zookeeper commands

  • 1. Create Znodes ============= Syntax ------ create /path /data create -s /path /data create -e /path /data Ex -- create /FirstZnode "Myfirstzookeeper-app" create -s /FirstZnode "second-data" create -e /SecondZnode "Ephemeral-data" -------------------------------------------------------------------------------- ------------------------------------------------------ Get Data of a znode =================== Syntax ------ get /path Ex -- get /FirstZnode get /FirstZnode0000000003 -------------------------------------------------------------------------------- ------------------------------------------------------ Watch Znode for Changes ======================= Syntax ------ get /path [watch] 1 Ex -- get /FirstZnode 1 -------------------------------------------------------------------------------- ------------------------------------------------------ Set Data of a znode =================== Syntax ------ set /path /data Ex -- set /SecondZnode "Data-updated" set /FirstZnode "Mysecondzookeeper-app" -------------------------------------------------------------------------------- ------------------------------------------------------ Create Children of a znode ========================== Syntax ------ create /parent/path/subnode/path /data Ex -- create /FirstZnode/Child1 "firstchildren" create /FirstZnode/Child2 "secondchildren" -------------------------------------------------------------------------------- ------------------------------------------------------ List children of a znode
  • 2. ======================== Syntax ------ ls /path Ex -- ls /FirstZnode -------------------------------------------------------------------------------- ------------------------------------------------------ Check Status of a znode ======================= Syntax ------ stat /path Ex -- stat /FirstZnode -------------------------------------------------------------------------------- ------------------------------------------------------ Remove / Delete a znode ======================= Syntax ------ rmr /path delete /path Ex -- rmr /FirstZnode delete /FirstZnode Verification ------------ get /FirstZnode