目录
2、Install Zabbix server and agent
4、Install Zabbix frontend packages.
7.3、安装5.7要去zabbix的yum源里面关闭掉8.0的源
10、启动Zabbix server和agent进程,并为它们设置开机自启:
1、Install Zabbix repository
# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
# yum clean all
2、Install Zabbix server and agent
# yum install zabbix-server-mysql zabbix-agent
3、Install Zabbix frontend
# yum install centos-release-scl
编辑配置文件 /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.
[zabbix-frontend]
...
enabled=1
...
4、Install Zabbix frontend packages.
# yum install zabbix-web-mysql-scl zabbix-apache-conf-scl
5、创建初始数据库
Make sure you have database server up and running.
安装mysql5.7
6、从mysql官网获取yum源
mysql官方下载页:https://dev.mysql.com/downloads/https://dev.mysql.com/downloads/
目前在官网下载 jdk以及其他oracle公司的产品的时候需要登陆,这边分享一个账号,方便下载
账户:3028064308@qq.com
密码:OraclePassword123!
这里选择el7的版本
7、下载到服务器
wget https://dev.mysql.com/get/mysql80-community-release-el7-6.noarch.rpm
7.1、安装下载好的rpm包
rpm -Uvh mysql80-community-release-el7-5.noarch.rpm
7.2、查看MySQL的版本
yum repolist all | grep mysql
注:这里显示8.0是开启的5.7是关闭的所以要去关掉8.0开启5.7的yum源。
7.3、安装5.7要去zabbix的yum源里面关闭掉8.0的源
vi /etc/yum.repos.d/mysql-community.repo
7.4、然后查看mysql8.0的源是否被关闭
yum repolist all | grep mysql
7.5、安装MySQL
yum install mysql-community-server
8、开启msyql服务
开启服务
systemctl start mysqld
查看状态
systemctl status mysqld
8.1、改默认密码
[root@localhost ~]# grep -i "password" /var/log/mysqld.log 2021-05-28T02:42:52.290430Z 1 [Note] A temporary password is generated for root@localhost: cSNlQY/Qr1KU
[root@localhost ~]# mysqladmin -u root -p password "WWW.1.com" Enter password:
然后输入上面的默认密码。
9、在数据库主机上运行以下代码。
# mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost; mysql> quit;
9.1、导入初始架构和数据,系统将提示您输入新创建的密码。
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
9.2、为Zabbix server配置数据库
编辑配置文件 /etc/zabbix/zabbix_server.conf
DBPassword=password
9.3、为Zabbix前端配置PHP
编辑配置文件 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf, uncomment and set the right timezone for you.
; php_value[date.timezone] = Europe/Riga
换成亚洲上海
php_value[date.timezone] = Asia/Shanghai
10、启动Zabbix server和agent进程,并为它们设置开机自启:
# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
11、登录zabbix并且把英文界面改成中文。
http:ip/zabbix
用户名:Admin
密码:zabbix