25

For deleting a node in zookeeper from command line interface there is a delete command. When I run it, it says:

Node not empty: /testNode

I am using this guide.

Gordon Gustafson
  • 40,133
  • 25
  • 115
  • 157
Amit Kumar
  • 2,685
  • 2
  • 37
  • 72

3 Answers3

55

The zkCli provides the rmr (deprecated) or deleteall command for this purpose. It will recursively delete all nodes under the path. This command did not appear until version 3.4.0. The documentation link you provided is for version 3.3.3.

Martin Serrano
  • 3,727
  • 1
  • 35
  • 48
1

deleteall nodeName

For example: deleteall /hbase works for me in hbase 2.4.1

Xiaoming Dou
  • 151
  • 2
  • 2
0

I use the following command in Java:

zkClient.deleteRecursive(ZkUtils.getTopicPath(topicName));

Vaibhav Desai
  • 2,334
  • 2
  • 25
  • 29
  • Looks like the same does Zk Cli according to `org.apache.zookeeper.cli.DeleteAllCommand#exec` – XZen Dec 15 '22 at 13:13