@zhangyy
2021-06-01T18:49:28.000000Z
字数 2577
阅读 192
tidb
cat /etc/hosts
echo "192.168.1.80 node01.flyfish.cn">> /etc/hosts
echo "192.168.1.81 node02.flyfish.cn">> /etc/hosts
echo "192.168.1.82 node03.flyfish.cn">> /etc/hosts
echo "192.168.1.83 node04.flyfish.cn">> /etc/hosts
echo "192.168.1.84 node05.flyfish.cn">> /etc/hosts
echo "192.168.1.85 node06.flyfish.cn">> /etc/hosts
echo "192.168.1.86 node07.flyfish.cn">> /etc/hosts
echo "192.168.1.87 node08.flyfish.cn">> /etc/hosts
echo "192.168.1.88 node09.flyfish.cn">> /etc/hosts
echo "192.168.1.89 node10.flyfish.cn">> /etc/hosts
echo "192.168.1.90 node11.flyfish.cn">> /etc/hosts
echo "192.168.1.91 node12.flyfish.cn">> /etc/hosts
echo "192.168.1.92 node13.flyfish.cn">> /etc/hosts
echo "192.168.1.93 node14.flyfish.cn">> /etc/hosts
echo "export LANG=en_US.UTF8" >> ~/.bash_profile
cat ~/.bash_profile
yum install lvm2 -y
pvcreate /dev/sdb
vgcreate tidbvg /dev/sdb
lvcreate -n tidblv -L 200000M tidbvg
mkfs.ext4 /dev/tidbvg/tidblv
vi /etc/fstab
/dev/sda1 / ext4 defaults 0 0
/dev/sda2 swap swap defaults 0 0
/dev/tidbvg/tidblv /tidb ext4 defaults,nodelalloc,noatime 0 0
mkdir /tidb
mount /tidb
mkdir /tidb/soft
groupadd -g 60001 tidb
useradd -u 61001 -g tidb tidb
chown -R tidb:tidb /tidb
chmod -R 775 /tidb
echo "tidb" | passwd --stdin tidb
systemctl set-default multi-user.target
cat >> /etc/security/limits.conf << EOF
root soft nofile 1048576
root hard nofile 1048576
tidb soft nproc 1048576
tidb hard nproc 1048576
tidb soft nofile 1048576
tidb hard nofile 1048576
tidb soft stack 10240
tidb hard stack 32768
tidb hard memlock unlimited
tidb soft memlock unlimited
EOF
cat >> /etc/sysctl.conf << EOF
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_mem = 786432 2097152 3145728
net.ipv4.tcp_rmem = 4096 4096 16777216
net.ipv4.tcp_wmem = 4096 4096 16777216
vm.swappiness=1
vm.min_free_kbytes=204800000
vm.overcommit_memory=0
EOF
sysctl -p
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock
echo "SELINUX=disabled" > /etc/selinux/config
echo "#SELINUXTYPE=targeted " >> /etc/selinux/config
cat /etc/selinux/config
setenforce 0
systemctl stop firewalld.service
systemctl disable firewalld.service
umount /mnt
mount /dev/cdrom /mnt
cd /etc/yum.repos.d
mkdir bk
mv *.repo bk/
echo "[EL7-1]" > /etc/yum.repos.d/itpux.repo
echo "name =Linux-7" >> /etc/yum.repos.d/itpux.repo
echo "baseurl=file:///mnt" >> /etc/yum.repos.d/itpux.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/itpux.repo
echo "enabled=1" >> /etc/yum.repos.d/itpux.repo
yum install -y ntp
echo "server 127.127.1.0 iburst" >> /etc/ntp.conf
systemctl restart ntpd
systemctl enable ntpd
ntpq -p
ntpstat
root:
echo "server 192.168.1.80">> /etc/ntp.conf
echo "restrict 192.168.1.80 nomodify notrap noquery" >> /etc/ntp.conf
ntpdate -u 192.168.1.80
hwclock -w
systemctl restart ntpd
systemctl enable ntpd
ntpq -p