Skip to content

Commit

Permalink
misc: reorganize the configuration file of nydusd
Browse files Browse the repository at this point in the history
1. Move configuration files from docs/samples to misc/configs
2. Fix incomplete configuration in docs/nydusd.md
3. Update outdated nydusd-config.json from nydus-snapshotter repo

Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
  • Loading branch information
adamqqqplay committed May 10, 2023
1 parent 9d87631 commit c54f441
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 19 deletions.
26 changes: 20 additions & 6 deletions docs/nydusd.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 7 additions & 6 deletions misc/configs/nydusd-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
15 changes: 8 additions & 7 deletions misc/example/nydusd-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

0 comments on commit c54f441

Please sign in to comment.