zabbix 4.0 安裝


關閉防火牆

關閉selinux

登錄172.18.47.92上

1 配置yum源 zabbix.repo

[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=0

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0

 

 2 安裝zabbix 相關組件

yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent mariadb mariadb-server

啟動數據庫

systemctl enable mariadb.service

systemctl start mariadb.service

登錄mysql 

character set utf8 collate utf8_bin:數據庫字符集和一個數據庫校對規則

mysql> create database zabbix character set utf8 collate utf8_bin;  # 創建一個數據庫

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';  # 授權zabbix用戶擁有zabbix數據庫的所有權限

mysql>flush privileges;  # 刷新數據庫權限表    

mysql> quit;

 

 導入zabbix初始數據庫

zcat  /usr/share/doc/zabbix-server-mysql-4.0.18/create.sql.gz |mysql -uzabbix -pzabbix zabbix          <-庫名

編輯zabbix-server配置文件,配置數據庫信息

[root@node1 ~]# cat  /etc/zabbix/zabbix_server.conf |grep "^DB"
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

 啟動所有服務

[root@node1 ~]# systemctl enable httpd zabbix-server zabbix-agent

[root@node1 ~]# systemctl start httpd zabbix-server zabbix-agent

查看相關端口是否監聽:

#netstat -ntlp | grep 10051 (server監聽)

# netstat -ntlp | grep 10050 (client監聽)

瀏覽器訪問:

 

 

 出現時區的報錯,需修改php.ini 配置文件

 

 

 [root@node1 ~]# cat /etc/php.ini |grep -w 'date.timezone'
; http://php.net/date.timezone
date.timezone = Asia/Shanghai

重啟apache

systemctl restart httpd

刷新瀏覽器

 

 

 

 

 

 

 

 使用默認管理員登錄

賬號:Admin  大寫的

密碼:zabbix

 

修改語言

 

 中文亂碼解決:

將我們選擇的字體文件上傳到zabbix web服務,/usr/share/zabbix/assets/fonts目錄下(rpm安裝目錄)

rm -rf graphfont.ttf

mv simkai.ttf graphfont.ttf

權限是644

chmod 644 graphfont.ttf

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM