1、部署mysql主从,使用mariadb进行操作,将server、agent ,master、slave主机的/etc/hosts文件全部设置为
192.168.253.139 server.example.com server
192.168.253.140 agent1.example.com agent
192.168.253.129 master.example.com master
192.168.253.130 slave.example.com slave
2. master和slave操作系统是centos8 将centos8的安装源下载下来,然后两台主机都安装mariadb mariadb-server
[root@129-master yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https:
[root@129-master yum.repos.d]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d'
[root@129-master yum.repos.d]# cd
[root@129-master ~]# yum -y install mariadb-server mariadb
[root@129-master ~]# systemctl restart mariadb
[root@129-master ~]# systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/
[root@130-slave ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https:
[root@130-slave ~]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/Ce
[root@130-slave ~]# yum -y install mariadb-server mariadb
[root@130-slave ~]# systemctl restart mariadb
[root@130-slave ~]# systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi