llinux运维基础:zabbix部署

一. zabbix安装

安装5.0版本
1.配置仓库
# rpm-Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
# yum clean all

2.安装zabbix-server zabbix-agent
yum -y install zabbix-server-mysql zabbix-agent

3.安装scl源 解决版本冲突问题
[root@zabbix ~]# yum -y install centos-release-scl

4.开启前端仓库
[root@zabbix ~]# vim /etc/yum.repos.d/zabbix.repo
[zabbix-frontend]
...
enabled=1
...

5.安装 php apache 前端
[root@zabbix ~]# yum -y install zabbix-web-mysql-scl zabbix-apache-conf-scl

6.安装mysql数据库
[root@zabbix ~]# yum -y install mariadb-server

启动数据库
[root@zabbix ~]# systemctl start mariadb
[root@zabbix ~]# systemctl enable mariadb

7.创建zabbix库

[root@zabbix ~]# mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
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.00 sec)

MariaDB [(none)]> set global log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit
Bye

8.初始化数据(业务运行前需要依赖数据库中的一些数据表格 需要提前导入)
[root@zabbix ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix # 需要输入zabbix密码

[root@zabbix ~]# mysql -uroot
MariaDB [(none)]> set global log_bin_trust_function_creators = 0;
quit

9.修改zabbix连接数据的信息
[root@zabbix ~]# egrep ^DB /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix   # 将注释打开配置密码

10.修改时区
[root@zabbix ~]# tail -1 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/ShangHai


11.启动服务 server agent httpd php 加入开机自启
[root@zabbix ~]# systemctl start zabbix-server zabbix-agent httpd rh-php72-php-fpm
[root@zabbix ~]# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm


12.通过浏览器访问安装页面
http://10.0.0.71/zabbix/

用户名:Admin

密码:zabbix

13.修改语言

你可能感兴趣的:(运维,zabbix,linux)