Skip to content
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

update upgrade guide #711

Merged
merged 2 commits into from
May 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
+ 部署集群
- [Ansible 部署方案(强烈推荐)](op-guide/ansible-deployment.md)
- [离线 Ansible 部署方案](op-guide/offline-ansible-deployment.md)
- [从 TiDB 1.0 升级到 2.0 操作指南](op-guide/upgrade-from-v1-to-v2.md)
- [从 TiDB 1.0 升级到 2.0 操作指南](op-guide/tidb-v2-upgrade-guide.md)
- [Docker 部署方案](op-guide/docker-deployment.md)
- [Docker Compose 部署方案](op-guide/docker-compose.md)
- [跨机房部署方案](op-guide/location-awareness.md)
Expand Down
2 changes: 1 addition & 1 deletion op-guide/op-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ category: deployment

- [Ansible 部署方案 (强烈推荐)](ansible-deployment.md)
- [离线 Ansible 部署方案](offline-ansible-deployment.md)
- [从 TiDB 1.0 升级到 2.0 操作指南](upgrade-from-v1-to-v2.md)
- [从 TiDB 1.0 升级到 2.0 操作指南](tidb-v2-upgrade-guide.md)
- [Docker 部署方案](docker-deployment.md)
- [跨机房部署方案](location-awareness.md)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
title: TiDB 1.0 升级到 2.0 操作指南
title: TiDB 2.0 升级操作指南
category: deployment
---

# 从 TiDB 1.0 升级到 2.0 操作指南
# TiDB 2.0 升级操作指南

> 本文档适用于从 TiDB 1.0 版本或 TiDB 2.0 rc 版本升级到 TiDB 2.0 GA 版本。

## 在中控机器上安装 Ansible 及其依赖

Expand All @@ -22,11 +24,13 @@ Name: jmespath
Version: 0.9.0
```

> 请务必按以上文档安装 Ansible 及其依赖。确认 Jinja2 版本是否正确,否则启动 Grafana 时会报错。确认 jmespath 版本是否正确,否则滚动升级 TiKV 时会报错。

## 在中控机器上下载 TiDB-Ansible

以 `tidb` 用户登录中控机并进入 `/home/tidb` 目录

备份 tidb-ansible release-1.0 分支文件夹:
备份 TiDB 1.0 版本或 TiDB 2.0 rc 版本的 tidb-ansible 文件夹:

```
$ mv tidb-ansible tidb-ansible-bak
Expand All @@ -43,6 +47,7 @@ $ git clone -b release-2.0 https://github.com/pingcap/tidb-ansible.git
以 `tidb` 用户登录中控机并进入 `/home/tidb/tidb-ansible` 目录。

### 编辑 `inventory.ini` 文件

编辑 `inventory.ini` 文件,IP 信息参照备份文件 `/home/tidb/tidb-ansible-bak/inventory.ini`。

以下变量配置,需要重点确认,变量含义可参考 [inventory.ini 变量调整](https://github.com/pingcap/docs-cn/blob/master/op-guide/ansible-deployment.md#其他变量调整)。
Expand All @@ -67,6 +72,7 @@ $ git clone -b release-2.0 https://github.com/pingcap/tidb-ansible.git
如需变更,可参考 [如何调整进程监管方式从 supervise 到 systemd](https://github.com/pingcap/docs-cn/blob/master/op-guide/ansible-deployment.md#如何调整进程监管方式从-supervise-到-systemd), 先使用备份 `/home/tidb/tidb-ansible-bak/` 分支变更进程监管方式再升级。

### 编辑 TiDB 集群组件配置文件

如之前自定义过 TiDB 集群组件配置文件,请参照备份文件修改 `/home/tidb/tidb-ansible/conf` 下对应配置文件。

> TiKV 配置中 `end-point-concurrency` 变更为 `high-concurrency`、`normal-concurrency` 和 `low-concurrency` 三个参数:
Expand All @@ -81,11 +87,11 @@ $ git clone -b release-2.0 https://github.com/pingcap/tidb-ansible.git
# low-concurrency: 8
```

> 单机多 TiKV 实例情况下,需要修改这三个参数,推荐设置:实例数*参数值 = CPU_Vcores * 0.8。
> 单机多 TiKV 实例情况下,需要修改这三个参数,推荐设置:实例数*参数值 = CPU_Vcores * 0.8

## 下载 TiDB 2.0 binary 到中控机

确认 `tidb-ansible/inventory.ini` 文件中 `tidb_version = v2.0.0`, 然后执行以下命令下载 TiDB 2.0 binary 到中控机。
确认 `tidb-ansible/inventory.ini` 文件中 `tidb_version = v2.0.0`, 然后执行以下命令下载 TiDB 2.0 binary 到中控机。

```
$ ansible-playbook local_prepare.yml
Expand All @@ -99,23 +105,23 @@ $ ansible-playbook rolling_update.yml

## 滚动升级 TiDB 监控组件

为满足客户监控组件混布需求,监控组件 systemd service 开始按端口区分。
1. 为满足客户监控组件混布需求,监控组件 systemd service 开始按端口区分。

查看 `inventory.ini` 文件中 `process_supervision` 变量:
查看 `inventory.ini` 文件中 `process_supervision` 变量:

```
# process supervision, [systemd, supervise]
process_supervision = systemd
```
```
# process supervision, [systemd, supervise]
process_supervision = systemd
```

如果 `process_supervision = systemd`, 为兼容之前的版本,你需要执行 `migrate_monitor.yml` Playbook。
如果 `process_supervision = systemd`, 为兼容 `v2.0.0-rc.6` 之前的版本,你需要执行 `migrate_monitor.yml` Playbook。如果 `process_supervision = supervise`,此步骤不需要执行

```
$ ansible-playbook migrate_monitor.yml
```
```
$ ansible-playbook migrate_monitor.yml
```

滚动升级 TiDB 监控组件:
2. 滚动升级 TiDB 监控组件:

```
$ ansible-playbook rolling_update_monitor.yml
```
```
$ ansible-playbook rolling_update_monitor.yml
```