zookeeper客户端命令行使用

连接服务器

\bin]$ zkCli.cmd -server 10.242.117.93:2181

帮助

[zk: 10.242.117.93:2181(CONNECTED) 0] help                                                                                 
ZooKeeper -server host:port cmd args                                                                                       
        stat path [watch]                                                                                                  
        set path data [version]                                                                                            
        ls path [watch]                                                                                                    
        delquota [-n|-b] path                                                                                              
        ls2 path [watch]                                                                                                   
        setAcl path acl                                                                                                    
        setquota -n|-b val path                                                                                            
        history                                                                                                            
        redo cmdno                                                                                                         
        printwatches on|off                                                                                                
        delete path [version]                                                                                              
        sync path                                                                                                          
        listquota path                                                                                                     
        rmr path                                                                                                           
        get path [watch]                                                                                                   
        create [-s] [-e] path data acl                                                                                     
        addauth scheme auth                                                                                                
        quit                                                                                                               
        getAcl path                                                                                                        
        close                                                                                                              
        connect host:port 

退出

[zk: 10.242.117.93:2181(CONNECTED) 2] quit   

创建节点

[zk: 10.242.87.55] create /zkconfig/test/ttss "11"

显示节点

[zk: 10.242.87.55] ls /zkconfig/test/ttss

显示节点数据

[zk: 10.242.87.55] get  /zkconfig/test/ttss

删除节点

[zk: 10.242.87.55] delete  /zkconfig/test/ttss

递归删除节点

[zk: 10.242.87.55(CONNECTED) 12] rmr  /zkconfig/test

修改节点数据

[zk: 10.242.87.55] set  /zkconfig/test/ttss "system.config"

创建临时节点

[zk: 10.242.87.55] create -e /zkconfig/test/mmnn  88888

节点状态

[zk: 10.242.87.55] stat /zkconfig/test

创建有序永久节点

[zk: 10.242.87.55] create -s  /zkconfig/test/p pppp
Created /zkconfig/test/p0000000003

[zk: 10.242.87.55,] create -s  /zkconfig/test/p kkkk
Created /zkconfig/test/p0000000004

[zk: 10.242.87.55] ls /zkconfig/test
[p0000000003, ttss, p0000000004]

 

你可能感兴趣的:(zookeeper)