一、系統(tǒng)環(huán)境
cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
關(guān)閉防火墻及selinux
systemctl stop firewalld.servicesystemctl disable firewalld.servicesed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/configgrep SELINUX=disabled /etc/selinux/configsetenforce 0
二、數(shù)據(jù)庫安裝及配置
1、MariaDB概述
MariaDB數(shù)據(jù)庫管理系統(tǒng)是MySQL的一個分支,主要由開源社區(qū)在維護(hù),采用GPL授權(quán)許可。
開發(fā)這個分支的原因是:甲骨文公司收購了MySQL后,有將MySQL閉源的潛在風(fēng)險,因此社區(qū)采用分支的方式來避開這個風(fēng)險。
MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能輕松成為MySQL的代替品。
2、安裝mariadb
yum install mariadb-server mariadb -y
mariadb數(shù)據(jù)庫的相關(guān)命令是:
systemctl start mariadb #啟動MariaDBsystemctl stop mariadb #停止MariaDBsystemctl restart mariadb #重啟MariaDBsystemctl enable mariadb #設(shè)置開機(jī)啟動
三、Zabbix3.4安裝及配置
1、Zabbix3.4新功能概述
zabbixe中文文檔 https://www.zabbix.com/documentation/3.4/zh/manual
2、Zabbix3.4安裝
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpmyum install zabbix-server-mysql zabbix-web-mysql -y
3、創(chuàng)建數(shù)據(jù)庫
create database zabbix character set utf8 collate utf8_bin;grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
4、導(dǎo)入數(shù)據(jù)
5、配置數(shù)據(jù)庫用戶及密碼
grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf38:LogFile=/var/log/zabbix/zabbix_server.log49:LogFileSize=072:PidFile=/var/run/zabbix/zabbix_server.pid99:DBName=zabbix115:DBUser=zabbix123:DBPassword=zabbix314:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log432:Timeout=4474:AlertScriptsPath=/usr/lib/zabbix/alertscripts484:ExternalScripts=/usr/lib/zabbix/externalscripts520:LogSlowQueries=3000
6、啟動zabbix server并設(shè)置開機(jī)啟動
systemctl enable zabbix-serversystemctl start zabbix-server
7、編輯Zabbix前端PHP配置,更改時區(qū)
vim /etc/httpd/conf.d/zabbix.confphp_value date.timezone Asia/Shanghai
8、SELinux配置
setsebool -P httpd_can_connect_zabbix onsetsebool -P httpd_can_network_connect_db on
9、啟動httpd并設(shè)置開機(jī)啟動
systemctl start httpdsystemctl enable httpd
四、安裝Zabbix Web
1、瀏覽器訪問,并進(jìn)行安裝http://172.16.8.254/zabbix/
2、點擊next會出現(xiàn)檢查狀態(tài)
3、檢查系統(tǒng)環(huán)境設(shè)置,必須全部都為ok,才能繼續(xù)
4、輸入連接到數(shù)據(jù)庫詳細(xì)信息。Zabbix數(shù)據(jù)庫必須已經(jīng)創(chuàng)建好
5、連接Zabbix服務(wù)細(xì)節(jié),如果沒有改變可選擇默認(rèn)
7、完成安裝,會將在/etc/zabbix/web/zabbix.conf.php生成配置文件
Congratulations! You have successfully installed Zabbix frontend.Configuration file "/etc/zabbix/web/zabbix.conf.php" created.
8、登錄最新版Zabbix3.4 默認(rèn)用戶Admin 默認(rèn)密碼zabbix
五、zabbxi-agent安裝及配置
1、安裝zabbxi-agent
yum install zabbix-agent -y
2、配置zabbxi-agent
grep -n '^'[a-Z] /etc/zabbix/zabbix_agentd.conf 13:PidFile=/var/run/zabbix/zabbix_agentd.pid32:LogFile=/var/log/zabbix/zabbix_agentd.log43:LogFileSize=097:Server=172.16.8.254138:ServerActive=172.16.8.254149:Hostname=Zabbix server267:Include=/etc/zabbix/zabbix_agentd.d/*.conf
3、啟動zabbxi-agent并設(shè)置開機(jī)啟動
systemctl enable zabbix-agent.servicesystemctl restart zabbix-agent.service
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持VEVB武林網(wǎng)。
新聞熱點
疑難解答
圖片精選