zookeeper清除历史hbase、storm等版本

 之前在集群上安装了hbase的一个版本,后来因该版本不稳定,切换为另一版本,这时候就需要清理zookeeper的记录了,具体方法如下:

1.切换到zookeeper的bin目录;

2.执行$sh zkCli.sh

[hadoop@host hadoop]$ cd zookeeper-3.4.5/bin
[hadoop@host bin]$ ./zkCli.sh 
Connecting to localhost:2181
2013-05-15 16:44:39,123 [myid:] - INFO  [main:Environment@100] - Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT
2013-05-15 16:44:39,131 [myid:] - INFO  [main:Environment@100] - Client environment:host.name=host
2013-05-15 16:44:39,132 [myid:] - INFO  [main:Environment@100] - Client environment:java.version=1.6.0_31
2013-05-15 16:44:39,133 [myid:] - INFO  [main:Environment@100] - Client environment:java.vendor=Sun Microsystems Inc.
2013-05-15 16:44:39,133 [myid:] - INFO  [main:Environment@100] - Client environment:java.home=/hadoop/jdk1.6.0_31/jre
2013-05-15 16:44:39,134 [myid:] - INFO  [main:Environment@100] - Client environment:java.class.path=/hadoop/zookeeper-3.4.5/bin/../build/classes:/hadoop/zookeeper-3.4.5/bin/../build/lib/*.jar:/hadoop/zookeeper-3.4.5/bin/../lib/slf4j-log4j12-1.6.1.jar:/hadoop/zookeeper-3.4.5/bin/../lib/slf4j-api-1.6.1.jar:/hadoop/zookeeper-3.4.5/bin/../lib/netty-3.2.2.Final.jar:/hadoop/zookeeper-3.4.5/bin/../lib/log4j-1.2.15.jar:/hadoop/zookeeper-3.4.5/bin/../lib/jline-0.9.94.jar:/hadoop/zookeeper-3.4.5/bin/../zookeeper-3.4.5.jar:/hadoop/zookeeper-3.4.5/bin/../src/java/lib/*.jar:/hadoop/zookeeper-3.4.5/bin/../conf:.:/hadoop/jdk1.6.0_31/lib:/hadoop/jdk1.6.0_31/jre/lib
2013-05-15 16:44:39,135 [myid:] - INFO  [main:Environment@100] - Client environment:java.library.path=/hadoop/jdk1.6.0_31/jre/lib/amd64/server:/hadoop/jdk1.6.0_31/jre/lib/amd64:/hadoop/jdk1.6.0_31/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2013-05-15 16:44:39,136 [myid:] - INFO  [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2013-05-15 16:44:39,136 [myid:] - INFO  [main:Environment@100] - Client environment:java.compiler=
2013-05-15 16:44:39,137 [myid:] - INFO  [main:Environment@100] - Client environment:os.name=Linux
2013-05-15 16:44:39,138 [myid:] - INFO  [main:Environment@100] - Client environment:os.arch=amd64
2013-05-15 16:44:39,139 [myid:] - INFO  [main:Environment@100] - Client environment:os.version=2.6.32-220.el6.x86_64
2013-05-15 16:44:39,140 [myid:] - INFO  [main:Environment@100] - Client environment:user.name=hadoop
2013-05-15 16:44:39,140 [myid:] - INFO  [main:Environment@100] - Client environment:user.home=/home/hadoop
2013-05-15 16:44:39,142 [myid:] - INFO  [main:Environment@100] - Client environment:user.dir=/hadoop/zookeeper-3.4.5/bin
2013-05-15 16:44:39,145 [myid:] - INFO  [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@3716ab4e
Welcome to ZooKeeper!
2013-05-15 16:44:39,248 [myid:] - INFO  [main-SendThread(localhost.localdomain:2181):ClientCnxn$SendThread@966] - Opening socket connection to server localhost.localdomain/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
JLine support is enabled
2013-05-15 16:44:39,265 [myid:] - INFO  [main-SendThread(localhost.localdomain:2181):ClientCnxn$SendThread@849] - Socket connection established to localhost.localdomain/127.0.0.1:2181, initiating session
2013-05-15 16:44:39,292 [myid:] - INFO  [main-SendThread(localhost.localdomain:2181):ClientCnxn$SendThread@1207] - Session establishment complete on server localhost.localdomain/127.0.0.1:2181, sessionid = 0x13e87cd8cd20073, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] help
ZooKeeper -server host:port cmd args
    connect host:port
    get path [watch]
    ls path [watch]
    set path data [version]
    rmr path
    delquota [-n|-b] path
    quit 
    printwatches on|off
    create [-s] [-e] path data acl
    stat path [watch]
    close 
    ls2 path [watch]
    history 
    listquota path
    setAcl path acl
    getAcl path
    sync path
    redo cmdno
    addauth scheme auth
    delete path [version]
    setquota -n|-b val path
[zk: localhost:2181(CONNECTED) 1] ls /
[hbase, test, zookeeper]
[zk: localhost:2181(CONNECTED) 2] rmr /hbase

3.输入‘ls /’

4.输入‘rmr /hbase’

5.退出

重启hbase即可。


此种方法也可以解决storm等其他zookeeper项目的切换版本问题。

你可能感兴趣的:(Hbase,云计算)