当前位置:网站首页>[learn ZABBIX from scratch] I. Introduction and deployment of ZABBIX
[learn ZABBIX from scratch] I. Introduction and deployment of ZABBIX
2022-06-24 14:11:00 【It's a bubble】
Zabbix Introduction and subordinates of
- Preface
- What is monitoring
- Zabbix Deploy
- 1. Download source , To configure yum
- 2. install zabbix The service side and zabbix-web front end
- 3. install mariadb, establish zabbix library , to grant authorization zabbix user
- 4. Configuration to start zabbix-server
- 5. modify Zabbix Front-end PHP To configure , And start the httpd
- 6. front end zabbix-web Installation
- At the end
Preface
Hello everyone ,docker After the end of the article, I thought hard for a long time and didn't know what to do , After reading it, I don't think there are many articles on monitoring , So I came to write zabbix The article , Prometheus' words will go to the back ,zabbix It is also a very interesting thing , If you haven't learned it, you can learn it together , This thing is relatively simple , visualization , What you have learned can be used as a review , No more nonsense , Let's get down to business .
What is monitoring
Monitoring means monitoring , Control means , With monitoring, we can make reminders before some tragedies happen and solve them in time , Prevent tragedies from happening . For example, the computer room is overheated , Monitoring reminder , Turn on the air conditioner , Prevent tragedy from happening .
With the increase of users , The service may be blocked by the system at any time oom out of memory out of memory
, How do you judge ,web The service is due to excessive user access , Reached the bottleneck ? Or program code bug As a result of , Too much memory ? To prevent this , We usually have two guarantees , One is to conduct a stress test before the website goes online , Second, monitoring , For example, this website can bear up to 3000 User access , We should set up a 70%-80% Monitoring of , When user access exceeds the capacity of the server 70% even to the extent that 80% When , We need to expand the capacity ! If not, then , Wait until it's almost full before expanding ? It's too late !
Zabbix Deploy
zabbix It's very interesting , Two versions , One LTS The version will support five years , A standard version only supports seven months , So the official website is usually updated every six months . Here we use zabbix4.0 Version of the .
1. Download source , To configure yum
zabbix Official website The visit was slow
because zabbix It's slow to download on the official website , And access is slow , The source of Tsinghua is used here .wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
I found the address, too , You can see url Find the copy link by yourself wget It's fine too , You can use mine .
And then we decompress
rpm -ivh zabbix-release-4.0-2.el7.noarch.rpm
Configure after decompression yum Warehouse
vim /etc/yum.repos.d/zabbix.repo
We need to take baseurl= The front of this line is changed to Tsinghua ! After comparison, it can be found that Tsinghua has only changed in the front
https://mirrors.tuna.tsinghua.edu.cn/zabbix
So we just need to replace here
%s#http://repo.zabbix.com#https://mirrors.tuna.tsinghua.edu.cn/zabbix#g
Then take it. gpgcheck Such as 0, In the end the following
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/debuginfo
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=0
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
2. install zabbix The service side and zabbix-web front end
Here we need to change the image source to Ali , Otherwise, an error will be reported without dependency
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
# Installation services and web
yum install zabbix-server-mysql zabbix-web-mysql -y
3. install mariadb, establish zabbix library , to grant authorization zabbix user
Here are instructions , We'll just keep going .
yum install mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
Enter this command and press enter , then n, Then all the way y That's it , This is used to delete anonymous users
mysql
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to [email protected] identified by '123456';
# Modify character set Build table Authorization, etc
sign out mariadb Import zabbix Table structure and initial data
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p123456 zabbix
Check zabbix Whether the library is imported successfully
mysql -uroot zabbix -e 'show tables'
If the table appears, it is successful
4. Configuration to start zabbix-server
Let's modify the configuration file here
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123456
Just make these four the same as mine , Sure :/ lookup .
start-up zabbix-server
systemctl start zabbix-server
systemctl enable zabbix-server
Check the service
netstat -lntup
If you can see zabbxi.server That's success , If there is no and no error is reported , That means your service is started but the listening port is not , Connect the firewall and selinux Try shutting down and restarting .
setenforce 0
getenforce
systemctl stop firewalld.service
If not , It's just zabbix Found in the installation directory of etc/zabbix_server.conf file , take ListenIP=0.0.0.0 Remove the previous comment
5. modify Zabbix Front-end PHP To configure , And start the httpd
vim /etc/httpd/conf.d/zabbix.conf
find php_value date.timezone This business , Change the time zone to
php_value date.timezone Asia/Shanghai
Start up after saving and start up automatically
systemctl start httpd
systemctl enable httpd
6. front end zabbix-web Installation
Then we visit http://ip/zabbix That's all right. ! Follow the prompts on the web page to register .
The login account and password are as follows
Admin
zabbix
Later revision zabbix Database password , Configuration files that need to be modified :
/etc/zabbix/web/zabbix.conf.php
You can see that the interface is like this !
At the end
If my article helps you , I hope you can give me a concern , give the thumbs-up , Let's support it , This will be my motivation to update , At present, we are updating to learn from scratch zabbix, Prepare to update and learn from scratch kubernetes, Thank you for your support !
边栏推荐
猜你喜欢
Google waymo proposed r4d: remote distance estimation using reference target
HarmonyOS.2
Kunpeng arm server compilation and installation paddlepaddle
远程办公之:在家露营办公小工具| 社区征文
Gatling 性能测试
OpenHarmony 1
食品饮料行业渠道商管理系统解决方案:实现渠道数字化营销布局
SaaS management system solution of smart Park: enabling the park to realize information and digital management
二造考生必看|巩固优选题库助力考生最后冲刺
如何解决 Iterative 半监督训练 在 ASR 训练中难以落地的问题丨RTC Dev Meetup
随机推荐
Daily question 8-515 Find the maximum value in each tree row
conda和pip命令
In the era of knowledge economy, it will teach you to do well in knowledge management
根据前序&中序遍历生成二叉树[左子树|根|右子树的划分/生成/拼接问题]
Kunpeng arm server compilation and installation paddlepaddle
HarmonyOS.2
P2pdb white paper
食品饮料行业渠道商管理系统解决方案:实现渠道数字化营销布局
Go语言三个高效编程的技巧
npm包【详解】(内含npm包的开发、发布、安装、更新、搜索、卸载、查看、版本号更新规则、package.json详解等)
Return to new list
【LeetCode】10、正则表达式匹配
JS remove string spaces
2022年施工升降机司机(建筑特殊工种)考试试题及在线模拟考试
markdown/LaTeX中在字母下方输入圆点的方法
Halcon 绘制区域 到图片中
Operation of simulated test question bank and simulated test platform for safety production management personnel of fireworks and firecrackers production units in 2022
Can a team do both projects and products?
Activity lifecycle
Rongyun communication has "hacked" into the heart of the bank