在线tidb+tipd+tikv扩容,迁移,从UC到阿里云
集群现状:
共有五个节点,配置为16核32g内存,数据节点为1T ssd盘,非数据节点为100g ssd盘;
角色规划:
- node1 tidb tipd
- node2 tidb tipd
- node3 tikv tipd
- node4 tikv
- node5 tikv
1.每次操作都需要更改配置文件inventory.ini,都是在tidb用户下进行;
2.初始化,打通新增节点与已有节点间免密码登录(tidb)用户;
3.扩容tidb节点两个
- ## TiDB Cluster Part
- [tidb_servers]
- 10.15.xxx.xxx ---旧的tidb---uc机器
- 10.15.xxx.xxx ---旧的tidb---uc机器
- 10.80.xxx.xxx ---新加tidb---阿里机器
- 10.80.xxx.xxx ---新加tidb---阿里机器
3.1 部署
- [tidb@tidb..tidb.prod.uc:~/tidb-ansible]$ ansible-playbook deploy.yml -l 10.80.xxx.xxx,10.80.xxx.xxx
。。。。。。。。。。。。。。。。。。。。。。。。。。。
。。。。。。。。。。。。。。。。。
。。。。。。。。。
PLAY RECAP ***********************************************************************************************************************************************************************************************
10.80.249.46 : ok=30 changed=12 unreachable=0 failed=0
10.80.249.47 : ok=30 changed=12 unreachable=0 failed=0
Congrats! All goes well. :-)
3.2 启动新增tidb节点
- [tidb@tidb..tidb.prod.uc:~/tidb-ansible]$ ansible-playbook rolling_update_monitor.yml --tags=prometheus
- PLAY RECAP ***********************************************************************************************************************************************************************************************
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.80.xxx.xxx : ok= changed= unreachable= failed=
- 10.80.xxx.xxx : ok= changed= unreachable= failed=
- localhost : ok= changed= unreachable= failed=
- Congrats! All goes well. :-)
3.3更新监控
- [tidb@tidb..tidb.prod.uc:~/tidb-ansible]$ ansible-playbook rolling_update_monitor.yml --tags=prometheus
- PLAY RECAP ***********************************************************************************************************************************************************************************************
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.15.xxx.xxx : ok= changed= unreachable= failed=
- 10.80.xxx.xxx : ok= changed= unreachable= failed=
- 10.80.xxx.xxx : ok= changed= unreachable= failed=
- localhost : ok= changed= unreachable= failed=
- Congrats! All goes well. :-)
4.扩容tikv节点
- [tikv_servers]
- 10.15.xxx.xxx
- 10.15.xxx.xxx
- 10.15.xxx.xxx
- 10.80.xxx.xxx
- 10.80.xxx.xxx
- 10.80.xxx.xxx
4.1.tikv为数据节点,扩容之前把ssd盘格式化分区挂载
- root@tikv..tidb.prod.ali:~/.ssh# vi /etc/fstab
- #
- # /etc/fstab
- # Created by anaconda on Sun Oct 15 15:19:00 2017
- #
- # Accessible filesystems, by reference, are maintained under '/dev/disk'
- # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
- #
- UUID=eb448abb--4d8d-bcde-94434d586a31 / ext4 defaults
- #/dev/vdb /data ext4 defaults,noatime 0 0
- /dev/vdb /data ext4 defaults,nodelalloc,noatime
- root@tikv..tidb.prod.ali:~/.ssh#
- root@tikv..tidb.prod.ali:~/.ssh# umount /data
- root@tikv..tidb.prod.ali:~/.ssh# mount -a
- root@tikv..tidb.prod.ali:~/.ssh# mount -t ext4
- /dev/vda1 on / type ext4 (rw,relatime,data=ordered)
- /dev/vdb on /data type ext4 (rw,noatime,nodelalloc,data=ordered)
4.2 加入tikv,启动服务,更新
- [tidb@tidb.11.tidb.prod.uc:~/tidb-ansible]$ ansible-playbook bootstrap.yml -l 10.80.249.59,10.80.249.60,10.80.249.58
- [tidb@tidb.11.tidb.prod.uc:~/tidb-ansible]$ ansible-playbook start.yml -l 10.80.249.59,10.80.249.60,10.80.249.58
- [tidb@tidb.11.tidb.prod.uc:~/tidb-ansible]$ ansible-playbook rolling_update_monitor.yml --tags=prometheus
5.加入tidb(加入tipd节点要一个一个加入)
- [pd_servers]
- 10.15.xxx.xxx
- 10.15.xxx.xxx
- 10.15.xxx.xxx
- 10.80.xxx.xxx
5.1初始化新加入tipd
- [tidb@tidb..tidb.prod.uc:~/tidb-ansible]$ ansible-playbook bootstrap.yml -l 10.80.xxx.xxx
2.安装目标服务器
- [tidb@tidb.01.tidb.prod.uc:~/tidb-ansible]$ ansible-playbook deploy.yml -l 10.80.xxx.xxx
PLAY RECAP ***************************************************************************************************************************
10.80.249.46 : ok=34 changed=0 unreachable=0 failed=0
Congrats! All goes well. :-)
5.3登录到新加入的tipd节点,vi run_pd.sh
- root@tidb..tidb.prod.ali:/data/tidb/deploy/scripts# vi run_pd.sh
- --initial-cluster="pd1=http://10.15.xxx.xxx:2380,pd2=http://10.15.xxx.xxx:2380,pd3=http://10.15.xxx.xxx:2380,pd4=http://10.80.xxx.xxx:2380" \
- #!/bin/bash
- set -e
- ulimit -n
- # WARNING: This file was auto-generated. Do not edit!
- # All your edit might be overwritten!
- DEPLOY_DIR=/data/tidb/deploy
- cd "${DEPLOY_DIR}" || exit
- exec bin/pd-server \
- --name="pd4" \
- --client-urls="http://10.80.xxx.xxx:2379" \
- --advertise-client-urls="http://10.80.xxx.xxx:2379" \
- --peer-urls="http://10.80.xxx.xxx:2380" \
- --advertise-peer-urls="http://10.80.xxx.xxx:2380" \
- --data-dir="/data/tidb/deploy/data.pd" \
- --config=conf/pd.toml \
- --join="http://10.15.xxx.xxx:2380" \
- --log-file="/data/tidb/deploy/log/pd.log" >> "/data/tidb/deploy/log/pd_stderr.log
- 在目标服务器手动启动pd服务:
- tidb@tidb.11.tidb.prod.ali:/data/tidb/deploy/scripts$ sh -x start_pd.sh
5.4 在目标机器查看pd服务:
tidb@tidb.11.tidb.prod.ali:/data/tidb/deploy/scripts$ ps -ef | grep tidb
tidb 6922 1 0 14:29 ? 00:00:02 bin/pd-server --name=pd4 --client-urls=http://10.80.xxx.xxx:2379 --advertise-client-urls=http://10.80.xxx.xxx:2379 --peer-urls=http://10.80.xxx.xxx:2380 --advertise-peer-urls=http://10.80.xxx.xxx:2380 --data-dir=/data/tidb/deploy/data.pd --config=conf/pd.toml --join=http://10.15.xxx.xxx:2380 --log-file=/data/tidb/deploy/log/pd.log
5.5 滚动升级集群:
[tidb@tidb.11.tidb.prod.uc:~/tidb-ansible]$ ansible-playbook rolling_update.yml
5.6更新 Prometheus 配置并重启:
[tidb@tidb.11.tidb.prod.uc:~/tidb-ansible]$ ansible-playbook rolling_update_monitor.yml --tags=prometheus
在线tidb+tipd+tikv扩容,迁移,从UC到阿里云的更多相关文章
- Windows Server: 将虚拟机迁移到 Azure (以阿里云为例)
Azure 虚拟机能很容易地导出 vhd 并迁移到各种环境中,包含本地及云端环境,或者迁移至其他区域.这为开发.测试.扩展带来了极大的便利.本文以阿里云为例,阐述如何将Windows Server 的 ...
- 在线工具生成接入信息mqtt.fx快速接入阿里云
在线工具生成接入信息mqtt.fx快速接入阿里云 在使用阿里云获取的三元组信息进行接入的时候,往往需要加密生成接入信息之后才能进行接入,因此我根据阿里云提供的加密工具实现了一个阿里云物联网平台mqtt ...
- CentOS: 将虚拟机迁移到 Azure (以阿里云为例)
Azure 虚拟机能很容易地导出 vhd 并迁移到各种环境中,包含本地及云端环境,或者迁移至其他区域.这为开发.测试.扩展带来了极大的便利.因此本文以阿里云为例,阐述的是如何将 CentOS 6.8 ...
- 阿里云ECS 实例Centos7系统磁盘扩容
需求:一台阿里云的数据盘磁盘空间不足,需要扩容,我这里只有一个主分区,ext4文件系统. 因为磁盘扩容场景不同,阿里云的文档比较全面一些,所以先奉上阿里云的文档,下面开始我的操作步骤: 1.登录控制台 ...
- 阿里云提示Discuz uc.key泄露导致代码注入漏洞uc.php的解决方法
适用所有用UC整合 阿里云提示漏洞: discuz中的/api/uc.php存在代码写入漏洞,导致黑客可写入恶意代码获取uckey,.......... 漏洞名称:Discuz uc.key泄露导致代 ...
- 阿里云OSS不同账号之间的迁移
目录 一.需求说明 二.Ossimport概述 三.配置运行环境 1.配置jdk环境 2.部署方式 3.下载并部署ossimport 四.修改单机Job的配置文件local_job.cfg 五.执行迁 ...
- 阿里云RDS数据库改造迁移方案
1. 改造原因 (1) 由于历史原因, 本应该是同一个库的表分布在两个数据库中,需要对这两个库进行合并. (2) 已有的数据库性能无法满足业务的增长需要, 查询卡,慢问题突出. (3) 当前自建Mys ...
- 阿里云给自己实例扩容-扩展分区和文件系统_Linux系统盘
阿里云买了台服务器ecs 磁盘容量40g 发现已经用了30g了 赶紧扩容 进入 e'cs实例 进入左边菜单 存储与快照 然后选择右边的扩容 然后支付 成功后 进入服务器 df -h 发现怎么还是没变 ...
- 使用 FTP 迁移 SQL Server 数据_迁移数据_快速入门(SQL Server)_云数据库 RDS 版-阿里云
背景信息 阿里云数据库 SQL Server 版导入数据有如下限制: 仅支持导入 SQL Server 2005.SQL Server 2008.SQL Server 2008R2 版本数据 仅支持全 ...
随机推荐
- 关于TCHAR和string对象的c.str()一些注意事项
1.TCHAR 根据预处理器的设置,如果是_MBCS, 那么TCHAR = char: 如果 如果设置的是UNICODE和_UNICODE,那么TCHAR=wchar_t.就等于根据当前环境会选择不同 ...
- Codeforces Round #430 (Div. 2) 【A、B、C、D题】
[感谢牛老板对D题的指点OTZ] codeforces 842 A. Kirill And The Game[暴力] 给定a的范围[l,r],b的范围[x,y],问是否存在a/b等于k.直接暴力判断即 ...
- (一)自定义ViewGroup绘制出菜单
从网上学习了hyman大神的卫星菜单实现,自己特意亲自又写了一编代码,对自定义ViewGroup的理解又深入了一点.我坚信只有自己写出来的知识才会有更加好的的掌握.因此也在自己的博客中将这个卫星菜单的 ...
- Django Url设计 小知识点
mysite/news/urls.py: from django.conf.urls import url from . import views urlpatterns = [ url(r'^art ...
- JavaScript小游戏--2048(PC端)
1.初始化棋局 $(document).ready(function() { prepare_for_mobile(); //适配移动端 new_game(); }); 2.开始新游戏 functio ...
- 【转】计算Java List中的重复项出现次数
本文演示如何使用Collections.frequency和Map来计算重复项出现的次数.(Collections.frequency在JDK 1.5版本以后支持) package com.qiyad ...
- Gradle Goodness: Unpacking an Archive
To create an archive with Gradle is easy. We have several tasks like Zip, Tar, Jar, War and Ear to c ...
- python Web开发之 WSGI & uwsgi & uWSGI
首先弄清下面几个概念: WSGI 全称是Web Server Gateway Interface,WSGI不是服务器,python模块,框架,API或者任何软件,只是一种规范,描述web server ...
- Xcode 之 Debug 和 Release 模式切换方式 - iOS
一.选择项目工程,其次选择 Edit Scheme 二.在弹框中选择 Run => Info => Build Configuration 选择中进行 Debug 和 Release 的切 ...
- 让 shell(bash) 命令行显示当前 git 的分支名称
早上测试脚本的时候,偶然在这篇文章<Git – setting up a remote repository and doing an initial push>看到一个关于 git 的好 ...