新建用户
1 | useradd tidb |
在中控机上部署 TiUP 组件
在中控机上部署 TiUP 组件有两种方式:在线部署和离线部署。
在线部署
以普通用户身份登录中控机。以 tidb
用户为例,后续安装 TiUP 及集群管理操作均通过该用户完成:
-
执行如下命令安装 TiUP 工具:
1
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
-
按如下步骤设置 TiUP 环境变量:
-
重新声明全局环境变量:
1
source .bash_profile
-
确认 TiUP 工具是否安装:
1
which tiup
-
-
安装 TiUP cluster 组件:
1
tiup cluster
-
如果已经安装,则更新 TiUP cluster 组件至最新版本:
1
tiup update --self && tiup update cluster
预期输出
“Update successfully!”
字样。 -
验证当前 TiUP cluster 版本信息。执行如下命令查看 TiUP cluster 组件版本:
1
tiup --binary cluster
优化系统配置
vim /etc/sysctl.conf
1 | net.ipv4.tcp_tw_recycle = 0 |