mirror of
https://github.com/tuna/tunasync.git
synced 2025-06-13 04:17:00 +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)
|
||||
@ -12,11 +11,11 @@ tunasync
|
||||
|
||||
## 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
|
||||
|
||||
```
|
||||
```text
|
||||
# Architecture
|
||||
|
||||
- Manager: Central instance for status and job management
|
||||
@ -50,13 +49,12 @@ PreSyncing Syncing Succe
|
||||
+-----------------+
|
||||
```
|
||||
|
||||
|
||||
## Building
|
||||
|
||||
Go version: 1.13
|
||||
|
||||
```
|
||||
make all
|
||||
```shell
|
||||
> make all
|
||||
```
|
||||
|
||||
Binaries in the `build/`.
|
||||
Binaries in the `build-linux-amd64/`.
|
||||
|
@ -1,4 +1,5 @@
|
||||
# tunasync 上手指南
|
||||
|
||||
date: 2016-10-31 00:50:00
|
||||
|
||||
[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)项目
|
||||
- 禁用了https
|
||||
- 禁用了cgroup支持
|
||||
- 只镜像[elvish](https://elvish.io)项目
|
||||
- 禁用了https
|
||||
- 禁用了cgroup支持
|
||||
|
||||
## 获得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` 即可。
|
||||
|
||||
### 自行编译
|
||||
|
||||
```
|
||||
$ make
|
||||
```shell
|
||||
> make
|
||||
```
|
||||
|
||||
## 配置
|
||||
|
||||
```
|
||||
$ mkdir ~/tunasync_demo
|
||||
$ mkdir /tmp/tunasync
|
||||
```shell
|
||||
> mkdir ~/tunasync_demo
|
||||
> mkdir /tmp/tunasync
|
||||
```
|
||||
|
||||
`~/tunasync_demo/worker.conf`:
|
||||
编辑 `~/tunasync_demo/worker.conf`:
|
||||
|
||||
```
|
||||
```conf
|
||||
[global]
|
||||
name = "test_worker"
|
||||
log_dir = "/tmp/tunasync/log/tunasync/{{.Name}}"
|
||||
@ -64,9 +65,9 @@ upstream = "rsync://rsync.elvish.io/elvish/"
|
||||
use_ipv6 = false
|
||||
```
|
||||
|
||||
`~/tunasync_demo/manager.conf`:
|
||||
编辑 `~/tunasync_demo/manager.conf`:
|
||||
|
||||
```
|
||||
```conf
|
||||
debug = false
|
||||
|
||||
[server]
|
||||
@ -83,26 +84,26 @@ ca_cert = ""
|
||||
|
||||
### 运行
|
||||
|
||||
```
|
||||
$ tunasync manager --config ~/tunasync_demo/manager.conf
|
||||
$ tunasync worker --config ~/tunasync_demo/worker.conf
|
||||
```shell
|
||||
> tunasync manager --config ~/tunasync_demo/manager.conf
|
||||
> tunasync worker --config ~/tunasync_demo/worker.conf
|
||||
```
|
||||
|
||||
本例中,镜像的数据在`/tmp/tunasync/`
|
||||
本例中,镜像的数据在 `/tmp/tunasync/`。
|
||||
|
||||
### 控制
|
||||
|
||||
查看同步状态
|
||||
|
||||
```
|
||||
$ tunasynctl list -p 12345 --all
|
||||
```shell
|
||||
> tunasynctl list -p 12345 --all
|
||||
```
|
||||
|
||||
tunasynctl 也支持配置文件。配置文件可以放在 `/etc/tunasync/ctl.conf` 或者 `~/.config/tunasync/ctl.conf` 两个位置,后者可以覆盖前者的配置值。
|
||||
|
||||
配置文件内容为:
|
||||
|
||||
```
|
||||
```conf
|
||||
manager_addr = "127.0.0.1"
|
||||
manager_port = 12345
|
||||
ca_cert = ""
|
||||
@ -118,13 +119,13 @@ worker 和 manager 之间用 http(s) 通信,如果你 worker 和 manager 都
|
||||
|
||||
可以参看
|
||||
|
||||
```
|
||||
$ tunasync manager --help
|
||||
$ tunasync worker --help
|
||||
```shell
|
||||
> tunasync manager --help
|
||||
> tunasync worker --help
|
||||
```
|
||||
|
||||
可以看一下 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