mysql 分布式,所有不再需要做主从
在每台 [mysqld]下加入一行:lower_case_table_names=1
准备环境:
(1)#/bin/bash
mkdir -p /mnt/dvd
mount /opt/rhel-server-7.5-x86_64-dvd.iso /mnt/dvd
cp redhat.repo local.repo
echo "" /etc/yum.repos.d/local.repo
cat >> /etc/yum.repos.d/local.repo << EOF
[rhel]
name=rhel
baseurl= file:///mnt/dvd
gpgcheck=0
enabled=1
EOF
yum clean all
yum repolist
(2)
yum install -y mysql
rpm -ivh /mnt/dvd/P*/net-tool*
(3)
pvcreate
/dev/sdb
/dev/sdc
/dev/sdd
/dev/sde
/dev/sdf
pvs
vgcreate appvg
/dev/
sdb
vgcreate datavg
/dev/sdc
vgcreate logvg
/dev/
sdd
vgcreate bakvg
/dev/
sde
vgcreate softvg
/dev/
sdf
vgs
lvcreate
-n softlv
-L
20G
softvg
lvcreate
-n mysqllv
-L
19
G
appvg
lvcreate
-n datalv
-
L
20G
datavg
lvcreate
-n loglv
-L
20G
logvg
lvcreate
-n baklv
-L
20G
bakvg
lvs
lvdisplay
mkfs.xfs
/dev/softvg/
softlv
mkfs.xfs
/dev/appvg/
mysqllv
mkfs.xfs
/dev/datavg/
datalv
mkfs.xfs
/dev/logvg/
loglv
mkfs.xfs
/dev/bakvg/baklv
#ext4文件格式用
mkfs -t ext4 /dev/***/mysqllv
mkdir
-p
/mysql/
app
mkdir
-p
/mysql/data
mkdir
-p
/mysql/log
mkdir
-p
/mysql/backup
mkdir
-p
/soft
echo "/dev/appvg/mysqllv /mysql/app
xfs
defaults
0 0"
>>/etc/fstab
echo "/dev/datavg/datalv /mysql/data
xfs
defaults
0 0"
>>/etc/fstab
echo "/dev/logvg/loglv /mysql/log
xfs
defaults
0 0"
>>/etc/fstab
echo "/dev/bakvg/