Skip to content

Commit

Permalink
*: add water mark to pdf; add media dir
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Jan 7, 2017
1 parent 999b7c2 commit 966b6de
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ TiDB 对业务没有任何侵入性,能优雅的替换传统的数据库中间

要深入了解 TiDB 的水平扩展和高可用特点,首先需要了解 TiDB 的整体架构。

![TiDB Architecture](op-guide/architecture.png)
![TiDB Architecture](media/tidb-architecture.png)

TiDB 集群主要分为三个组件:

Expand Down
4 changes: 2 additions & 2 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
+ 运维 & 监控
- [整体监控框架概述](op-guide/monitor-overview.md)
- [组件状态 API & 监控](op-guide/monitor.md)
- [PD 命令行工具](op-guide/pd-control.md)
+ SQL 兼容及对比
- [TiDB SQL 文法](sql/README.md)
- [与 MySQL 兼容性对比](op-guide/mysql-compatibility.md)
Expand All @@ -24,8 +23,9 @@
+ 使用示例
+ 高级功能
- [数据迁移方法](op-guide/migration.md)
- [PD 命令行工具](op-guide/pd-control.md)
- [Loader 使用文档](tools/loader.md)
- [性能调优](op-guide/tune-TiKV.md)
- [性能调优](op-guide/tune-tikv.md)
- [读取历史版本数据](op-guide/history-read.md)
+ 更多资源
- [PingCAP 团队技术博客](http://www.pingcap.com/bloglist.html)
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion op-guide/docker-compose.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 使用 `docker-compose`, 更方便地构建集群
## 使用 Docke Compose 构建集群

只需要一个简单的 `docker-compose.yml`:

Expand Down
8 changes: 4 additions & 4 deletions op-guide/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

## 使用 checker 进行 Schema 检查

在迁移之前,我们可以使用 TiDB 的 `checker` 工具,来预先检查 TiDB 是否能支持需要迁移的 table schema。如果 check 某个 table schema 失败,表明 TiDB 当前并不支持,我们不能对该 table 里面的数据进行迁移。`checker` 包含在 TiDB 工具集里面,我们可以直接下载。
在迁移之前,我们可以使用 TiDB 的 checker 工具,来预先检查 TiDB 是否能支持需要迁移的 table schema。如果 check 某个 table schema 失败,表明 TiDB 当前并不支持,我们不能对该 table 里面的数据进行迁移。checker 包含在 TiDB 工具集里面,我们可以直接下载。

### 下载 TiDB 工具集 (Linux)

Expand All @@ -29,7 +29,7 @@ tar -xzf tidb-tools-latest-linux-amd64.tar.gz
cd tidb-tools-latest-linux-amd64
```

### 使用 `checker` 检查的一个示范
### 使用 checker 检查的一个示范

+ 在 MySQL 的 test database 里面创建几张表,并插入数据:

Expand All @@ -42,7 +42,7 @@ cd tidb-tools-latest-linux-amd64
INSERT INTO t2 VALUES (1, "a"), (2, "b"), (3, "c");
```

+ 使用 `checker` 检查 test database 里面所有的 table
+ 使用 checker 检查 test database 里面所有的 table

```bash
./bin/checker -host 127.0.0.1 -port 3306 -user root test
Expand All @@ -54,7 +54,7 @@ cd tidb-tools-latest-linux-amd64
2016/10/27 13:11:49 checker.go:69: [info] Check table t2 succ
```

+ 使用 `checker` 检查 test database 里面某一个 table
+ 使用 checker 检查 test database 里面某一个 table

这里,假设我们只需要迁移 table `t1`

Expand Down
4 changes: 2 additions & 2 deletions op-guide/monitor-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Prometheus 是一个拥有多维度数据模型,灵活的查询语句的时序

Prometheus 提供了多个组件供用户使用。目前,我们使用 Prometheus Server,来收集和存储时间序列数据。Client 代码库,在程序中定制需要的 Metric 。Push GateWay 来接收 Client Push 上来的数据,统一供 Prometheus 主服务器抓取。以及 AlertManager 来实现报警机制。其结构如下图:

![Prometheus in TiDB](./prometheus-in-TiDB.png)
![Prometheus in TiDB](../media/prometheus-in-tidb.png)

Grafana 是一个开源的 metric 分析及可视化系统。我们使用 Grafana 来展示 TiDB 的各项性能指标 。如下图所示:

![Grafana Screeshot](op-guide/grafana-screenshot.png)
![Grafana Screeshot](../media/grafana-screenshot.png)



2 changes: 1 addition & 1 deletion op-guide/monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ curl http://127.0.0.1:2379/pd/api/v1/stores

整个架构如下图所示,在 TiDB/PD/TiKV 三个组件的启动参数中添加 Prometheus Pushgateway 地址:

![Deployment Architecture](./monitor.png)
![Deployment Architecture](../media/monitor-architecture.png)

### 搭建监控系统
Prometheus Push Gateway
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TiDB 对业务没有任何侵入性,能优雅的替换传统的数据库中间

要深入了解 TiDB 的水平扩展和高可用特点,首先需要了解 TiDB 的整体架构。

![TiDB Architecture](op-guide/architecture.png)
![TiDB Architecture](media/tidb-architecture.png)

TiDB 集群主要分为三个组件:

Expand Down
6 changes: 4 additions & 2 deletions scripts/merge_by_toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
tag = open(f).read().strip().split('\n')[0]
if tag.startswith('# '):
tag = tag[2:]
elif tag.startswith('## '):
tag = tag[3:]
file_link_name[f] = tag.lower().replace(' ', '-')

print(file_link_name)
Expand All @@ -56,9 +58,8 @@ def replace_link(match):
return '[%s](%s)' % (link_name, frag)
elif link.endswith('.png'):
# special handing for pic
# FIXME: better add media or static dir
fname = os.path.basename(link)
return '[%s](./op-guide/%s)' % (link_name, fname)
return '[%s](./media/%s)' % (link_name, fname)
else:
return full

Expand All @@ -69,6 +70,7 @@ def replace_link(match):
chapter = fp.read()
chapter = hyper_link_pattern.sub(replace_link, chapter)
contents.append(chapter)
contents.append('') # add an empty line

with open("doc.md", 'w') as fp:
fp.write('\n'.join(contents))
10 changes: 9 additions & 1 deletion templates/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@
% http://blog.csdn.net/golden1314521/article/details/39926135
\usepackage{titlesec}
\usepackage{titletoc}

% \titlecontents{标题名}[左间距]{标题格式}{标题标志}{无序号标题}{指引线与页码}[下间距]
% fix overlap
\titlecontents{subsection}
Expand All @@ -205,7 +204,16 @@
{}%
{\titlerule*[0.5pc]{$$\cdot$$}\contentspage\hspace*{0em}}%

\usepackage[all]{background}
% \backgroundsetup{contents=PingCAP Inc.,color=blue,opacity=0.2}
\backgroundsetup{contents=\includegraphics{media/pingcap-logo},
placement=top,scale=0.2,hshift=1000pt,vshift=-150pt,
opacity=0.9,angle=0}

\begin{document}

% no bg at title page
\NoBgThispage
$if(title)$
\maketitle
$endif$
Expand Down

0 comments on commit 966b6de

Please sign in to comment.