Updated Mount Remote Storage (markdown)

Chris Lu 2021-08-12 01:01:58 -07:00
parent 4fa9299489
commit ed6b438352

@ -3,6 +3,15 @@ After [[Configure Remote Storage]], you will get a storage name `cloud1`.
## Mount a Remote Storage
Now you can run `remote.mount` in `weed shell`:
```
> remote.mount -h
Usage of remote.mount:
-dir string
a directory in filer
-nonempty
allows the mounting over a non-empty directory
-remote string
a directory in remote storage, ex. <storageName>/<bucket>/path/to/dir
> help remote.mount
remote.mount # mount remote storage and pull its metadata
@ -27,6 +36,17 @@ This operation will pull down all metadata from the remote storage.
Later, any metadata operations can be invoked locally, and respond very fast.
`unmount` will drop all local metadata and cached file content.
### Repeatedly Update Metadata
Sometimes the data on the cloud has changed and local metadata becomes stale. To `unmount` first and `mount` again is costly since all data has to be cached again. To refresh the metadata changes, you can simply re-run the same command with `-nonempty` option, e.g.:
```
remote.mount -dir=xxx -remote=cloud1/bucket -nonempty
```
This will update local metadata accordingly and still keep file contents that are not changed.
If the data on the cloud is changed often, you can add this command to the admin scripts defined in `master.toml`, to run it regularly.
## Write Back changes to Remote Storage
If the mounted directory is only for reading, you can start to use it.