栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Centos8安装部署zabbix6.0

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Centos8安装部署zabbix6.0

1:永久关闭防火墙.

systemctl disable --now firewalld

2:关闭selinux.

sed -i 's/SELINUX=enforcing/SELINUX=disabled/'

3:安装zabbix,保证机器能上网即可.直接用zabbix的源安装速度也不慢.

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

4:安装 zabbix server,web前端和anget.

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

5:安装数据库,zabbix6.0需要Mariadb10.5以上的版本.

vi /etc/yum.repos.d/MariaDB.repo

6:在repo中添加下面的代码.

# MariaDB 10.5 CentOS repository list - created 2022-04-22 11:10 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://mirror.yongbok.net/mariadb/yum/10.5/centos8-amd64
module_hotfixes=1
gpgkey=https://mirror.yongbok.net/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

7:安装数据库.

sudo dnf install MariaDB-server

8:启动数据库,并加入开机自启.

sudo systemctl start mariadb
sudo systemctl enable mariadb

9:创建并且初始化数据库.

mysql -uroot -p
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;

10:导入初始架构和数据,系统将提示您输入新创建的密码.

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

11: 为Zabbix server配置数据库,编辑配置文件 /etc/zabbix/zabbix_server.conf

DBPassword=password

12: 启动Zabbix server和agent进程,并为它们设置开机自启.

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

13:查看端口信息. 10051是zabbix server的端口,10050是anget的端口,3306是Mariadb的端口,80是http的端口,都是监听状态说明没有问题.

netstat -lntp

 

 

14:可以用http://IP/zabbix或和http://server_name/zabbix 登陆zabbix了.按照提示配置一下zabbix即可.默认的用户名是Admin,密码是zabbix

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/851035.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号