ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

企业实战|CentOS8安装Zabbix 4.4

2021-03-15 22:57:59  阅读:130  来源: 互联网

标签:4.4 zabbix Zabbix systemctl mysql root localhost CentOS8


Zabbix介绍:

Zabbix是一个基于Web界面提供分布式系统监视及网络监视功能的企业级开源解决方案。它能监视各种网络参数,保证服务器系统的安全运营,并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题;借助Zabbix可很轻松地减轻运维人员们繁重的服务器管理任务,实现业务系统持续运行。Zabbix分为Agent端和Server端,Agent端:主机通过安装agent方式采集数据。Server端:通过收集agent发送的数据,写入数据库(MySQL,ORACLE等),再通过php+apache在web前端展示。



实战环境:

  • Centos8_x64

  • Zabbix-4.4

安装步骤:

一、配置操作系统

1、重命名计算机名:

[root@localhost ~]# vim /etc/hostname

2、配置 SELinux:

[root@localhost ~]# vim /etc/selinux/config

更改:

SELINUX=disabled

3、配置防火墙:为了方便,我这里选择直接关闭防火墙;

[root@localhost ~]# systemctl stop firewalld.service [root@localhost ~]# systemctl disable firewalld.service

4、配置网络:设置固定 IP 地址;

[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens192更改:BOOTPROTO="static"
添加:IPADDR=10.10.10.50 NETMASK=255.255.255.0 GATEWAY=10.10.10.1 DNS1=10.10.10.5
重启网络:[root@localhost ~]# systemctl restart network


二、安装 Zabbix 

1、更新系统:

[root@zabbix ~]# yum update -y

2、安装必要组件:

[root@zabbix ~]# dnf install -y httpd mysql-server \php php-mysqlnd php-mbstring php-pdo php-gd

3、开启必要组件的服务:

[root@zabbix ~]# systemctl enable --now httpd.service [root@zabbix ~]# systemctl enable --now mysqld.service

4、更改 HTTP 时区

[root@zabbix ~]# vim /etc/php.ini# 设置:date.timezone = Asia/Shanghai

5、初始化数据:配置数据库密码(MySQL 的密码)


[root@zabbix ~]# mysql_secure_installation Securing the MySQL server deployment. Connecting to MySQL using a blank password.# 中间全部yVALIDATE PASSWORD COMPONENT can be used to test passwordsand improve security. It checks the strength of passwordand allows the users to set only those passwords which aresecure enough. Would you like to setup VALIDATE PASSWORD component?Press y|Y for Yes, any other key for No: yThere are three levels of password validation policy:LOW    Length >= 8MEDIUM Length >= 8, numeric, mixed case, and special charactersReload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success.All done!

6、创建并配置数据库:创建一个名为 zabbix 的数据,并为这个数据库创建一个名为 zabbix 的用户,并设 置密码为 “Shanghai2010@”,然后为这个用户赋予 

[root@zabbix tmp]# mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10Server version: 8.0.17 Source distributionCopyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database zabbix character set UTF8 collate utf8_bin;Query OK, 1 row affected, 2 warnings (0.19 sec)
mysql> create user 'zabbix'@'localhost' identified by 'Shanghai2010@';Query OK, 0 rows affected (0.08 sec)
mysql> grant ALL on zabbix.* to 'zabbix'@'localhost';Query OK, 0 rows affected (0.17 sec) mysql> flush privileges;Query OK, 0 rows affected (0.02 sec)
mysql> exitBye

7、安装 Zabbix yum 库:

[root@zabbix ~]# wget https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm[root@zabbix ~]# dnf install -y zabbix-release-4.4-1.el8.noarch.rpm [root@zabbix ~]# dnf makecache

8、安装 Zabbix 服务器组件

  [root@zabbix ~]# dnf install -y zabbix-server-mysql zabbix-web-mysql zabbix- apache-conf

9、使用Zabbix服务器安装文件中提供的脚本创建Zabbix存储库。

[root@zabbix ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -D zabbix -pShanghai2010@

 10、配置 Zabbix 服务器

[root@zabbix ~]# vim /etc/zabbix/zabbix_server.confDBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=Shanghai2010@

11、安装 Zabbix Agent,并启动服务

 [root@zabbix ~]# dnf install -y zabbix-agent [root@zabbix ~]# systemctl enable --now zabbix-server  [root@zabbix ~]# systemctl enable --now zabbix-agent

三、配置 Zabbix 完成安装

1、在浏览器中输入 “http://服务IP” 

2、点击 ”Next Step“

3、输入 zabbix 数据库的密码,然后点击 ”Next Step“

4、完成

5、Zabbix 默认的用户名是 ”Admin“,密码是 ”zabbix“。注意其中用户名中的 ”A“ 是大 写。

图片

6、进入 Zabbix 的 Dashboard 

图片


标签:4.4,zabbix,Zabbix,systemctl,mysql,root,localhost,CentOS8
来源: https://blog.51cto.com/15127549/2660761

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有