zoukankan      html  css  js  c++  java
  • YUM快速部署Zabbix 5.0 LTS-CentOS 7.6

    CentOS 7.6 [最小化安装] 部署Zabbix 5.0 LTS

    zabbix 5.0 版本于 5 月 11 日正式发布,是最新的 LTS(长期支持)版本,5.0 带来很多功能和特性.
    详见官网文档:

    https://www.zabbix.com/documentation/current/manual/installation/requirements


    1.关闭防火墙和 selinux 并重启


    [root@zabbix ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    [root@zabbix ~]# systemctl disable --now firewalld
    [root@zabbix ~]# reboot

    2.安装 zabbix rpm 源

    [root@zabbix ~]# rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
    [root@zabbix ~]# sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo #鉴于国内网络情况,使用阿里云 zabbix 源
    [root@zabbix ~]# yum clean all

    3.安装 zabbix server 和 agent


    [root@zabbix ~]# yum install zabbix-server-mysql zabbix-agent -y

    [root@zabbix ~]#yum install centos-release-scl -y


    启用 zabbix 前端源,将[zabbix-frontend]下的 enabled 改为 1

    修改/etc/yum.repos.d/zabbix.repo
    [root@zabbix ~]# vim /etc/yum.repos.d/zabbix.repo

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

    安装 zabbix 前端和相关环境


    [root@zabbix ~]# yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y

    4.使用 yum 安装 centos7 默认的 mariadb 数据库

    [root@zabbix ~]# yum install mariadb-server -y    #由于使用 yum 安装 zabbix,不自动依赖安装数据库,因此需要手动安装数据库
    [root@zabbix ~]# systemctl enable --now mariadb    #启动数据库,并配置开机自动启动
    [root@zabbix ~]# mysql_secure_installation    #初始化 mariadb 并配置 root 密码

    [root@zabbix ~]# mysql -uroot -p    #使用 root 用户进入 mysql,并建立 zabbix 数据库,注意数据库编码
    Enter password:
    MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
    MariaDB [(none)]> create user zabbix@localhost identified by 'zabbix@123';
    MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;
    #MariaDB [(none)]> flush privileges;
    MariaDB [(none)]> quit

    导入 zabbix 数据库,zabbix 数据库用户为 zabbix,密码为 password
    [root@zabbix ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
    Enter password:

    修改配置文件zabbix_server.conf里的数据库密码,
    /etc/zabbix/zabbix_server.conf

    [root@zabbix ~]# vim /etc/zabbix/zabbix_server.conf
    DBPassword=zabbix@123

    5.修改 zabbix 的 php 配置文件里的时区
    /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

    [root@zabbix ~]# vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
    php_value[date.timezone] = Asia/Shanghai

    启动相关服务,并配置开机自动启动
    [root@zabbix ~]# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
    [root@zabbix ~]# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm


    6浏览器测试访问zabbix 的 web 页面,格式http://ip/zabbix

     

     

     

     

  • 相关阅读:
    【Codeforces 349B】Color the Fence
    【Codeforces 459D】Pashmak and Parmida's problem
    【Codeforces 467C】George and Job
    【Codeforces 161D】Distance in Tree
    【Codeforces 522A】Reposts
    【Codeforces 225C】Barcode
    【Codeforces 446A】DZY Loves Sequences
    【Codeforces 429B】Working out
    【Codeforces 478C】Table Decorations
    【Codeforces 478C】Table Decorations
  • 原文地址:https://www.cnblogs.com/lookup100/p/12969111.html
Copyright © 2011-2022 走看看