linux zabbix监控进程和日志(续)
Zabbix监控mysql主从
1、部署mysql主从,使用mariadb进行操作
[root@server ~]# vim /etc/hosts
192.168.78.138 master.example.com master
192.168.78.139 slave.example.com slave
2、将server、agent1、master、slave主机的/etc/hosts文件全部设置为
192.168.78.130 server.example.com server
192.168.78.137 agent.example.com agent
192.168.78.138 master.example.com master
192.168.78.139 slave.example.com slave
[root@agent ~]# scp root@192.168.78.130:/etc/hosts /etc/hosts
root@192.168.78.130's password:
hosts 100% 318 245.9KB/s 00:00
[root@master ~]# scp root@192.168.78.130:/etc/hosts /etc/hosts
root@192.168.78.130's password:
hosts 100% 318 245.9KB/s 00:00
[root@slave ~]# scp root@192.168.78.130:/etc/hosts /etc/hosts
root@192.168.78.130's password:
hosts 100% 318 245.9KB/s 00:00
3、master和slave两台主机都安装mariadb mariadb-server
[root@master ~]# ls /etc/yum.repos.d/
CentOS-Base.repo epel-modular.repo epel.repo epel-testing-modular.repo epel-testing.repo
[root@slave ~]# ls /etc/yum.repos.d/
CentOS-Base.repo epel-modular.repo epel.repo epel-testing-modular.repo epel-testing.repo
[root@master ~]# yum install -y mariadb mariadb-server
[root@master ~]# systemctl enable --now mariadb
[root@slave ~]# yum install -y mariadb mariadb-server
[root@slave ~]# systemctl enable --no