当前位置:网站首页>ZABBIX distributed
ZABBIX distributed
2022-07-28 14:21:00 【Bandiaozi refining whole stack】
zabbix Distributed
Zabbix proxy Use scenarios :
Monitoring remote area equipment Monitor local network instability areas
When monitoring thousands of devices , reduce zabbix server The load of
Simplify the maintenance of Distributed Monitoring .
When thousands of servers are monitored , Generally monitored Server There will be a lot of pressure , So there is distributed monitoring to share Server pressure , That is, add a proxy server , Function and Server almost , The proxy server collects agent The monitoring data is returned to Server To deal with .
zabbix proxy Just one tcp Connect to zabbix server, So just add a rule to the firewall zabbix proxy The database must be connected with server Separate , Otherwise the data will be destroyed
zabbix proxy After collecting the data , First, cache the data locally , And then pass it on to zabbix server, In this way, data will not be lost due to any temporary communication problems with the server . This time is by proxy Parameters in the configuration file ProxyLocalBuffer and ProxyOfflineBuffer decision
Experiment preparation
equipment 1、2 Build the environment before the blog , There is no building here
| host | ip |
|---|---|
| equipment 1 zabbix-server | 192.168.70.10 |
| equipment 3 zabbix-proxy | 192.168.70.30 |
| equipment 2 zabbix-agent | 192.168.70.20 |
equipment 3
[[email protected] ~]# ls
anaconda-ks.cfg sysconfigure.sh
[[email protected] ~]# bash sysconfigure.sh Execute the script to configure the environment
install matiadb-server
[[email protected] ~]# yum -y install mariadb-server
start-up mariadb
[[email protected] ~]# systemctl start mariadb
Start and start
[[email protected] ~]# systemctl enable mariadb
Access to database
[[email protected] ~]# mysql
establish zabbix_proxy library , And give utf8 Recognizable Chinese
MariaDB [(none)]> create database zabbix_proxy character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
mysql to grant authorization zabbix_proxy User accessible zabbix_proxy All tables in the library
MariaDB [(none)]> grant all on zabbix_proxy.* to [email protected] identified by '123456';
Query OK, 0 rows affected (0.00 sec)
View Library
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
| zabbix_proxy |
+--------------------+
5 rows in set (0.00 sec)
To view the user
MariaDB [(none)]> select user,host from mysql.user;
+--------------+--------------+
| user | host |
+--------------+--------------+
| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| root | localhost |
| zabbix_proxy | localhost |
| | zabbix-proxy |
| root | zabbix-proxy |
+--------------+--------------+
7 rows in set (0.00 sec)
Modify hostname
[[email protected] ~]# hostnamectl set-hostname zabbix-proxy
[[email protected] ~]# exit
Network source
[[email protected] ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[[email protected] ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-
Clear cache
[[email protected] ~]# yum clean all
[[email protected] ~]# yum makecache
Tsinghua University link download software zabbix-proxy-mysql-5.0.22-1.el7.x86_64.rpm
[[email protected] ~]# wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/5.0/rhel/
7/x86_64/zabbix-proxy-mysql-5.0.22-1.el7.x86_64.rpm
on connection mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... Connected .
error : Can't verify mirrors.tuna.tsinghua.edu.cn By “/C=US/O=Let's Encrypt/CN=R3” Certificate issued :
The certificate issued has expired .
To connect to... In an unsafe manner mirrors.tuna.tsinghua.edu.cn, Use “--no-check-certificate”.
[[email protected] ~]# wget --no-check-certificate https://mirrors.tuna.tsinghua.edu.cn/
zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-proxy-mysql-5.0.22-1.el7.x86_64.rpm
install
[[email protected] ~]# rpm -hvi zabbix-proxy-mysql-5.0.22-1.el7.x86_64.rpm
View each path
[[email protected] ~]# rpm -ql zabbix-proxy-mysql
/etc/logrotate.d/zabbix-proxy
/etc/zabbix/zabbix_proxy.conf
/usr/lib/systemd/system/zabbix-proxy.service
/usr/lib/tmpfiles.d/zabbix-proxy.conf
/usr/lib/zabbix/externalscripts
/usr/sbin/zabbix_proxy_mysql
/usr/share/doc/zabbix-proxy-mysql-5.0.22
/usr/share/doc/zabbix-proxy-mysql-5.0.22/AUTHORS
/usr/share/doc/zabbix-proxy-mysql-5.0.22/COPYING
/usr/share/doc/zabbix-proxy-mysql-5.0.22/ChangeLog
/usr/share/doc/zabbix-proxy-mysql-5.0.22/NEWS
/usr/share/doc/zabbix-proxy-mysql-5.0.22/README
/usr/share/doc/zabbix-proxy-mysql-5.0.22/schema.sql.gz
/usr/share/man/man8/zabbix_proxy.8.gz
/var/log/zabbix
/var/run/zabbix
Import the initial data table and schema table
[[email protected] ~]# zcat /usr/share/doc/zabbix-proxy-mysql-5.0.22/schema.sql.gz | mysql -uzabbix_proxy -p123456 zabbix_proxy
Modify the configuration file
[[email protected] ~]# vim /etc/zabbix/zabbix_proxy.conf
……
30 Server=192.168.70.10 # Appoint zabbix server The earth site
49 Hostname=Zabbix-proxy # Specify the local name ( Self determination The righteous ), be used for zabbix server Distinguish between each proxy node
173 DBName=zabbix_proxy # Specify the database name ( With the database The library name created should be consistent )
188 DBUser=zabbix_proxy # Specify the user name to connect to the database ( Consistent with the authorized user name of the database )
196 DBPassword=123456 # Specify user password
Turn on
[[email protected] ~]# systemctl start zabbix-proxy.service
restart
[[email protected] ~]# systemctl restart zabbix-proxy.service
Boot from boot
[[email protected] ~]# systemctl enable zabbix-proxy.service
Check the network port
[[email protected]y ~]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 16504/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6647/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 8010/master
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 27384/zabbix_proxy
tcp6 0 0 :::22 :::* LISTEN 6647/sshd
tcp6 0 0 ::1:25 :::* LISTEN 8010/master
tcp6 0 0 :::10051 :::* LISTEN 27384/zabbix_proxy
restart
[[email protected] ~]# systemctl restart zabbix-proxy.service
192.168.70.20 equipment
Modify the configuration file
[[email protected] ~]# vim /etc/zabbix/zabbix_agentd.conf
……
119 Server=192.168.70.30 # Appoint zabbix proxy Address
ServerActive=127.0.0.1 The machine itself
171 Hostname=192.168.70.20 # Specify the local name ( Self determination The righteous ), be used for zabbix proxy Distinguish between each agent node
restart
[[email protected] ~]# systemctl restart zabbix-agent.service
Check the network port
[[email protected] ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6802/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6672/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 6883/master
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 12480/zabbix_agentd
tcp6 0 0 :::22 :::* LISTEN 6672/sshd
tcp6 0 0 ::1:25 :::* LISTEN 6883/master
tcp6 0 0 :::10050 :::* LISTEN 12480/zabbix_agentd
[[email protected] ~]# systemctl restart zabbix-agent.service
Enter the interface at management ——>agent agent 
To configure ——> host ——>
Template selection to update 
Main engine Update again 
To configure ——> host The place marked with red indicates normal 
here ZBX If it doesn't light up from zabbix-server zabbix-proxy zbbix-agent Restart once . If it is invalid, delete the template and select again to update Host update attempt .
Solution references
https://blog.csdn.net/weixin_30776545/article/details/99486652
https://blog.csdn.net/weixin_44234846/article/details/99621182?utm_term=zabbix%E7%9A%84ZBX%E6%B2%A1%E4%BA%AE&utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2allsobaiduweb~default-2-99621182-null-null&spm=3001.4430
zabbix Distributed build article
https://www.cnblogs.com/ywb-articles/p/11826613.html
Here is the reference
边栏推荐
- 离散对数问题(DLP) && Diffie-Hellman问题(DHP)
- Understand the principle behind the virtual list, and easily realize the virtual list
- Open source project - taier1.2 release, new workflow, tenant binding simplification and other functions
- 数据库优化 理解这些就够了
- 论文研读--Masked Generative Distillation
- Target detection: speed and accuracy comparison (fater r-cnn, r-fcn, SSD, FPN, retinanet and yolov3)
- As a programmer, how to manage time efficiently?
- Clickhouse分布式集群搭建
- Custom Configuration Sections
- Leetcode 1331. array sequence number conversion
猜你喜欢

走进音视频的世界——FLV视频封装格式

Mobile phone scrolling screenshot software recommendation

如何有效进行回顾会议(上)?

83.(cesium之家)cesium示例如何运行

Revised version | target detection: speed and accuracy comparison (faster r-cnn, r-fcn, SSD, FPN, retinanet and yolov3)

bgp实验

手机滚动截屏软件推荐

Leetcode 0142. circular linked list II

离散对数问题(DLP) && Diffie-Hellman问题(DHP)

在centos中安装mysql5.7.36
随机推荐
URL related knowledge points
Custom Configuration Sections
Thoroughly master binary search
QQ robot configuration record based on nonebot2
开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能
在centos中安装mysql5.7.36
jenkins
成为绿色数据中心新样板,东莞华为云数据中心是怎样炼成的?
How to write test cases in software testing technology
[ecmascript6] set and map
Revised version | target detection: speed and accuracy comparison (faster r-cnn, r-fcn, SSD, FPN, retinanet and yolov3)
QT自制软键盘 最完美、最简单、跟自带虚拟键盘一样
Verification code brute force cracking test [easy to understand]
Security assurance is based on software life cycle - networkpolicy application
线程阻塞的三种情况。
QT self-made soft keyboard is the most perfect and simple, just like its own virtual keyboard
【Try to Hack】HFish蜜罐部署
HCIP第十天
一文读懂如何部署具有外部数据库的高可用 K3s
Recommended super easy-to-use mobile screen recording software