Centos 8安装 Zabbix 5.0

  

1:官网环境平台。

 

 

 开始安装:

1:安装数据库

# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
# dnf clean all

2:安装Zabbix server , Web前端,服务器也需要被监控,因此Agent也安装

# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-agent

3:安装MySQL,并更改

# yum -y install mariadb-server

 3.1 更改配置文件

  character-set-server=utf8    #设置字符串集为UTF-8

  innodb_file_per_table=1      #让innodb 的每个表文件单独存储

 3.2 设置M有SQL启动与开机启动

  # systemctl start mariadb

  # systemctl enable mariadb

 3.3 查看是否启动成功

  # netstat -nlput|prep 3306

  # ps -ef | grep mysql

4:创建初始数据库

 4.1 # mysqladmin -uroot password ******              # 设置root用户密码为******

 4.2 # mysql -uroot -p   # 登陆MySQL,输入你的密码

 4.3 > 

    mysql> create database zabbix character set utf8 collate utf8_bin;
    mysql> create user zabbix@localhost identified by 'password';
    mysql> grant all privileges on zabbix.* to zabbix@localhost;
    mysql> quit;

5:导入初始架构和数据,系统将提示您输入新创建的密码。

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

  # 这里你输入的密码为MySQL的时候设置的 密码 create user zabbix@localhost identified by 'password';

6:编辑配置文件 /etc/zabbix/zabbix_server.conf

# vim  /etc/zabbix/zabbix_server.conf

DBPassword=password   # 上面设置密码

7:编辑配置文件 /etc/nginx/conf.d/zabbix.conf, uncomment and set 'listen' and 'server_name' directives.

 listen 80;
 server_name example.com;

 编辑配置文件 /etc/php-fpm.d/zabbix.conf, uncomment and set the right timezone for you.

 php_value[date.timezone] = Asia/Shanghai

8:启动Zabbix server 与 agent进程

 如果提示报错,看是否权限不足。

   9月 08 23:17:25 localhost.localdomain zabbix_server[40811]: zabbix_server [40811]: Cannot initialize IPC services: Cannot access path "/var/run/zabbix": [13] Permission      denied. 

  # systemctl restart zabbix-server zabbix-agent nginx php-fpm
 # systemctl enable zabbix-server zabbix-agent nginx php-fpm

9:打开80防火墙

防火墙打开80端口

#firewall-cmd --permanent --zone=public --add-port=80/tcp
# firewall-cmd --reload

 

posted @ 2020-09-09 14:09  Feng_fu  阅读(238)  评论(0)    收藏  举报