浏览 349
分享
weed shell
starts an interactive console to do some maintenance operations.
$ weed shell
> help
Type: "help <command>" for help on <command>
collection.delete # delete specified collection
collection.list # list all collections
ec.balance # balance all ec shards among all racks and volume servers
ec.decode # decode a erasure coded volume into a normal volume
ec.encode # apply erasure coding to a volume
ec.rebuild # find and rebuild missing ec shards among volume servers
fs.cat # stream the file content on to the screen
fs.cd # change directory to http://<filer_server>:<port>/dir/
fs.du # show disk usage
fs.ls # list all files under a directory
fs.meta.cat # print out the meta data content for a file or directory
fs.meta.load # load saved filer meta data to restore the directory and file structure
fs.meta.notify # recursively send directory and file meta data to notifiction message queue
fs.meta.save # save all directory and file meta data to a local file for metadata backup.
fs.mv # move or rename a file or a folder
fs.pwd # print out current directory
fs.tree # recursively list all files under a directory
volume.balance # balance all volumes among volume servers
volume.copy # copy a volume from one volume server to another volume server
volume.delete # delete a live volume from one volume server
volume.fix.replication # add replicas to volumes that are missing replicas
volume.list # list all volumes
volume.mount # mount a volume from one volume server
volume.move # move a live volume from one volume server to another volume server
volume.tier.download # download the dat file of a volume from a remote tier
volume.tier.upload # upload the dat file of a volume to a remote tier
volume.unmount # unmount a volume from one volume server
For example:
$ weed shell
> fs.du http://localhost:8888/some/
block: 4 byte: 4012896 /some/path
block: 5 byte: 4700786 /some
Another example: 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
评论列表