当前位置:网站首页>ZABBIX installation pit avoidance Guide
ZABBIX installation pit avoidance Guide
2022-06-25 03:52:00 【51CTO】
(1)zabbix Installation of the server of :
①zabbix Deployment process planning :
1、centos7 I won't support it yum Install server , The client can yum install
2、 Deploy ngx+php Environment and test
3、 Deploy database mariadb 10.5 And on
4、 Compilation and installation zabbix-server Server and backend configuration
5、 Deploy front-end code for access
6、web visit
② Deploy nginx+php:
1、yum -y isntall nginx
[[email protected] conf.d]# cat zabbix.conf
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/she-access.log main;
error_log /var/log/nginx/she-error.log notice;
root /app/code/zbx;
# static state
location / {
index index.php;
}
# dynamic
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index_php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
[[email protected] conf.d]#
2、[[email protected] zabbix-6.0.5]# yum install -y php72w-cli php72w-fpm php72w-gd php72w-mbstring php72w-bcmath php72w-xml php72w-ldap php72w-mysqlnd -y
3、 modify php Configuration of :
[[email protected] conf.d]# grep 'nginx' /etc/php-fpm.d/www.conf
user = nginx
group = nginx
[[email protected] conf.d]#
4、 start-up :
[[email protected] tmp]# systemctl enable php-fpm.service
[[email protected] tmp]# systemctl enable nginx
[[email protected] tmp]# systemctl start php-fpm.service
[[email protected] tmp]# systemctl start nginx
5、 test php:
[[email protected] code]# cat zbx/info.php
<?php
phpinfo();
?>
[[email protected] code]#
6、 See if the page appears , see php Whether to cooperate nginx:
http://120.48.55.178/info.php
③ Deploy database :
1、zabbix 6.0 I won't support it mariadb5.5 To install mariddb10.0 above
2、 To configure mariadb yum Source :
[[email protected] ~]# cat /etc/yum.repos.d/mariddb.repo
# MariaDB 10.5 CentOS repository list - created 2022-06-24 08:48 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://tw1.mirror.blendbyte.net/mariadb/yum/10.5/centos7-amd64
gpgkey=https://tw1.mirror.blendbyte.net/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=0
[[email protected] ~]# yum install -y MariaDB-server MariaDB-client
3、 Check for installation :
[[email protected] code]# rpm -qa |grep -i mariadb
MariaDB-common-10.5.16-1.el7.centos.x86_64
MariaDB-server-10.5.16-1.el7.centos.x86_64
MariaDB-compat-10.5.16-1.el7.centos.x86_64
MariaDB-client-10.5.16-1.el7.centos.x86_64
[[email protected] code]#
4、 start-up :
[[email protected] code]# systemctl enable mariadb
[[email protected] code]# systemctl start mariadb
5、 Database initialization :{ Only once }
[[email protected] code]# mysql_secure_installation
You already have your root account protected, so you can safely answer 'n'. < The new database has no password n>
Switch to unix_socket authentication [Y/n] n < transport n>
... skipping.
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] y < Modify a database root Password >
Remove anonymous users? [Y/n] y <y>
... Success!
Disallow root login remotely? [Y/n] y <y>
... Success!
e moving into a production environment.
Remove test database and access to it? [Y/n] y <y>
Reload privilege tables now? [Y/n] y <y>
... Success!
[[email protected] code]#
6、 Create a library :
[[email protected] code]# mysql -uroot -p
MariaDB [(none)]> create database zabbix charset utf8 collate utf8_bin;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> grant all on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]>
7、 Import data into the database :{ Pay attention to the import order - Don't make a mistake }
1. Download source package :https://cdn.zabbix.com/zabbix/sources/stable/6.0/zabbix-6.0.5.tar.gz
2. Import :
[[email protected] database]# cd /tmp/zabbix-6.0.5/database/mysql/
[[email protected] mysql]# ls -lh
total 33M
-rw-r--r-- 110001000 31M May 3014:23 data.sql
-rw-r--r-- 110001000282 May 3014:22 double.sql
-rw-r--r-- 1100010001.5K May 3014:22 history_pk_prepare.sql
-rw-r--r-- 1100010001.9M May 216:26 images.sql
-rw-r--r-- 110001000508 May 3014:22 Makefile.am
-rw-r--r-- 110001000 16K May 3014:22 Makefile.in
-rw-r--r-- 110001000 161K May 3014:23 schema.sql
[[email protected] mysql]#
[[email protected] mysql]# pwd
/tmp/zabbix-6.0.5/database/mysql
[[email protected] mysql]# mysql -uroot -p'mima' zabbix < schema.sql
[[email protected] mysql]# mysql -uroot -p'mima' zabbix < images.sql
[[email protected] mysql]# mysql -uroot -p'mima' zabbix < data.sql
[[email protected] mysql]# mysql -uroot -p'mima' zabbix < double.sql
[[email protected] mysql]# mysql -uroot -p'mima' zabbix < history_pk_prepare.sql
④ Compilation and installation zabbix:
1、 Installation dependency :
[[email protected] zabbix-6.0.5]# yum install -y mysql-devel pcre-devel openssl-devel zlib-devel libxml2-devel net-snmp-devel net-snmp libssh2-devel OpenIPMI-devel libevent-devel openldap-devel libcurl-devel
2、 To configure :
[[email protected] zabbix-6.0.5]# ./configure --sysconfdir=/etc/zabbix/ --enable-server --with-mysql --with-net-snmp --with-libxml2 --with-ssh2 --with-openipmi --with-zlib --with-libpthread --with-libevent --with-openssl --with-ldap --with-libcurl --with-libpcre
Prompt for successful compilation :
Configuration file: /etc/zabbix/zabbix_server.conf
External scripts: /usr/local/share/zabbix/externalscripts
Alert scripts: /usr/local/share/zabbix/alertscripts
Modules: /usr/local/lib/modules
3、 compile :
[[email protected] zabbix-6.0.5]# make install
4、 Check :
[email protected] zabbix-6.0.5]# zabbix_server --version
zabbix_server (Zabbix) 6.0.5
Revision 8da3e1f8419 30 May 2022, compilation time: Jun 24202220:31:28
Copyright (C) 2022 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).
Compiled with OpenSSL 1.0.2k-fips 26 Jan 2017
Running with OpenSSL 1.0.2k-fips 26 Jan 2017
[[email protected] zabbix-6.0.5]#
⑤ modify zabbix Configuration file for :
1、 Modify the configuration file :
[[email protected] ~]# grep -n '^[a-Z]' /etc/zabbix/zabbix_server.conf
12:ListenPort=10051
38:LogFile=/tmp/zabbix_server.log
99:DBName=zabbix
115:DBUser=zabbix
123:DBPassword=zabbix
507:Timeout=4
593:LogSlowQueries=3000
708:StatsAllowedIP=127.0.0.1
[[email protected] ~]#
2、 add to zabbix Users of :
[[email protected] ~]# useradd -s /sbin/nolging -M zabbix
[[email protected] ~]#
3、 Check zabbix:
[[email protected] ~]# ps -ef|grep zabbix
[[email protected] ~]# netstat -tulnp|grep zabbix
tcp 000.0.0.0:100510.0.0.0:* LISTEN 30417/zabbix_server
[[email protected] ~]#
⑥ to zabbix increase systemcctl Management of :
1、 Management writing :
[[email protected] ~]# cat /usr/lib/systemd/system/zabbix-server.service
[Unit]
Description=Zabbix Server with MySQL DB
After=syslog.target network.target mysqld.service
[Service]
Type=simple
ExecStart=/usr/local/sbin/zabbix_server -f
User=zabbix
[Install]
WantedBy=multi-user.target
[[email protected] ~]# systemctl daemon-reload
[[email protected] ~]#
2、 Restart the process :
[[email protected] ~]# pkill zabbix
[[email protected] ~]# ps -ef|grep zabbix
root 3130229428022:59 pts/300:00:00grep --color=auto zabbix
[[email protected] ~]# systemctl enable zabbix-server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
[[email protected] ~]# systemctl start zabbix-server.service
[[email protected] ~]#
⑦zabbix Deployment of front-end code :
[[email protected] zabbix-6.0.5]# pwd
/root/zabbix-6.0.5
[[email protected] zabbix-6.0.5]# cp -a ui/* /app/code/zbx/
[[email protected] zabbix-6.0.5]# chown -R nginx.nginx /app/code/zbx/
[[email protected] zabbix-6.0.5]#
⑧ install zabbix:
1、 install :
http://120.48.55.178/setup.php
2、 Report errors :{ The fourth reason is that the dependency is not installed , The steps have already been completed }

3、 To modify php Configuration of :
[[email protected] /]# grep -E -n '^(max_.*_time|post_max)' /etc/php.ini
368:max_execution_time = 600
378:max_input_time = 600
656:post_max_size = 80M
[[email protected] /]#
[[email protected] /]# systemctl restart nginx
[[email protected] /]# systemctl restart php-fpm.service
[[email protected] /]#
4、 To configure php Connect to database :{zabbix Connecting to the database is defined in the configuration file }

5、 Give you the zabbix Give a name :

6、 Final confirmation :
⑨ Sign in :{ Account Admin password zabbix}
http://120.48.55.178/zabbix.php?action=dashboard.view
(2) install zabbix client :
① To install a agine The client of :
1、 First install a source :
[[email protected] zabbix-6.0.5]# rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/6.0/rhel/7/x86_64/zabbix-release-6.0-1.el7.noarch.rpm
2、 Check if there is any in this source zabbix-agent2:
[[email protected] zabbix-6.0.5]# yum list|grep zabbix-agent2
zabbix-agent2.x86_64 6.0.5-1.el7 zabbix
[[email protected] zabbix-6.0.5]#
3、 install :{ Online installation } too XX slow
[[email protected] zabbix-6.0.5]# yum -y install zabbix-agent2
Replace source :
[[email protected] ~]# sed -i 's#https://repo.zabbix.com/zabbix#https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix#g' /etc/yum.repos.d/zabbix.repo
4:{ Or install offline }
[[email protected] ~]# wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/6.0/rhel/7/x86_64/zabbix-agent2-6.0.5-1.el7.x86_64.rpm --no-check-certificate
[[email protected] ~]# rpm -ivh zabbix-agent2-6.0.5-1.el7.x86_64.rpm
7、 Modify the client :{ The address is changed to that of the server ip, Now we are together, so there is no need to change }
[[email protected] ~]# grep -E '^[Server]' /etc/zabbix/zabbix_agent2.conf
Server=127.0.0.1
ServerActive=127.0.0.1
[[email protected] ~]#
8、 start-up zabbix client :
[[email protected] ~]# systemctl start zabbix-agent2.service
[[email protected] ~]# systemctl enable zabbix-agent2.service
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent2.service to /usr/lib/systemd/system/zabbix-agent2.service.
[[email protected] ~]#
9、 Check :
[[email protected] ~]# ps -ef|grep agent2
zabbix 55561001:07 ? 00:00:00 /usr/sbin/zabbix_agent2 -c /etc/zabbix/zabbix_agent2.conf
root 557729428001:07 pts/300:00:00grep --color=auto agent2
[[email protected] ~]# netstat -tulpn|grep agent2
tcp6 00 :::10050 :::* LISTEN 5556/zabbix_agent2
10、 View results :

边栏推荐
- Tutorial on installing SSL certificates in Microsoft Exchange Server 2007
- 马斯克被诉传销索赔2580亿美元,台积电公布2nm制程,中科院发现月壤中含有羟基形式的水,今日更多大新闻在此...
- Lu Qi invests in quantum computing for the first time
- 跨境电商新手如何防止店铺关联?用什么工具好?
- 多睡觉,能减肥,芝加哥大学最新研究:每天多睡1小时,等于少吃一根炸鸡腿...
- TensorFlow,危!抛弃者正是谷歌自己
- Copilot免费时代结束!正式版67元/月,学生党和热门开源项目维护者可白嫖
- Tencent Open Source Project "Yinglong" est devenu un projet Apache de haut niveau: l'ancien Service à long terme Wechat payment, peut maintenir un million de milliards de niveaux de traitement de flux
- Demonstration of combination of dream CAD cloud map and GIS
- Rebeco:使用机器学习预测股票崩盘风险
猜你喜欢

The era of copilot free is over! The official version is 67 yuan / month, and the student party and the defenders of popular open source projects can prostitute for nothing

BGP biplane architecture

CVPR大会现场纪念孙剑博士,最佳学生论文授予同济阿里,李飞飞获黄煦涛纪念奖...

Google founder brin's second marriage broke up: it was revealed that he had filed for divorce from his Chinese wife in January, and his current fortune is $631.4 billion

(超详细onenet TCP协议接入)arduino+esp8266-01s接入物联网平台,上传实时采集数据/TCP透传(以及lua脚本如何获取和编写

JSP cannot be resolved to a type error reporting solution

2点睡10点起不算熬夜?除非你每天都能执行

TCC mode explanation and code implementation of Seata's four modes

MySQL根据表前缀批量修改、删除表

Now, the ear is going into the metauniverse
随机推荐
浏览器下载的文件属性里都有保护,如何去掉
完美洗牌问题
Rebeco:使用机器学习预测股票崩盘风险
程序员真人秀又来了!呼兰当主持挑灯狂补知识,SSS大佬本科竟是药学,清华朱军张敏等加入导师团...
Mobile mall project operation
Standing at the center of the storm: how to change the engine of Tencent
程序猿职业发展9项必备软技能
How can novices of cross-border e-commerce prevent store association? What tool is good?
AI越进化越跟人类大脑像!Meta找到了机器的“前额叶皮层”,AI学者和神经科学家都惊了...
居家办公之后才明白的时间管理 | 社区征文
Xidian AI ranked higher than Qingbei in terms of AI majors, and Nantah ranked the first in China in 2022 in terms of soft science majors
OpenSUSE environment variable settings
Why can banana be a random number generator? Because it is the "king of radiation" in the fruit industry
Two way combination of business and technology to build a bank data security management system
Apple's legendary design team disbanded after jobs refused to obey cook
js工具函数,自己封装一个节流函数
西电AI专业排名超清北,南大蝉联全国第一 | 2022软科中国大学专业排名
Comprehensive assignment of thesis writing instruction of Dongcai
OpenSUSE environment PHP connection Oracle
吴恩达机器学习新课程又来了!旁听免费,小白友好