当前位置:网站首页>集群监控——Zabbix
集群监控——Zabbix
2022-08-04 12:00:00 【丝丝呀】
1 Zabbix部署
集群规划
1.1 准备工作
关闭集群
如果集群开启,先关闭集群。因为安装Zabbix前,需要重启虚拟机。
[[email protected] ~]$ cluster.sh stop
关闭防火墙(3台节点,已关闭)
[[email protected] ~]$ sudo service iptables stop
[[email protected] ~]$ sudo chkconfig iptables off
[[email protected] ~]$ sudo service iptables stop
[[email protected] ~]$ sudo chkconfig iptables off
[[email protected] ~]$ sudo service iptables stop
[[email protected] ~]$ sudo chkconfig iptables off
闭SELinux(hadoop102)
1)修改配置文件/etc/selinux/config
[[email protected] ~]$ sudo vim /etc/selinux/config
修改如下内容
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2)重启服务器
[[email protected] ~]$ sudo reboot
1.2 配置Zabbix yum源
安装yum仓库
1)安装zabbix的yum仓库
[[email protected]hadoop102 ~]$ sudo rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
[[email protected]hadoop103 ~]$ sudo rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
[[email protected]hadoop104 ~]$ sudo rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
2)安装Software Collections仓库
[[email protected]hadoop102 ~]$ sudo yum install -y centos-release-scl
[[email protected]hadoop103 ~]$ sudo yum install -y centos-release-scl
[[email protected]hadoop104 ~]$ sudo yum install -y centos-release-scl
安装完仓库,出现这三个文件
修改zabbix仓库配置文件
执行以下命令完成全局替换,三台都替换
[[email protected] ~]$ sudo sed -i 's/http:\/\/repo.zabbix.com/https:\/\/mirrors.aliyun.com\/zabbix/g' /etc/yum.repos.d/zabbix.repo
启用zabbix-web仓库
打开/etc/yum.repos.d/zabbix.repo文件
[[email protected] yum.repos.d]$ vim zabbix.repo
2 安装Zabbix
在hadoop102、hadoop103、hadoop104三台节点分别执行以下安装命令
[[email protected]hadoop102 ~]$ sudo yum install -y zabbix-server-mysql zabbix-agent zabbix-web-mysql-scl zabbix-apache-conf-scl
[[email protected]hadoop103 ~]$ sudo yum install -y zabbix-agent
[[email protected]hadoop104 ~]$ sudo yum install -y zabbix-agent
3 配置Zabbix
1)创建zabbix数据库
[[email protected]hadoop102 ~]$ mysql -uroot -p000000 -e"create database zabbix character set utf8 collate utf8_bin"
2)导入Zabbix建表语句
[[email protected]hadoop102 ~]$ zcat /usr/share/doc/zabbix-server-mysql-5.0.*/create.sql.gz | mysql -uroot -p000000 zabbix
查看一下
3)配置Zabbix_Server(hadoop102)
修改zabbix-server配置文件
[[email protected] ~]$ sudo vim /etc/zabbix/zabbix_server.conf
DBHost=hadoop102
DBName=zabbix
DBUser=root
DBPassword=000000
4) 配置Zabbix_Agent(三台节点)
修改zabbix-agent配置文件
[[email protected] ~]$ sudo vim /etc/zabbix/zabbix_agentd.conf
修改如下内容:
Server=hadoop102
#ServerActive=127.0.0.1
#Hostname=Zabbix server
5)配置Zabbix_Web时区
修改/etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf文件
[[email protected] ~]$ sudo vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai
4 启动停止Zabbix
4.1 启动Zabbix
[[email protected]hadoop102 ~]$ sudo systemctl start zabbix-server zabbix-agent httpd rh-php72-php-fpm
查看一下状态
[[email protected] ~]$ sudo systemctl status zabbix-server zabbix-agent httpd rh-php72-php-fpm
设置开机自启
[[email protected]hadoop102 ~]$ sudo systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
[[email protected]hadoop103 ~]$ sudo systemctl start zabbix-agent
[[email protected]hadoop103 ~]$ sudo systemctl enable zabbix-agent
[[email protected]hadoop104 ~]$ sudo systemctl start zabbix-agent
[[email protected]hadoop104 ~]$ sudo systemctl enable zabbix-agent
4.2 停止Zabbix
[[email protected]hadoop102 ~]$ sudo systemctl stop zabbix-server zabbix-agent httpd rh-php72-php-fpm
[[email protected]hadoop102 ~]$ sudo systemctl disable zabbix-server zabbix-agent httpd rh-php72-php-fpm
[[email protected]hadoop103 ~]$ sudo systemctl stop zabbix-agent
[[email protected]hadoop103 ~]$ sudo systemctl disable zabbix-agent
[[email protected]hadoop104 ~]$ sudo systemctl stop zabbix-agent
[[email protected]hadoop104 ~]$ sudo systemctl disable zabbix-agent
4.3 连接Zabbix_Web数据库
1)浏览器访问http://hadoop102/zabbix/
2)检查配置
3)配置数据库
4)配置zabbix-server
4.4 登录Zabbix
1)用户名密码如下
用户名:Admin 密码:zabbix
2)点击User Settings,语言设成中文
边栏推荐
- 从数学角度和编码角度解释 熵、交叉熵、KL散度
- 考研数一数二数三之间的具体详细区别
- 编辑器vscode Already included file name ‘xxx‘ differs from file name ‘xxx‘ only in casing报错
- C#控制台退出前操作
- 200PLC转以太网与研华webaccess modbusTCP客户端在空调机上应用配置案例
- 能力更强,医疗单据识别+医疗知识库校验
- 【目标检测】yolov3特征提取网络------Darknet53网络及pytorch实现
- 【目标检测】YOLOv4特征提取网络——CSPDarkNet53结构解析及PyTorch实现
- 【地平线旭日X3派试用体验】从开机到点灯(第一节)
- 数据库表列类型;DML_添加数据;DDL_修改,删除数据库表
猜你喜欢
随机推荐
LeetCode每日一题(858. Mirror Reflection)
节流函数(每隔一段时间就会执行一次)
划重点!2022面试必刷461道大厂架构面试真题汇总+面经+简历模板
Tapdata 开源项目基础教程:功能特性及实操演示
systemdd-dev病毒杀
IBM Q复制ALTER ADD COLUMN
Flutter使用 json_serializable 解析 JSON 最佳方案
企业应当实施的5个云安全管理策略
DQL-查询操作
飞书更新招聘功能 候选人可选择面试时间
Transferring Rich Feature Hierarchies for Robust
技术分享| 融合调度系统中的电子围栏功能说明
【VBox】解决复制VBox虚拟机后提示硬盘UUID 已经存在的问题
11. Network planning and design
喂,你知道节流是什么吗?
小程序实战(一)- 骨架屏的应用与实现
Redis(一)安装与配置
OAuth2图文快速入门
The sword refers to the Great Wall Cannon?Official spy photos of Changan's new pickup
树莓派入门