Zabbix5之一:Zabbix5的安裝部署


  參考官網:https://www.zabbix.com/

  一,選擇安裝平台及安裝的版本

  在官網選擇download根據需要選擇版本

 

   二,安裝和配置zabbix服務

  a,安裝zabbix源

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

  b,安裝zabbix服務端和客戶端

# yum install -y zabbix-server-mysql zabbix-agent

  c,安裝zabbix前端

yum install -y centos-release-scl

  編輯配置文件修改

/etc/yum.repos.d/zabbix.repo 

  設置enable=1其他配置保持不變

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

  安裝zabbix前端包

yum install -y zabbix-web-mysql-scl zabbix-nginx-conf-scl

  安裝mariadb

yum install -y mariadb-server

  啟動mariadb

# systemctl start mariadb
# systemctl enable mariadb

  運行mariadb安全配置

# mysql_secure_installation 

 

   d,創建數據庫

[root@localhost ~]# mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create user zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>  grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.01 sec)

  導入MySQL表

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

  e,為zabbix server配置數據庫

/etc/zabbix/zabbix_server.conf 

  

DBPassword=zabbix

  f,為zabbix前端配置PHP

/etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf 

 

   編輯文檔

/etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

  修改以下兩項

listen.acl_users = apache, nginx

  

php_value[date.timezone] = Asia/Shanghai

  g,啟動zabbix服務

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

  h,使用瀏覽器頁面訪問進行配置

  本次主機的IP為192.168.1.101

http://192.168.1.101/setup.php

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  

  

  


免責聲明!

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



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