部署zabbix5.0
前言
检查防火墙是否关闭
vim /etc/selinux/config
SELINUX=disabled
内存4G为好
配置好阿里yum源
实验步骤
标签:password,部署,zabbix5,server,zabbix,yum,mysql,php From: https://www.cnblogs.com/xuxuxuxuxu/p/17498167.html
获取zabbix的下载源
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
更换zabbix.repo源(下载快点)
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
清空缓存,下载zabbix服务器
yum clean all
yum makecache
yum install zabbix-server-mysql zabbix-agent -y
安装 Software Collections ,便于后续安装高版本php,默认yum安装的php版本为5.4过低。可以在机器上,使用多个版本的软件,并且不会影响整个系统的依赖环境
yum install centos-release-scl -y
修改zabbix-fronted 前端源
enabled=1
安装zabbix前端环境
yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y
安装mysql数据库 并启动 设置开机自启
yum install mariadb-server -y
systemctl start mysqld
systemctl enable mysqld
默认没有密码修改密码
先进入mysql
mysql -u root -p
set password root@localhost=password('root');
如果出现
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
则卸载plugin validate_password
uninstall plugin validate_password;
创建zabbix数据库
create database zabbix character set utf8 collate utf8_bin;
创建zabbix用户
create user zabbix@localhost identified by 'root';
给zabbix用户zabbix数据库的权限,并刷新权限退出
grant all privileges on zabbix.* to zabbix@localhost;
flush privileges;
quit;
使用zabbix-mysql命令,导入数据库信息
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
vim /etc/zabbix/zabbix_server.conf
找到DBPassword=
后面填写你的mysql密码
grep '^DBPassword' zabbix_server.conf 检查一下密码是否设置
修改zabbix的php文件/etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf 把时区改为亚洲上海 并去掉注释
php_value[date.timezone] = Asia/Shanghai
启动相关服务
systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm访问ip/zabbix
默认账号密码
Admin
zabbix