TiDB部署

参考文档:https://pingcap.com/docs/dev/how-to/deploy/from-tarball/production-environment/
部署非常简单,拷贝启动即可。步骤如下(下面内容先这么放着,有空再整理

机器配置:6节点,全部Intel® Xeon® CPU E5-2690 @ 2.90GHz Memory 252GB

wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz

useradd -u 171717 -g dba -d /scratch/tidb tidb
passwd tidb
welcome1

Configure ssh without password
ssh-keygen -t rsa
cd ~/.ssh
cat id_rsa.pub >>authorized_keys

vi /etc/security/limits.conf
tidb soft nofile 1000000
tidb hard nofile 1000000
tidb soft nproc 524288
tidb hard nproc 524288
tidb soft core unlimited
tidb hard core unlimited
tidb soft memlock 5000000
tidb hard memlock 5000000

Skip below settings:
Swap Space Should be disabled
Disk Block Size Set the system disk Block size to 4096
Disk Readahead Set the value of the readahead data disk to 4096 at a minimum
CPU Frequency Scaling It is recommended to turn on CPU overclocking
Transparent Hugepages For Red Hat 7+ and CentOS 7+ systems, it is required to set the Transparent Hugepages to always
I/O Scheduler Set the I/O Scheduler of data disks to the deadline mode

vi /etc/sysctl.conf
vm.min_free_kbytes=268435456
vm.swappiness=0
net.core.somaxconn=32768
net.ipv4.tcp_syncookies=0
net.ipv4.ip_local_port_range = 32768 61000

Name Host IP Services
slcai846 10.242.102.174 PD1, TiDB
slcai853 10.242.102.175 PD2
slcai852 10.242.102.180 PD3
slcai851 10.242.102.179 TiKV1
slcai847 10.242.103.144 TiKV2
slcai850 10.242.102.178 TiKV3

./bin/pd-server --name=pd1
–data-dir=pd
–client-urls=“http://10.242.102.174:2379
–peer-urls=“http://10.242.102.174:2380
–initial-cluster=“pd1=http://10.242.102.174:2380,pd2=http://10.242.102.175:2380,pd3=http://10.242.102.180:2380”
-L “info”
–log-file=pd.log &

./bin/pd-server --name=pd2
–data-dir=pd
–client-urls=“http://10.242.102.175:2379
–peer-urls=“http://10.242.102.175:2380
–initial-cluster=“pd1=http://10.242.102.174:2380,pd2=http://10.242.102.175:2380,pd3=http://10.242.102.180:2380”
-L “info”
–log-file=pd.log &

./bin/pd-server --name=pd3
–data-dir=pd
–client-urls=“http://10.242.102.180:2379
–peer-urls=“http://10.242.102.180:2380
–initial-cluster=“pd1=http://10.242.102.174:2380,pd2=http://10.242.102.175:2380,pd3=http://10.242.102.180:2380”
-L “info”
–log-file=pd.log &

nohup ./bin/tikv-server --pd=“10.242.102.174:2379,10.242.102.175:2379,10.242.102.180:2379”
–addr=“10.242.102.179:20160”
–status-addr=“10.242.102.179:20180”
–data-dir=tikv
–log-file=tikv.log >.tikv1.nohup 2>&1 &

nohup ./bin/tikv-server --pd=“10.242.102.174:2379,10.242.102.175:2379,10.242.102.180:2379”
–addr=“10.242.103.144:20160”
–status-addr=“10.242.103.144:20180”
–data-dir=tikv
–log-file=tikv.log >.tikv2.nohup 2>&1 &

nohup ./bin/tikv-server --pd=“10.242.102.174:2379,10.242.102.175:2379,10.242.102.180:2379”
–addr=“10.242.102.178:20160”
–status-addr=“10.242.102.178:20180”
–data-dir=tikv
–log-file=tikv.log >.tikv3.nohup 2>&1 &

nohup ./bin/tidb-server --store=tikv
–path=“10.242.102.174:2379,10.242.102.175:2379,10.242.102.180:2379”
–log-file=tidb.log >.tidb.nohup 2>&1 &

mysql -h 10.242.102.174 -P 4000 -u root -D test
–》 ok

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值