当前位置: 首页 > 科技观察

CentOS7源码编译安装Zabbix 6.0alpha1,一样也能正常使用

时间:2023-03-21 11:13:14 科技观察

从CentOS7源码编译安装Zabbix6.0alpha1,也可以正常使用是正式发布的测试版,功能方面就不多说了。在前段时间的深圳发布会上,CEOAlexeiVladishev也提到了一些关于6.0的消息。正式版应该会在12月上线,但测试版肯定会更早发布。一到两个月后,我会在正式发布后向大家介绍详细的改进。今天的文章主要是用6.0来实现CentOS7还是可以安装使用的。来自官方产品路线图文环境系统版本:CentOS7.9Zabbix版本:6.0alpha1预装工具(如有请忽略)yum-yinstallvimwget下载pre-6.0.0alpha1包并解压cd/tmpwgethttps://www.zabbix。com/downloads/nightly/pre-zabbix-6.0.0alpha1-f8219dcac2.tar.gztar-zxvfpre-zabbix-6.0.0alpha1-f8219dcac2.tar.gz编译安装zabbix6.0alpha1进入Zabbix目录cd/tmp/zabbix-6.0。0alpha1创建zabbix用户和zabbix用户组groupadd--systemzabbixuseradd--system-gzabbix-d/usr/lib/zabbix-s/sbin/nologin-c"ZabbixMonitoringSystem"zabbix编译zabbix,启用snmp,server,agent功能mkdir/opt/zabbix./configure--prefix=/opt/zabbix/--enable-server--enable-agent--with-net-snmp--with-mysql下图问题是gcc环境没有安装。解决方法是:yum-Yinstallgcc-c++出现如下问题,即没有安装mysql库,内置库的mysql版本为5.6。这里需要安装mysql8.0yuminstallhttps://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm-y安装mysql开发库yum-yinstallmysql-devel出现如下问题。未安装net-snmp库,yum-yinstallnet-snmp-devel出现如下问题。如图,编译完成。然后makeinstall完成makeinstall安装LAMP环境部署环境要求数据库要求http和php要求由于CentOS7自带PHP5.6版本,所以需要安装额外的库,也就是remi库。yuminstallhttps://rpms.remirepo.net/enterprise/remi-release-7.rpm-yyuminstallyum-utils-yyum-config-manager--disable'remi-php*'yum-config-manager--enableremi-php74安装phpyum-yinstallphp将前端文件移动到web服务根目录并授权cp/tmp/zabbix-6.0.0alpha1/ui/*/var/www/html/-Rchownapache:apache/var/www/html-R启动服务访问前端systemctlstarthttpd&&systemctlenablehttpd正常访问解决前端php报错问题(如下图)yum-yinstallphp-bcmathphp-gdphp-xmlphp-mbstringphp-mysqlndphp-ldapvim/etc/php.ini修改post_max_size为16M修改max_execution_time为300修改max_input_time为300并重启webservice服务httpd重启正常数据库部分installdatabaseyum-config-manager--enablemysql80-communityyuminstallmysql-community-server-ystartdatabasesystemctlstartmysqld&&systemctlenablemysqld查看mysql初始化密码grep'temporarypassword'/var/log/mysqld.log初始化zationdatabase这里需要注意密码要求,3要素mysql_secure_installation修改密码createdatabasecreatedatabasezabbixcharactersetutf8collat??eutf8_bin;createuserzabbix@localhostidentifiedby'Huawei@123';grantallprivilegesonzabbix.*tozabbix@localhost;quit;importdatabaseschemaanddatamysql-uzabbix-pHuawei@123zabbix