网站建设的岗位是什么岗位,网页优化,wordpress 首页缓存,深圳市房屋管理局官网zabbix 5.0 版本于 5 月 11 日正式发布#xff0c;是最新的 LTS(长期支持)版本#xff0c;5.0 带来很多功能和特性#xff0c;后面会陆续推出文章介绍#xff0c;下面主要介绍下 5.0 版本的安装。环境要求5.0 版本对基础环境的要求有大的变化#xff0c;最大的就是对 php … zabbix 5.0 版本于 5 月 11 日正式发布是最新的 LTS(长期支持)版本5.0 带来很多功能和特性后面会陆续推出文章介绍下面主要介绍下 5.0 版本的安装。环境要求5.0 版本对基础环境的要求有大的变化最大的就是对 php 版本的要求最低要求 7.2.0 版本,对 php 扩展组件版本也有要求详见官网文档https://www.zabbix.com/documentation/current/manual/installation/requirementsYUM 安装基本环境操作系统安装方式CentOS Linux release 7.8.2003 (Core) x86_64最小化安装安装好操作系统后关闭防火墙和 selinux 并重启sed -i s/SELINUXenforcing/SELINUXdisabled/ /etc/selinux/configsystemctl disable --now firewalldreboot安装 zabbix rpm 源,鉴于国内网络情况使用阿里云 zabbix 源rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpmsed -i s#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix# /etc/yum.repos.d/zabbix.repoyum clean all安装 zabbix server 和 agentyum install zabbix-server-mysql zabbix-agent -y安装 Software Collections便于后续安装高版本的 php默认 yum 安装的 php 版本为 5.4 过低yum install centos-release-scl -y启用 zabbix 前端源修改/etc/yum.repos.d/zabbix.repo,将[zabbix-frontend]下的 enabled 改为 1enabled1安装 zabbix 前端和相关环境yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y由于使用 yum 安装 zabbix不自动依赖安装数据库因此需要手动安装数据库这里使用 yum 安装 centos7 默认的 mariadb 数据库yum install mariadb-server -y启动数据库并配置开机自动启动systemctl enable --now mariadb使用以下命令初始化 mariadb 并配置 root 密码mysql_secure_installation使用 root 用户进入 mysql并建立 zabbix 数据库注意数据库编码create database zabbix character set utf8 collate utf8_bin;create user zabbixlocalhost identified by password;grant all privileges on zabbix.* to zabbixlocalhost;quit;使用以下命令导入 zabbix 数据库zabbix 数据库用户为 zabbix密码为 passwordzcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix修改 zabbix server 配置文件/etc/zabbix/zabbix_server.conf 里的数据库密码DBPasswordpassword修改 zabbix 的 php 配置文件 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf 里的时区php_value[date.timezone] Asia/Shanghai启动相关服务并配置开机自动启动systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpmsystemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm使用浏览器访问http://ip/zabbix 即可访问 zabbix 的 web 页面编译安装基础环境配置鉴于 5.0 对 php 等组件版本的要求编译安装前建议参考版本使用对应的版本进行安装lnmp 环境采用 dnf 方式安装使用编译安装 zabbix基本环境操作系统安装方式CentOS Linux release 8.1.1911 (Core) x86_64最小化安装安装好操作系统后关闭防火墙和 selinux 并重启sed -i s/SELINUXenforcing/SELINUXdisabled/ /etc/selinux/configsystemctl disable --now firewalldreboot使用 dnf 安装 lnmp 等基础环境包dnf install httpd php php-gd php-ldap php-mysqlnd php-json php-bcmath php-mbstring php-xml mysql mysql-server mysql-devel libevent-devel pcre-devel gcc gcc-c make libcurl-devel curl-* net-snmp* libxml2-* wget tar -yuseradd zabbix启动相关组件并配置开机启动systemctl enable --now httpd mysqld php-fpm安装配置安装好启动 httpmysql 等服务并使用 mysql_secure_installation 命令初始化 mysql下载 zabbix5.0 源码解压并编译cd /optwget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.0.tar.gztar zxvf zabbix-5.0.0.tar.gzcd zabbix-5.0.0./configure --prefix/usr/local/zabbix --enable-server --enable-agent \--with-mysql --with-net-snmp --with-libcurl --with-libxml2makemake install使用 mysql 的 root 用户登录 mysql 数据库建立 zabbix 数据库用户等相关信息create database zabbix character set utf8 collate utf8_bin;create user zabbixlocalhost identified by password;grant all privileges on zabbix.* to zabbixlocalhost;quit按照顺序依次导入 sqlmysql -uzabbix -p zabbix /opt/zabbix-5.0.0/database/mysql/schema.sqlmysql -uzabbix -p zabbix /opt/zabbix-5.0.0/database/mysql/images.sqlmysql -uzabbix -p zabbix /opt/zabbix-5.0.0/database/mysql/data.sql修改 zabbix server 配置文件/usr/local/zabbix/etc/zabbix_server.conf修改数据库密码...DBPasswordpassword...为 zabibx server 添加 systemd 启动文件vi /lib/systemd/system/zabbix-server.service内容如下[Unit]DescriptionZabbix ServerAftersyslog.targetAfternetwork.targetAftermysql.serviceAftermysqld.serviceAftermariadb.serviceAfterpostgresql.service[Service]EnvironmentCONFFILE/usr/local/zabbix/etc/zabbix_server.confEnvironmentFile-/etc/sysconfig/zabbix-serverTypeforkingRestarton-failurePIDFile/tmp/zabbix_server.pidKillModecontrol-groupExecStart/usr/local/zabbix/sbin/zabbix_server -c $CONFFILEExecStop/bin/kill -SIGTERM $MAINPIDRestartSec10sTimeoutSec0[Install]WantedBymulti-user.target为 zabbix agent 添加 systemd 启动文件vi /lib/systemd/system/zabbix-agent.service内容如下[Unit]DescriptionZabbix AgentAftersyslog.targetAfternetwork.target[Service]EnvironmentCONFFILE/usr/local/zabbix/etc/zabbix_agentd.confEnvironmentFile-/etc/sysconfig/zabbix-agentTypeforkingRestarton-failurePIDFile/tmp/zabbix_agentd.pidKillModecontrol-groupExecStart/usr/local/zabbix/sbin/zabbix_agentd -c $CONFFILEExecStop/bin/kill -SIGTERM $MAINPIDRestartSec10sUserzabbixGroupzabbix[Install]WantedBymulti-user.target启动 zabbix server 和 zabbix agent,并配置开机启动systemctl enable --now zabbix-serversystemctl enable --now zabbix-agent前端安装拷贝 zabbix 前端文件到 apache 默认 web 目录cp -r /opt/zabbix-5.0.0/ui/* /var/www/html/chown -R apache:apache /var/www/html/配置 php 参数sed -i s#post_max_size 8M#post_max_size 16M# /etc/php.inised -i s#max_execution_time 30#max_execution_time 300# /etc/php.inised -i s#max_input_time 60#max_input_time 300# /etc/php.inised -i s#;date.timezone #date.timezone Asia/Shanghai# /etc/php.inisystemctl restart php-fpm配置后使用浏览器访问http://ip/ 就可以访问 zabbix 页面了WEB 初始化编译或者 yum 安装好之后使用浏览器访问 web检查各个组件配置是否正常输入配置数据库 zabbix 用户的密码下一步下一步下一步登录账号为 Admin密码zabbix首页完成页面初始化。下期预告 Zabbix Agent2 的安装与使用。如果觉得我的文章对您有用请关注我的公众号有更多技术干货【阅读原文】查看blog原文