forked from tuna/tunasync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,58 @@ | ||
<li>删除某worker的某镜像 | ||
* 删除某worker的某镜像 | ||
|
||
先确定已经给tunasynctl写好config文件:<code>~/.config/tunasync/ctl.conf</code> | ||
<pre><code>manager_addr = "127.0.0.1" | ||
manager_port = 12345 | ||
ca_cert = ""</code></pre> | ||
先确定已经给tunasynctl写好config文件:`~/.config/tunasync/ctl.conf` | ||
|
||
``` | ||
manager_addr = "127.0.0.1" | ||
manager_port = 12345 | ||
ca_cert = "" | ||
``` | ||
|
||
接着 | ||
<pre><code>$ tunasynctl disable -w [worker_id] [mirror_name] | ||
$ tunasynctl flush</code></pre> | ||
|
||
<li>热重载<code>worker.conf</code> | ||
``` | ||
$ tunasynctl disable -w [worker_id] [mirror_name] | ||
$ tunasynctl flush | ||
``` | ||
|
||
---- | ||
|
||
* 热重载 `worker.conf` | ||
|
||
<code>$ tunasynctl reload -w [worker_id]</code> | ||
`$ tunasynctl reload -w [worker_id]` | ||
|
||
---- | ||
|
||
e.g. 删除<code>test_worker</code>的<code>elvish</code>镜像: | ||
e.g. 删除 `test_worker` 的 `elvish` 镜像: | ||
|
||
1. 删除存放镜像的文件夹 | ||
|
||
2. 删除<code>worker.conf</code>中对应的mirror段落 | ||
2. 删除 `worker.conf` 中对应的 `mirror` 段落 | ||
|
||
3. 接着操作: | ||
<pre><code>$ tunasynctl reload -w test_worker | ||
|
||
``` | ||
$ tunasynctl reload -w test_worker | ||
$ tunasynctl disable -w test_worker elvish | ||
$ tunasynctl flush</code></pre> | ||
$ tunasynctl flush | ||
``` | ||
|
||
4. (可选)最后删除日志文件夹里的日志 | ||
|
||
---- | ||
|
||
<li>删除worker | ||
* 删除worker | ||
|
||
<code>$ tunasynctl rm-worker -w [worker_id]</code> | ||
`$ tunasynctl rm-worker -w [worker_id]` | ||
|
||
e.g. <code>$ tunasynctl rm-worker -w test_worker</code> | ||
e.g. `$ tunasynctl rm-worker -w test_worker` | ||
|
||
---- | ||
|
||
<li>更新镜像的大小 | ||
由于<code>du -s</code>比较耗时,故镜像大小可直接由rsync的日志文件读出 | ||
* 更新镜像的大小 | ||
|
||
`$ tunasynctl set-size -w [worker_id] [mirror_name] [size]` | ||
|
||
<code>$ tunasynctl set-size -w [worker_id] [mirror_name] [size]</code> | ||
其中,末尾的[size]参数,由操作者设定,或由某定时脚本生成 | ||
|
||
其中,末尾的[size]参数,由操作者设定 | ||
由于 `du -s` 比较耗时,故镜像大小可直接由rsync的日志文件读出 |