From 206887f1d2a161724d1a6803609969674d12b5ce Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 23 Mar 2019 14:14:10 -0700 Subject: [PATCH] Created weed shell (markdown) --- weed-shell.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 weed-shell.md diff --git a/weed-shell.md b/weed-shell.md new file mode 100644 index 0000000..3f30ea4 --- /dev/null +++ b/weed-shell.md @@ -0,0 +1,33 @@ +`weed shell` starts an interactive console to do some maintenance operations. + +Here are some operations currently support +* For master and volume servers + * list all collections + * list all volumes + * fix volumes that are under replicated +* For filer + * show disk usage for a folder or file + +For example: +``` +$ weed shell +> fs.du http://localhost:8888/some/ +block: 4 byte: 4012896 /some/path +block: 5 byte: 4700786 /some +``` + +Sometimes one of your volume server may go down, and a new volume server is added. Here is the command you can run to fix volumes that are under replicated: +``` +# check any volume that are under replicated, and there are servers that meet the replica placement requirement +$ echo "volume.fix.replication -n " | weed shell +replicating volume 241 001 from localhost:8080 to dataNode 127.0.0.1:7823 ... + +# found one, let's really do it +$ echo "volume.fix.replication" | weed shell +replicating volume 241 001 from localhost:8080 to dataNode 127.0.0.1:7823 ... + +# all volumes are replicated now +$ echo "volume.fix.replication -n" | weed shell +no under replicated volumes + +``` \ No newline at end of file