001 TiDB单机版安装

使用 TiUP Playground 快速部署本地测试环境

注:本教程本地测试环境部署, 若单机模拟集群部署, 请参考: 使用 TiUP cluster 在单机上模拟生产环境部署步骤

基础环境配置

基础配置

  1. 安装yum源
    curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo yum install -y yum-utils device-mapper-persistent-data lvm2
    yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
    
  2. 安装必备工具
    yum install wget jq psmisc vim net-tools telnet yum-utils device-mapper-persistent-data lvm2 git -y
    
  3. 关闭firewalld 、dnsmasq、selinux
    systemctl disable --now firewalld 
    systemctl disable --now dnsmasq
    setenforce 0
    sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/sysconfig/selinux
    sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
    
下载并安装TiUP
[root@tidb-01 ~]# curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7037k  100 7037k    0     0  4727k      0  0:00:01  0:00:01 --:--:-- 4732k
WARN: adding root certificate via internet: https://tiup-mirrors.pingcap.com/root.json
You can revoke this by remove /root/.tiup/bin/7b8e153f2e2d0928.root.json
Successfully set mirror to https://tiup-mirrors.pingcap.com
Detected shell: bash
Shell profile:  /root/.bash_profile
/root/.bash_profile has been modified to add tiup to PATH
open a new terminal or source /root/.bash_profile to use it
Installed path: /root/.tiup/bin/tiup
===============================================
Have a try:     tiup playground
===============================================
声明全局环境变量
[root@tidb-01 ~]# source .bash_profile

注:TiUP 安装完成会提示对应的 profile 文件的绝对路径,以下 source 操作需要根据实际位置进行操作

在当前 session 执行以下命令启动集群
[root@tidb-01 ~]# tiup playground

### 前台运行结果

The component `playground` version  is not installed

你可能感兴趣的:(tidb,mysql)