当前位置:网站首页>zabbix监控系统部署
zabbix监控系统部署
2022-07-04 07:37:00 【拥抱云原生】
zabbix程序组件
zabbix组件有:
- Zabbix_server,服务端守护进程.
- Zabbix_agentd,agent守护进程
- zabbix_proxy,代理服务器
- zabbix_database,存储系统,mysql,pgsql
- Zabbix_web,web GUI图形化界面
- Zabbix_get,命令行工具,测试向agent发起数据采集请求.
- Zabbix_sender,命令行工具,测试向server发送数据
- Zabbix_java_gateway,java网关
zabbix服务端部署
zabbix5.0版本对php版本的要求,最低是7.2.0版本;对php扩展组件版本也有要求,详细可查看官方文档
https://www.zabbix.com/documentation/5.0/zh/start
准备好一台Linux服务器,设置好IP地址,yum源等
1.设置主机名
[[email protected] ~]# hostnamectl set-hostname server
[[email protected] ~]# hostname
server
2.关闭防火墙,selinux
[[email protected] ~]# systemctl stop firewalld && systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[[email protected] ~]# setenforce 0
[[email protected] ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
3.zabbix-server内存尽量更大点,4G为好(以下2G)
[[email protected] ~]# free -m
total used free shared buff/cache available
Mem: 1980 120 1446 9 414 1661
Swap: 2047 0 2047
4.获取zabbix下载源
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
5.更换zabbix.repo源为阿里的
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
6.清空yum源缓存,生成新的缓存
yum clean all
yum makecache
7.安装zabbix server和agent
yum install -y zabbix-server-mysql zabbix-agent
8.安装Software Collections,便于后续安装高版本的php,默认yum安装php版本为5.4过低;SCL(Software Collections)可以在同一个操作系统上安装和使用多个版本的软件,而不会影响整个系统的安装包;软件包会安装在/opt/rh目录下;/etc/opt/rh/软件包所有配置文件都存储在目录中的相应的目录中
[[email protected] ~]# yum install -y centos-release-scl
9.在zabbix.repo源开启zabbix-front前端源
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/frontend
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
10.安装zabbix前端环境,且是安装在scl环境下
[[email protected] ~]# yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl
11.安装azbbix所需的数据库,mariadb/mysql
[[email protected] ~]# yum install mariadb-server -y
12.配置数据库开机启动
[[email protected] ~]# systemctl enable --now mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
13.初始化数据库并设置root密码
[[email protected] ~]# mysql_secure_installation
14.添加数据库用户以及zabbix所需的数据库信息
[[email protected] ~]# mysql -uroot -pqhj666
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> create user [email protected] identified by 'qhj666';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all on zabbix.* to [email protected];
Query OK, 0 rows affected (0.00 sec)
15.使用zabbix-mysql命令,导入数据库信息(这里-p后面指定的是zabbix数据库)
[[email protected] ~]# zcat /usr/share/doc/zabbix-server-mysql-5.0.11/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:
16.修改zabbix server配置文件,修改数据库的密码
[[email protected] ~]# grep "^DBP" /etc/zabbix/zabbix_server.conf
DBPassword=qhj666
17.修改zabbix的php配置文件
[[email protected] ~]# tail -1 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai
18.启动zabbix相关服务
[[email protected] ~]# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
[[email protected] ~]# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
19.浏览器测试访问zabbix(默认账号Admin,密码zabbix)
192.168.10.50/zabbix
部署完成后
使用浏览器访问:http://192.168.10.50/zabbix
默认密码:Admin/zabbix
边栏推荐
- One of the general document service practice series
- L1-026 I love gplt (5 points)
- [Chongqing Guangdong education] National Open University spring 2019 770 real estate appraisal reference questions
- Activiti common operation data table relationship
- Life planning (flag)
- Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
- L1-030 one gang one (15 points)
- 在所有SwiftUI版本(1.0-4.0)中原生实现Charts图表视图之思路
- MySQL中的文本處理函數整理,收藏速查
- Leetcode(215)——数组中的第K个最大元素
猜你喜欢
Blog stop statement
University stage summary
Rhcsa the next day
大学阶段总结
[kubernetes series] kubesphere is installed on kubernetes
The crackdown on Huawei prompted made in China to join forces to fight back, and another enterprise announced to invest 100 billion in R & D
Zephyr 学习笔记1,threads
MySQL中的文本處理函數整理,收藏速查
Advanced MySQL: Basics (5-8 Lectures)
Used on windows Bat file startup project
随机推荐
Zephyr learning notes 1, threads
tornado之目录
It's healthy to drink medicinal wine like this. Are you drinking it right
rapidjson读写json文件
Docker install MySQL
论文学习——基于极值点特征的时间序列相似性查询方法
Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
大学阶段总结
Zephyr Learning note 2, Scheduling
2022-021rts: from the second half of the year
How to send mail with Jianmu Ci
[kubernetes series] kubesphere is installed on kubernetes
JVM -- class loading process and runtime data area
Zephyr study notes 2, scheduling
21个战略性目标实例,推动你的公司快速发展
What are the work contents of operation and maintenance engineers? Can you list it in detail?
[Flink] temporal semantics and watermark
时序数据库 InfluxDB 2.2 初探
Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)
JVM中堆概念