安装Zabbix5.0,监控java spring进程和MySQL进程
1.zabbix安装需求:
需求:监控云服务器上的进程
10.10.10.1 | Zabbix server端 | 2个java进程 |
---|---|---|
10.10.10.1 | Zabbix 客户端 | 3个java进程+MySQL |
地址:https://www.zabbix.com/
1.1 安装Zabbix server端
1.2 安装MySQL
systemctl stop firewalld #关闭防火墙服务
systemctl disable firewalld #禁止防火墙服务启动
setenforce = 0 #临时关闭SELinux
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config #修改将“SELINUX=enforcing”更改为“SELINUX=disabled”,永久关闭SELINUX
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm #下载mysql 5.7安装包
rpm -ivh mysql57-community-release-el7-9.noarch.rpm #安装源
yum install -y mysql-server #安装mysql
service mysqld start && chkconfig mysqld on #启动Mysqld服务和设置开机自动启动
grep -an “temporary password” /var/log/mysqld.log #查看初始密码
mysql -u root -p nX6-hKRoLjyW #使用初始密码登陆
mysql: [Warning] Using a password on the command line interface can be insecure.
...
Server version: 5.7.29
...
mysql>
mysql> alter user root@"localhost" identified by "123qqqWWW"; 修改登陆密码
mysql -uroot -p #使用新密码登陆
1.3.安装Zabbix 5.0监控平台
1.3.1安装Zabbix Yum源仓库
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm```
yum clean all
1.3.2 安装Zabbix Server 与 Zabbix agent
yum install -y zabbix-server-mysql zabbix-agent #有些云服务器比较慢,这里需要多重试几次。
1.3.3 安装Zabbix frontend
[root@localhost ~]# yum -y install centos-release-scl
[root@localhost ~]# vim /etc/yum.repos.d/zabbix.repo
...
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
base