mirror of
https://github.com/tuna/tunasync.git
synced 2025-06-13 21:12:43 +00:00
Improve docs (#138)
This commit is contained in:
parent
75ee481cfa
commit
94b9b20626
14
README.md
14
README.md
@ -1,5 +1,4 @@
|
|||||||
tunasync
|
# tunasync
|
||||||
========
|
|
||||||
|
|
||||||

|

|
||||||
[](https://coveralls.io/github/tuna/tunasync?branch=master)
|
[](https://coveralls.io/github/tuna/tunasync?branch=master)
|
||||||
@ -12,11 +11,11 @@ tunasync
|
|||||||
|
|
||||||
## Download
|
## Download
|
||||||
|
|
||||||
Pre-built binary for Linux x86_64 is available at [Github releases](https://github.com/tuna/tunasync/releases/latest).
|
Pre-built binary for Linux x86_64 and ARM64 is available at [Github releases](https://github.com/tuna/tunasync/releases/latest).
|
||||||
|
|
||||||
## Design
|
## Design
|
||||||
|
|
||||||
```
|
```text
|
||||||
# Architecture
|
# Architecture
|
||||||
|
|
||||||
- Manager: Central instance for status and job management
|
- Manager: Central instance for status and job management
|
||||||
@ -50,13 +49,12 @@ PreSyncing Syncing Succe
|
|||||||
+-----------------+
|
+-----------------+
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Go version: 1.13
|
Go version: 1.13
|
||||||
|
|
||||||
```
|
```shell
|
||||||
make all
|
> make all
|
||||||
```
|
```
|
||||||
|
|
||||||
Binaries in the `build/`.
|
Binaries in the `build-linux-amd64/`.
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# tunasync 上手指南
|
# tunasync 上手指南
|
||||||
|
|
||||||
date: 2016-10-31 00:50:00
|
date: 2016-10-31 00:50:00
|
||||||
|
|
||||||
[tunasync](https://github.com/tuna/tunasync) 是[清华大学 TUNA 镜像源](https://mirrors.tuna.tsinghua.edu.cn)目前使用的镜像方案。
|
[tunasync](https://github.com/tuna/tunasync) 是[清华大学 TUNA 镜像源](https://mirrors.tuna.tsinghua.edu.cn)目前使用的镜像方案。
|
||||||
@ -7,32 +8,32 @@ date: 2016-10-31 00:50:00
|
|||||||
|
|
||||||
本例中:
|
本例中:
|
||||||
|
|
||||||
- 只镜像[elvish](https://elvish.io)项目
|
- 只镜像[elvish](https://elvish.io)项目
|
||||||
- 禁用了https
|
- 禁用了https
|
||||||
- 禁用了cgroup支持
|
- 禁用了cgroup支持
|
||||||
|
|
||||||
## 获得tunasync
|
## 获得tunasync
|
||||||
|
|
||||||
### 二进制包
|
### 二进制包
|
||||||
|
|
||||||
到 [Github Releases](https://github.com/tuna/tunasync/releases/latest) 下载 `tunasync-linux-bin.tar.gz` 即可。
|
到 [Github Releases](https://github.com/tuna/tunasync/releases/latest) 下载 `tunasync-linux-amd64-bin.tar.gz` 即可。
|
||||||
|
|
||||||
### 自行编译
|
### 自行编译
|
||||||
|
|
||||||
```
|
```shell
|
||||||
$ make
|
> make
|
||||||
```
|
```
|
||||||
|
|
||||||
## 配置
|
## 配置
|
||||||
|
|
||||||
```
|
```shell
|
||||||
$ mkdir ~/tunasync_demo
|
> mkdir ~/tunasync_demo
|
||||||
$ mkdir /tmp/tunasync
|
> mkdir /tmp/tunasync
|
||||||
```
|
```
|
||||||
|
|
||||||
`~/tunasync_demo/worker.conf`:
|
编辑 `~/tunasync_demo/worker.conf`:
|
||||||
|
|
||||||
```
|
```conf
|
||||||
[global]
|
[global]
|
||||||
name = "test_worker"
|
name = "test_worker"
|
||||||
log_dir = "/tmp/tunasync/log/tunasync/{{.Name}}"
|
log_dir = "/tmp/tunasync/log/tunasync/{{.Name}}"
|
||||||
@ -64,9 +65,9 @@ upstream = "rsync://rsync.elvish.io/elvish/"
|
|||||||
use_ipv6 = false
|
use_ipv6 = false
|
||||||
```
|
```
|
||||||
|
|
||||||
`~/tunasync_demo/manager.conf`:
|
编辑 `~/tunasync_demo/manager.conf`:
|
||||||
|
|
||||||
```
|
```conf
|
||||||
debug = false
|
debug = false
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
@ -83,26 +84,26 @@ ca_cert = ""
|
|||||||
|
|
||||||
### 运行
|
### 运行
|
||||||
|
|
||||||
```
|
```shell
|
||||||
$ tunasync manager --config ~/tunasync_demo/manager.conf
|
> tunasync manager --config ~/tunasync_demo/manager.conf
|
||||||
$ tunasync worker --config ~/tunasync_demo/worker.conf
|
> tunasync worker --config ~/tunasync_demo/worker.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
本例中,镜像的数据在`/tmp/tunasync/`
|
本例中,镜像的数据在 `/tmp/tunasync/`。
|
||||||
|
|
||||||
### 控制
|
### 控制
|
||||||
|
|
||||||
查看同步状态
|
查看同步状态
|
||||||
|
|
||||||
```
|
```shell
|
||||||
$ tunasynctl list -p 12345 --all
|
> tunasynctl list -p 12345 --all
|
||||||
```
|
```
|
||||||
|
|
||||||
tunasynctl 也支持配置文件。配置文件可以放在 `/etc/tunasync/ctl.conf` 或者 `~/.config/tunasync/ctl.conf` 两个位置,后者可以覆盖前者的配置值。
|
tunasynctl 也支持配置文件。配置文件可以放在 `/etc/tunasync/ctl.conf` 或者 `~/.config/tunasync/ctl.conf` 两个位置,后者可以覆盖前者的配置值。
|
||||||
|
|
||||||
配置文件内容为:
|
配置文件内容为:
|
||||||
|
|
||||||
```
|
```conf
|
||||||
manager_addr = "127.0.0.1"
|
manager_addr = "127.0.0.1"
|
||||||
manager_port = 12345
|
manager_port = 12345
|
||||||
ca_cert = ""
|
ca_cert = ""
|
||||||
@ -118,13 +119,13 @@ worker 和 manager 之间用 http(s) 通信,如果你 worker 和 manager 都
|
|||||||
|
|
||||||
可以参看
|
可以参看
|
||||||
|
|
||||||
```
|
```shell
|
||||||
$ tunasync manager --help
|
> tunasync manager --help
|
||||||
$ tunasync worker --help
|
> tunasync worker --help
|
||||||
```
|
```
|
||||||
|
|
||||||
可以看一下 log 目录
|
可以看一下 log 目录
|
||||||
|
|
||||||
一些 worker 配置文件示例 [workers.conf](workers.conf)
|
一些 worker 配置文件示例 [workers.conf](workers.conf)。
|
||||||
|
|
||||||
你可能会用到的操作 [tips.md](tips.md)
|
你可能会用到的操作 [tips.md](tips.md)。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user