diff --git a/docs/nydusd.md b/docs/nydusd.md index 1cf86bacdd3..4a92bc7ab59 100644 --- a/docs/nydusd.md +++ b/docs/nydusd.md @@ -8,27 +8,41 @@ Get `nydusd` binary from [release](https://github.com/dragonflyoss/image-service ## Run Nydusd Daemon -``` shell +```shell # Prepare nydusd configuration -cat /path/to/config-localfs.json +sudo tee /etc/nydus/nydusd-config.localfs.json > /dev/null << EOF { "device": { "backend": { "type": "localfs", "config": { - "dir": "/path/to/blobs", + "dir": "/var/lib/nydus/blobs" + } + }, + "cache": { + "type": "blobcache", + "config": { + "work_dir": "/var/lib/nydus/cache" } } - } + }, + "mode": "direct", + "digest_validate": false, + "iostats_files": false, + "enable_xattr": true } + +EOF ``` ### Run With FUSE If no `/path/to/bootstrap` is available, please refer to [nydus-image.md](https://github.com/dragonflyoss/image-service/blob/master/docs/nydus-image.md) for more details. ``` shell +sudo mkdir -p /var/lib/nydus/blobs/ +sudo mkdir -p /var/lib/nydus/cache/ sudo nydusd \ - --config /path/to/config-localfs.json \ + --config /etc/nydus/nydusd-config.localfs.json \ --mountpoint /path/to/mnt \ --bootstrap /path/to/bootstrap \ --log-level info @@ -41,7 +55,7 @@ Virtio-fs is supported by both [QEMU](https://www.qemu.org/) and [Cloud-hypervis ``` shell sudo nydusd \ - --config /path/to/config-localfs.json \ + --config /etc/nydus/nydusd-config.localfs.json \ --sock /path/to/vhost-user-fs.sock \ --bootstrap /path/to/bootstrap \ --log-level info diff --git a/docs/samples/blob_cache_entry_configuration_v2.toml b/misc/configs/nydusd-blob-cache-entry-configuration-v2.toml similarity index 100% rename from docs/samples/blob_cache_entry_configuration_v2.toml rename to misc/configs/nydusd-blob-cache-entry-configuration-v2.toml diff --git a/docs/samples/blob_cache_entry.toml b/misc/configs/nydusd-blob-cache-entry.toml similarity index 100% rename from docs/samples/blob_cache_entry.toml rename to misc/configs/nydusd-blob-cache-entry.toml diff --git a/docs/samples/boostrap_blob_cache_entry.json b/misc/configs/nydusd-boostrap-blob-cache-entry.json similarity index 100% rename from docs/samples/boostrap_blob_cache_entry.json rename to misc/configs/nydusd-boostrap-blob-cache-entry.json diff --git a/docs/samples/configuration_v2.toml b/misc/configs/nydusd-config-v2.toml similarity index 100% rename from docs/samples/configuration_v2.toml rename to misc/configs/nydusd-config-v2.toml diff --git a/misc/configs/nydusd-config.json b/misc/configs/nydusd-config.json index db3a9ac2de9..044a0e91bc9 100644 --- a/misc/configs/nydusd-config.json +++ b/misc/configs/nydusd-config.json @@ -3,25 +3,26 @@ "backend": { "type": "registry", "config": { - "scheme": "http", "timeout": 5, "connect_timeout": 5, - "retry_limit": 0 + "retry_limit": 2 } }, "cache": { "type": "blobcache", "config": { - "work_dir": "/cache" + "work_dir": "/var/lib/nydus/cache" } } }, "mode": "direct", "digest_validate": false, - "iostats_files": true, + "iostats_files": false, "enable_xattr": true, "fs_prefetch": { "enable": true, - "threads_count": 4 + "threads_count": 8, + "merging_size": 1048576, + "prefetch_all": true } -} +} \ No newline at end of file diff --git a/misc/example/nydusd-config.json b/misc/example/nydusd-config.json index aa167af5d02..044a0e91bc9 100644 --- a/misc/example/nydusd-config.json +++ b/misc/example/nydusd-config.json @@ -3,25 +3,26 @@ "backend": { "type": "registry", "config": { - "scheme": "http", "timeout": 5, "connect_timeout": 5, - "retry_limit": 0 + "retry_limit": 2 } }, "cache": { "type": "blobcache", "config": { - "work_dir": "cache" + "work_dir": "/var/lib/nydus/cache" } } }, "mode": "direct", "digest_validate": false, - "iostats_files": true, - "enable_xattr": false, + "iostats_files": false, + "enable_xattr": true, "fs_prefetch": { "enable": true, - "threads_count": 10 + "threads_count": 8, + "merging_size": 1048576, + "prefetch_all": true } -} +} \ No newline at end of file