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.yaml
cat >topology.yaml<<'EOF'
global:
user: "tidb"
ssh_port: 22
deploy_dir: "/data/tidb/deploy"
data_dir: "/data/tidb/data"
# # Monitored variables are applied to all the machines.
monitored:
node_exporter_port: 9100
blackbox_exporter_port: 9115
server_configs:
tidb:
log.slow-threshold: 300
tikv:
readpool.storage.use-unified-pool: false
readpool.coprocessor.use-unified-pool: true
pd:
replication.enable-placement-rules: true
replication.location-labels: ["host"]
tiflash:
logger.level: "info"
pd_servers:
- host: 192.168.100.71
tidb_servers:
- host: 192.168.100.71
tikv_servers:
- host: 192.168.100.71
port: 20160
status_port: 20180
config:
server.labels: { host: "logic-host-1" }
- host: 192.168.100.71
port: 20161
status_port: 20181
config:
server.labels: { host: "logic-host-2" }
- host: 192.168.100.71
port: 20162
status_port: 20182
config:
server.labels: { host: "logic-host-3" }
tiflash_servers:
- host: 192.168.100.71
monitoring_servers:
- host: 192.168.100.71
grafana_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