weed shell starts an interactive console to do some maintenance operations.

    1. $ weed shell
    2. > help
    3. Type: "help <command>" for help on <command>
    4. collection.delete # delete specified collection
    5. collection.list # list all collections
    6. ec.balance # balance all ec shards among all racks and volume servers
    7. ec.decode # decode a erasure coded volume into a normal volume
    8. ec.encode # apply erasure coding to a volume
    9. ec.rebuild # find and rebuild missing ec shards among volume servers
    10. fs.cat # stream the file content on to the screen
    11. fs.cd # change directory to http://<filer_server>:<port>/dir/
    12. fs.du # show disk usage
    13. fs.ls # list all files under a directory
    14. fs.meta.cat # print out the meta data content for a file or directory
    15. fs.meta.load # load saved filer meta data to restore the directory and file structure
    16. fs.meta.notify # recursively send directory and file meta data to notifiction message queue
    17. fs.meta.save # save all directory and file meta data to a local file for metadata backup.
    18. fs.mv # move or rename a file or a folder
    19. fs.pwd # print out current directory
    20. fs.tree # recursively list all files under a directory
    21. volume.balance # balance all volumes among volume servers
    22. volume.copy # copy a volume from one volume server to another volume server
    23. volume.delete # delete a live volume from one volume server
    24. volume.fix.replication # add replicas to volumes that are missing replicas
    25. volume.list # list all volumes
    26. volume.mount # mount a volume from one volume server
    27. volume.move # move a live volume from one volume server to another volume server
    28. volume.tier.download # download the dat file of a volume from a remote tier
    29. volume.tier.upload # upload the dat file of a volume to a remote tier
    30. volume.unmount # unmount a volume from one volume server

    For example:

    1. $ weed shell
    2. > fs.du http://localhost:8888/some/
    3. block: 4 byte: 4012896 /some/path
    4. 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:

    1. # check any volume that are under replicated, and there are servers that meet the replica placement requirement
    2. $ echo "volume.fix.replication -n " | weed shell
    3. replicating volume 241 001 from localhost:8080 to dataNode 127.0.0.1:7823 ...
    4. # found one, let's really do it
    5. $ echo "volume.fix.replication" | weed shell
    6. replicating volume 241 001 from localhost:8080 to dataNode 127.0.0.1:7823 ...
    7. # all volumes are replicated now
    8. $ echo "volume.fix.replication -n" | weed shell
    9. no under replicated volumes