• centos7 搭建安装zabbix3.0服务端实例(一)


    一、搭建基础环境 lamp

    #yum -y install wget net-snmp-devel OpenIPMI-devel httpd openssl-devel java lrzsz fping-devel libcurl-devel perl-DBI pcre-devel libxml2 libxml2-devel mysql-devel gcc php php-bcmath php-gd php-xml php-mbstring php-ldap php-mysql.x86_64 php-pear php-xmlrpc  net-tools wget vim-enhanced      #首先安装依赖包

    #systemctl stop firewalld.service       #关闭防火墙

    #wget -P /etc/yum.repos.d http://mirrors.aliyun.com/repo/Centos-7.repo   #下载YUM源

    # rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm     #安装zabbix的YUM源

    Server端
    # yum install zabbix-server-mysql zabbix-web-mysql
    Agent端

    # yum install zabbix-agent

    二、安装mysql

    rpm -ivh http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm     #安装mysql centos 7的yum源

    yum -y install mysql-server                  #安装mysql

    安装完成后默认没有密码
    登陆mysql时提示ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2),原因是/var/lib/mysql的访问权限问题。下面的命令把/var/lib/mysql的拥有者改为当前用户:
    #chown -R root:root /var/lib/mysql
     
    重启
    #systemctl restart mysqld
     
    三、创建zabbix数据库和用户,给予权限
    # mysql -uroot  -p
    # mysql> create database zabbix character set utf8 collate utf8_bin;
    #mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

    qxit   #退出后

    cd /usr/share/doc/zabbix-server-mysql-3.0.0        #进入安装的zabbix-server 目录

    zcat create.sql.gz | mysql -uzabbix -pzabbix zabbix     #同步数据,这里输入后会出现Warning: Using a password on the command line interface can be insecure.  #提示这里输入数据库密码不安全

     

    四、修改配置文件

    vim /etc/zabbix/zabbix_server.conf         #修改zabbix配置文件

    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=zabbix
    ####
    systemctl start zabbix-server       #开启zabbix-server
    systemctl enable zabbix-server  #设置开机自启动
     
    配置时区
    vim /etc/httpd/conf.d/zabbix.conf  #修改httpd中zabbix文件,设置时区
    php_value date.timezone Asia/Shanghai#####

    systemctl restart httpd.service

    systemctl enable httpd  # 设置开机自启动

     

    如果开启zabbix-server时出现Job for zabbix-server.service failed. See 'systemctl status zabbix-server.service' and 'journalctl -xn' for details

    #解决方法 yum update trousers

     

     

     客户端安装 

    1、首先关闭防火墙

    systemctl stop firewalld.service

    setenforce      0

     

    2、下载zabbix yum源

    # rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm     #安装zabbix的YUM源

     

    3、安装zabbix客户端

    yum-y install zabbix-agent

     

    4、修改配置文件

    vim /etc/zabbix/zabbix_agentd.conf

    修改内容如下

    Server=192.168.80.10       #服务端地址

    ServerActive=192.168.80.10 #服务端地址

    Hostname=zabbix2    #可自定义

     

    5、开启zabbix-agent服务

    systemctl start zabbix-agent

    systemclt enable zabbix-agent

     

    如果出现Job for zabbix-server.service failed. See 'systemctl status zabbix-server.service' and 'journalctl -xn' for details

    yum update trousers

    yum -y install gnutls

     

     

    完成

     

     

     

     

     

     

  • 相关阅读:
    Leetcode 121. Best Time to Buy and Sell Stock
    Leetcode 120. Triangle
    Leetcode 26. Remove Duplicates from Sorted Array
    Leetcode 767. Reorganize String
    Leetcode 6. ZigZag Conversion
    KMP HDU 1686 Oulipo
    多重背包 HDU 2844 Coins
    Line belt 三分嵌套
    三分板子 zoj 3203
    二分板子 poj 3122 pie
  • 原文地址:https://www.cnblogs.com/lh777/p/8016780.html
Copyright © 2020-2023  润新知