tidb单机部署文档
1、创建用户
#创建用户
useradd tidb
#设置密码
passwd tidb
2、配置免密码登录
编辑/etc/sudoers文件,文末加入:
tidb ALL=(ALL) NOPASSWD:ALL如果想要控制某个用户(或某个组用户)只能执行root权限中的一部分命令,
或者允许某些用户使用sudo时不需要输入密码,一般修改/etc/sudoers文件cat >> /etc/sudoers << "EOF"
tidb ALL=(ALL) NOPASSWD:ALL
EOF
3、创建免密认证
# 切换用户
su - tidb
# 执行命令,一直按回车键就行
ssh-keygen -t rsa
4、创建目录
mkdir /data/businessServer/tidb/ -p
上传安装包
解压安装包
tar xf tidb-community-server-v7.1.0-linux-amd64.tar.gz执行初始化脚本
source /home/tidb/.bash_profile
至此,TiDB安装所需的组件已经安装完成
5、配置初始化参数文件
topology.yamlcat >topology.yaml<<'EOF'
global:user: "tidb"ssh_port: 22deploy_dir: "/data/tidb/deploy"data_dir: "/data/tidb/data"# # Monitored variables are applied to all the machines.
monitored:node_exporter_port: 9100blackbox_exporter_port: 9115server_configs:tidb:log.slow-threshold: 300tikv:readpool.storage.use-unified-pool: falsereadpool.coprocessor.use-unified-pool: truepd:replication.enable-placement-rules: truereplication.location-labels: ["host"]tiflash:logger.level: "info"pd_servers:- host: 192.168.100.71tidb_servers:- host: 192.168.100.71tikv_servers:- host: 192.168.100.71port: 20160status_port: 20180config:server.labels: { host: "logic-host-1" }- host: 192.168.100.71port: 20161status_port: 20181config:server.labels: { host: "logic-host-2" }- host: 192.168.100.71port: 20162status_port: 20182config:server.labels: { host: "logic-host-3" }tiflash_servers:- host: 192.168.100.71monitoring_servers:- host: 192.168.100.71grafana_servers:- host: 192.168.100.71
EOF
6、初始化并启动集群
tiup cluster deploy kylin-tidb-test v7.1.0 /data/businessServer/tidb/conf/topology.yaml -uroot -p
tiup cluster start kylin-tidb-test --init