-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: refine ansible deployment docs #766
Merged
lilin90
merged 11 commits into
pingcap:master
from
LinuxGit:Louis/refine-deployment-docs
Jun 19, 2018
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d9ddd94
ansible-deployment: adjust operation sequence
LinuxGit 52b5714
ansible-deployment: add filesystem checking step
LinuxGit 3689de9
add ansible-deployment-rolling-update.md
LinuxGit 29d0140
op-guide: add ansible-operation.md and ansible-deployment-scale.md
LinuxGit c1cbdf1
fix format
LinuxGit 08e104c
fix format
LinuxGit b8b3af4
fix format
LinuxGit b066643
fix punctuation
LinuxGit c71e98c
fix format
LinuxGit a72c5a6
op-guide: remove binary-deployment
LinuxGit c547012
fix format
LinuxGit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
title: 使用 TiDB Ansible 升级 TiDB 集群 | ||
category: deployment | ||
--- | ||
|
||
# 使用 TiDB Ansible 升级 TiDB 集群 | ||
|
||
滚动升级 TiDB 集群时,会串行关闭服务,更新服务 binary 和配置文件,再启动服务。在前端配置负载均衡的情况下,滚动升级期间不影响业务运行(最小环境 :`pd * 3 、tidb * 2、tikv * 3`)。 | ||
|
||
> **注**: | ||
> - 如果 TiDB 集群开启了 binlog,部署了 pump 和 drainer 服务,升级 TiDB 服务时会升级 pump,请先停止 drainer 服务再执行滚动升级操作。 | ||
|
||
## 升级组件版本 | ||
|
||
> **注**: | ||
> - 从 TiDB 1.0 升级到 TiDB 2.0,请参考 [TiDB 2.0 升级操作指南](tidb-v2-upgrade-guide.md)。 | ||
|
||
### 自动下载 binary | ||
|
||
1. 修改 `/home/tidb/tidb-ansible/inventory.ini` 中的 `tidb_version` 参数值,指定需要升级的版本号,本例从 `v2.0.2` 升级到 `v2.0.3` | ||
|
||
``` | ||
tidb_version = v2.0.3 | ||
``` | ||
|
||
2. 删除原有的 downloads 目录 `/home/tidb/tidb-ansible/downloads/` | ||
|
||
``` | ||
$ cd /home/tidb/tidb-ansible | ||
$ rm -rf downloads | ||
``` | ||
|
||
3. 使用 playbook 下载 TiDB `v2.0.3` 版本 binary,自动替换 binary 到 `/home/tidb/tidb-ansible/resource/bin/` | ||
|
||
``` | ||
$ ansible-playbook local_prepare.yml | ||
``` | ||
|
||
### 手动下载 binary | ||
|
||
1. 除 “下载 binary” 中描述的方法之外,也可以手动下载 binary,解压后手动替换 binary 到 `/home/tidb/tidb-ansible/resource/bin/`,请注意替换链接中的版本号 | ||
|
||
``` | ||
wget http://download.pingcap.org/tidb-v2.0.3-linux-amd64-unportable.tar.gz | ||
``` | ||
|
||
### 使用 Ansible 滚动升级 | ||
|
||
- 滚动升级 TiKV 节点( 只升级 TiKV 服务 ) | ||
|
||
``` | ||
$ ansible-playbook rolling_update.yml --tags=tikv | ||
``` | ||
|
||
- 滚动升级 PD 节点( 只升级单独 PD 服务 ) | ||
|
||
``` | ||
$ ansible-playbook rolling_update.yml --tags=pd | ||
``` | ||
|
||
- 滚动升级 TiDB 节点( 只升级单独 TiDB 服务, 如果 TiDB 集群开启了 binlog,升级 TiDB 服务时会升级 pump) | ||
|
||
``` | ||
$ ansible-playbook rolling_update.yml --tags=tidb | ||
``` | ||
|
||
- 滚动升级所有服务(依次升级 PD, TiKV, TiDB 服务,如果 TiDB 集群开启了 binlog,升级 TiDB 服务时会升级 pump) | ||
|
||
``` | ||
$ ansible-playbook rolling_update.yml | ||
``` | ||
|
||
- 滚动升级监控组件 | ||
|
||
``` | ||
$ ansible-playbook rolling_update_monitor.yml | ||
``` | ||
|
||
## 变更组件配置 | ||
|
||
1. 更新组件配置模板 | ||
|
||
TiDB 集群组件配置模板存储在 `/home/tidb/tidb-ansible/conf` 文件夹下。 | ||
|
||
| 组件 | 配置文件模板名 | | ||
| :-------- | :----------: | | ||
| TiDB | tidb.yml | | ||
| TiKV | tikv.yml | | ||
| PD | pd.yml | | ||
|
||
默认配置项是注释状态,使用默认值。如果需要修改,需取消注释, 即去除 `#`,修改对应参数值。配置模板使用 yaml 格式,注意参数名及参数值之间使用 `:` 分隔,缩进为两个空格。 | ||
|
||
如修改 TiKV 配置中 `high-concurrency`、`normal-concurrency` 和 `low-concurrency` 三个参数为 16: | ||
|
||
``` | ||
readpool: | ||
coprocessor: | ||
# Notice: if CPU_NUM > 8, default thread pool size for coprocessors | ||
# will be set to CPU_NUM * 0.8. | ||
high-concurrency: 16 | ||
normal-concurrency: 16 | ||
low-concurrency: 16 | ||
``` | ||
|
||
2. 修改服务配置后,需使用 Ansible 滚动升级,参考[使用 Ansible 滚动升级](#使用-Ansible-滚动升级)。 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete the extra square brackets around "升级".