tidb4.0.1安装

安装环境

3台redhat7.6 64 服务器

软硬件需求

系统要求

|Linux 操作系统平台 | 版本 |
|Red Hat Enterprise Linux | 7.3以上 |
| CentOS | 7.3以上 |
|Oracle Enterprise Linux | 7.3以上 |
|Ubuntu LTS | 16.04 及以上 |

软件需求

中控机需求

|软件| 版本|
|sshpass| 1.06 及以上|
|TiUP| 0.6.2 及以上|

目标主机需求
| 软件 | 版本 |
|sshpass | 1.06 及以上 |
|numa | 2.0.12 及以上 |

挂载参数

UUID=c51eb23b-195c-4061-92a9-3fad812cc12f /data1 ext4 defaults,nodelalloc,noatime 0 2
注:不加没有报错。网上说不加会报错

关闭swap

vim /etc/sysctl.conf
vm.swappiness = 0

关闭防火墙

systemctl stop firewalld.service
systemctl disable firewalld.service

配置和安装NTP

参考官方文档

配置ssh密钥和sudo免密码

visudo
tidb ALL=(ALL) NOPASSWD: ALL
ssh-copy-id -i ~/.ssh/id_rsa.pub 10.0.1.1

以上所有节点都配置

安装tidb

使用离线包安装
tidb-community-server-v4.0.1-linux-amd64.tar.gz
tar zxf tidb-community-server-v4.0.1-linux-amd64.tar.gz

安装tiup

cd tidb-community-server-v4.0.1-linux-amd64
sh local_install.sh
source /root/.bash_profile

配置初始化参数

新建topology.yaml文件
vim topology.yaml

global:
  user: "tidb"
  ssh_port: 22
  deploy_dir: "/data/tidb-deploy"
  data_dir: "/data/tidb-data"

monitored:
  node_exporter_port: 9100
  blackbox_exporter_port: 9115

server_configs:
  tidb:
    log.slow-threshold: 300
    binlog.enable: false
    binlog.ignore-error: false
  tikv:
     server.grpc-concurrency: 8
     raftstore.apply-pool-size: 2
     raftstore.store-pool-size: 2
     rocksdb.max-sub-compactions: 2
     storage.block-cache.capacity: "16GB"
     readpool.unified.max-thread-count: 16
     readpool.storage.use-unified-pool: false
     readpool.coprocessor.use-unified-pool: true
  pd:
    schedule.leader-schedule-limit: 4
    schedule.region-schedule-limit: 2048
    schedule.replica-schedule-limit: 64
    replication.enable-placement-rules: true
  tiflash:
    path_realtime_mode: false
    logger.level: "info"
  tiflash-learner:
     log-level: "info"
     raftstore.apply-pool-size: 4
     raftstore.store-pool-size: 4
  pump:
    gc: 7

pd_servers:
  - host: 10.105.1.10
  - host: 10.105.1.103
  - host: 10.105.1.171

tidb_servers:
  - host: 10.105.1.10
  - host: 10.105.1.103
  - host: 10.105.1.171

tikv_servers:
  - host: 10.105.1.10
  - host: 10.105.1.103
  - host: 10.105.1.171

tiflash_servers:
 - host: 10.105.1.10
#pump_servers:
   #   - host: 10.0.1.17
   #     ssh_port: 22
   #     port: 8250
   #     deploy_dir: "/tidb-deploy/pump-8249"
   #     data_dir: "/tidb-data/pump-8249"
   #     log_dir: "/tidb-deploy/pump-8249/log"
   #     numa_node: "0,1"
   #     # The following configs are used to overwrite the `server_configs.drainer` values.
   #     config:
   #       gc: 7
   #   - host: 10.0.1.18
   #   - host: 10.0.1.19
   
   # drainer_servers:
   #   - host: 10.0.1.17
   #     port: 8249
   #     data_dir: "/tidb-data/drainer-8249"
   #     # If drainer doesn't have a checkpoint, use initial commitTS as the initial checkpoint.
   #     # Will get a latest timestamp from pd if commit_ts is set to -1 (the default value).
   #     commit_ts: -1
   #     deploy_dir: "/tidb-deploy/drainer-8249"
   #     log_dir: "/tidb-deploy/drainer-8249/log"
   #     numa_node: "0,1"
   #     # The following configs are used to overwrite the `server_configs.drainer` values.
   #     config:
   #       syncer.db-type: "mysql"
   #       syncer.to.host: "127.0.0.1"
   #       syncer.to.user: "root"
   #       syncer.to.password: ""
   #       syncer.to.port: 3306
   #       syncer.ignore-table:
   #         - db-name: test
   #           tbl-name: log
   #         - db-name: test
   #           tbl-name: audit
   #   - host: 10.0.1.19
   
   # cdc_servers:
   #   - host: 10.0.1.20
   #     ssh_port: 22
   #     port: 8300
   #     deploy_dir: "/tidb-deploy/cdc-8300"
   #     log_dir: "/tidb-deploy/cdc-8300/log"
   #     numa_node: "0,1"
   #   - host: 10.0.1.21
   #   - host: 10.0.1.22

monitoring_servers:
  - host: 10.105.1.10

grafana_servers:
  - host: 10.105.1.10

alertmanager_servers:
  - host: 10.105.1.10

部署集群

export TIUP_MIRRORS=/root/tidb-server --tidb安装包解压路径
tiup cluster deploy tidb-test v4.0.1 topology.yaml --user tidb [-p] [-i /home/root/.ssh/gcp_rsa] --没有配置免密码,需要两个参数其中一个。tidb-test 集群名,v4.0.1 版本 tidb 系统用户,没有建,在执行这段命令,会自动创建
tiup cluster start tidb-test --启动集群
看到如下信息就表示成功
Deployed cluster tidb-test successfully

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值