Centos8安装Zabbix6.0

Centos8 为最小安装模式

一、关闭防火墙:

systemctl stop firewalld.service      #停止firewalld服务
systemctl disable firewalld.service    #设置开机默认不启动

#生产环境单独在防火墙上开启端口和策略
#firewall-cmd --permanent --zone=public --add-port=80/tcp
# firewall-cmd --reload

二、关闭selinux

getenforce    #查看状态
vi /etc/sysconfig/selinux    #开机不启动
     SELINUX=disabled

三、安装zabbix6.0源

rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm

dnf clean all                        *清理yum缓存

四、安装zabbix6.0服务端和客户端

dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y

如提示

错误:为仓库 'appstream' 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist

请更换centos8的源
参考这篇
https://www.jianshu.com/p/4f7616dd9d64

五、配置数据库

1.安装MariaDB

注意:MariaDB要10.5以上版本,不然会不能启动


image.png

新建一个 MariaDB.repo

# MariaDB 10.5 CentOS repository list - created 2022-02-21 03:48 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://ftp.ubuntu-tw.org/mirror/mariadb/yum/10.5/centos8-amd64
module_hotfixes=1
gpgkey=https://ftp.ubuntu-tw.org/mirror/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

放到 /etc/yum.repos.d/

dnf install -y mariadb-server    # yum安装MariaDB
systemctl start mariadb.service    #启动mariadb
systemctl enable mariadb.service   #设置开机启动
mysqladmin -uroot password '********';    #创建管理员密码   *自己更改

2.创建初始数据库

 mysql -uroot -p
password
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;

3.导入初始架构和数据

zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix

提示输入的密码为:password
mysql> create user zabbix@localhost identified by 'password';


4.Zabbix server配置数据库

vi /etc/zabbix/zabbix_server.conf
image.png

八、启动Zabbix

systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm

九、配置向导

image.png

和zabbix5相同,不再累述

附:
web界面设置为中文乱码解决


image.png

还是字体问题
查看配置文件


image.png

复制windowns系统下面 仿宋字体文件到 /usr/share/zabbix/assets/fonts/
改名为:graphfont.ttf
刷新页面,字体正常
image.png

相关监控模板下载
https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/exchange_active

你可能感兴趣的:(Centos8安装Zabbix6.0)