1. 程式人生 > 其它 >zabbix5系統部署

zabbix5系統部署

技術標籤:zabbixzabbix5centoslinux資料庫運維

zabbix5系統部署

系統環境:centos1804

zabbix:5.0.4

1.安裝centos 資料庫

# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
# yum clean all

2.安裝zabbix 服務端和客戶端

# yum install zabbix-server-mysql zabbix-agent

3.安裝zabbix字型

# yum install centos-release-scl

編輯配置檔案 /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.

[zabbix-frontend]
...
enabled=1
...

4.安裝zabbix字型包

# yum install zabbix-web-mysql-scl zabbix-apache-conf-scl

5.安裝資料庫

cd /usr/local/src/
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm 
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
yum -y install mysql-server

啟動Mysql

systemctl start mysqld

獲取安裝時的臨時密碼

grep 'temporary password' /var/log/mysqld.log

使用臨時密碼登入

mysql -uroot -p',臨時密碼

mysql> set password for [email protected] = password('password'); //修改密碼

建立初始資料庫

mysql> create database zabbix character set utf8 collate utf8_bin;

mysql> grant all privileges on zabbix.* to 
[email protected]
identified by 'password'; mysql> quit;

匯入初始架構和資料,系統將提示您輸入新建立的密碼。

# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

6.為Zabbix server配置資料庫

編輯配置檔案 /etc/zabbix/zabbix_server.conf

DBPassword=password

7.為Zabbix前端配置PHP

編輯配置檔案 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf, uncomment and set the right timezone for you.

; php_value[date.timezone] = Europe/Riga    //修改為Asia/chongqing

8.啟動Zabbix server和agent程序

啟動Zabbix server和agent程序,併為它們設定開機自啟:

# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm

9.按照提示一步一步安裝zabbix.

安裝完成後,出現先幾個問題,解決方法如下:

1.電腦上不能開啟伺服器的頁面的問題

這種情況是防火牆沒有關閉的原因。

使用命令:

systemctl stop firewalld.service  

關閉執行的防火牆

2.圖形字型不顯示,或者顯示亂碼的問題

在zabbix-server伺服器上安裝如下檔案符集

yum install wqy-microhei-fonts

然後替換linux上預設的字符集

cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

重啟zabbix-server,檢視亂碼是否解決

到此,zabbix5 安裝完成