注:本实验环境在centos7mini下实验,具体相关软件版本最好一致,避免依赖关系缺失。

当然也可以新建用户zabbix(不使用root,避免安全隐患),在zabbix下执行操作,加sudo提升权限

1、准备工作

1.1配置 yum 源

cd /etc/yum.repos.d/

vim CentOS7-Base.repo //找寻7大版本就可以

1.2 配置zabbix源

vim zabbix.repo //实际操作中使用zabbix/3.2/rhel/7/x86_64

yum clean all   //清理yum缓存

yum makecache //更新yum缓存

1.3禁用防火墙

systemctl stop firewalld.service //停止防火墙

firewall-cmd --state //查看防火墙状态

systemctl disable firewalld.service //设置防火墙开机不启动

sestatus  //查看selinux状态

setenforce 0 //修改selinux的运行状态为permisivv

sed -i “s/^SELINUX=enforcing/SELINUX=disabled/”  /etc/selinux/config //修改开启启动状态不可用

2、 安装Mysql数据库(5.7.24)

2.1查看本机是否已经安装了mysql/mariadb

rpm -qa | grep -i mariadb      rpm -qa | grep -i mysql

若有则将其卸载rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64

根目录下查找未删除的mariadb文件夹 find / -name *mariadb*

执行删除指令   rm -rf 找到的文件或文件夹(如/usr/share/mysql/)

2.2安装

下载mysql安装包https://dev.mysql.com/downloads/mysql/5.7.html#downloads

根据自己的操作系统选择下载版本,此处下载mysql-5.7.24-1.el7.x86_64.rpm-bundle.tar(捆绑包)。下载好后传到待安装主机上(随便放在哪个文件夹,一般放在根目录)

解压 tar -xvf mysql-5.7.24-1.el7.x86_64.rpm-bundle.tar

安装

由于mysql的server端需要perl语言的支持,因此我们还需要在系统中安装perl支持:

yum install perl -y

yum install net-tools //mysql server安装需要次依赖关系

下载iksemel-1.4-6.sdl7.x86_64.rpm

安装 yum localinstall iksemel-1.4-6.sdl7.x86_64.rpm

Yum install net-tools (mysql-commit-serverxuyao)

后面安装的时候需要iksemel-1.4-6.sdl7.x86_64.rpm依赖(及时配置了epel源,也无法解决)

由于上面解压出来的几个rpm包有依赖关系,所以我们需要按照顺序执行安装:

rpm -ivh mysql-community-common-5.7.24-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.24-1.el7.x86_64.rpm

rpm -ivh mysql-community-client-5.7.24-1.el7.x86_64.rpm

rpm -ivh mysql-community-server-5.7.24-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-compat-5.7.24-1.el7.x86_64.rpm

启动mysql服务 systemctl start mysqld.service

查看mysql的初始root密码 cat /var/log/mysqld.log

修改root密码  mysql -u root -p

输入初始密码

设置新的root密码 set password = password('newpassword');

设置外部远程访问权限:

grant all privileges on *.* to 'root' @'%' identified by 'newpassword';

flush privileges;

创建zabbix数据库并本机访问该库的授权

grant all on zabbix.* to zabbix@'localhost' identified by 'newpassword';

create database zabbix charset 'utf8';

flush privileges;

exit;

设置mysql开机启动

systemctl enable mysqld

3、zabbix-server安装

3.1 yum install zabbix-server-mysql

导入zabbix-server需要的数据库表

rpm -ql zabbix-server-mysql

cd /usr/share/doc/zabbix-server-mysql-3.2.3/

zcat create.sql.gz |mysql -uroot -pnewpassword  zabbix

Zcat语句替换下面两条语句

###gunzip create.sql.gz

###mysql -uroot -p -Dzabbix < create.sql

查看是否导入成功(也可通过数据库可视化工具查看,如navicat、sqlyog等)

mysql -u zabbix -p

show tables

修改zabbix-server配置文件

vim /etc/zabbix/zabbix_server.conf

只需修改以下几个即可

ListenPort=10051

SourceIP=10.46.182.39(改成你自己的)

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=1qaz@WSX

DBPort=3306

启动zabbix-server并查看10051端口是否启动systemctl start zabbix-server.service

Systemctl  enable zabbix-server

3.2 安装zabbix-web

yum install httpd php php-mysql php-mbstring php-gd php-bcmath php-ldap php-xml

yum install zabbix-web zabbix-web-mysql

Zabbix-web端配置文件修改

vim /etc/httpd/conf.d/zabbix.conf

此处只修改时区

启动zabbix-web服务

systemctl start httpd.service

Systemctl enble httpd.service

至此配置工作准备完成,现在可以在网页输入你zabbix-web所安装的主机地址进行管理(如http://10.46.182.39/zabbix)

3.4 验证api是否可用

curl -s -X POST -H 'Conten","params": {"user": "Admin","password": "zabbix"},"id": 1,"auth": null}' http://10.43.33.90/zabbix/api_jsonrpc.php

Zabbix-server及zabbix-web安装手册(centos7)的更多相关文章

  1. docker 一键安装zabbix server、zabbix agent

    基本原理.须知:1.zabbix 分为zabbix server和zabbix agent,其中zabbix server需要web环境,并且其数据存储在独立的数据库中:2.docker是一种容器服务 ...

  2. Zabbix Server 和 Zabbix Agentd 开机自动运行

    Zabbix Server 和 Zabbix Agentd 开机自动运行 请问:怎样 Zabbix Server 和 Zabbix Agentd 开机自动运行? 注:如果你的命令行写进了 /etc/r ...

  3. 基于LNMP的Zabbbix之Zabbix Server源码详细安装,但不给图

    Zabbix Server安装 看到那里有错或者有什么问题的话,求指点 邮箱:losbyday@163.com 上一篇PHP源码安装参见基于LNMP的Zabbbix之PHP源码安装:https://i ...

  4. Centos7下使用yum源安装zabbix Server

    系统:Centos7 zabbix版本:4.2   一.Zabbix Server端   1.安装仓库 rpm -ivh https://repo.zabbix.com/zabbix/4.2/rhel ...

  5. Centos 7.0 下安装 Zabbix server 3.0服务器的安装及 监控主机的加入(1)

    一.本系列分为6部分 1.Centos 7.0 下安装 Zabbix server 3.0服务器的安装及 监控主机的加入 2.Centos 6.5 下安装 Zabbix server 3.0服务器的安 ...

  6. Centos 7.0_64bit 下安装 Zabbix server 3.0服务器的安装

    一.关闭selinux   修改配置文件/ etc / selinux / config,将SELINU置为禁用(disabled)   vim /etc/selinux/config  # This ...

  7. 01: 安装zabbix server

    目录:Django其他篇 01: 安装zabbix server 02:zabbix-agent安装配置 及 web界面管理 03: zabbix API接口 对 主机.主机组.模板.应用集.监控项. ...

  8. zabbix server、agent安装及使用

    先准备yum源,当然你有打好的rpm包那更好 [root@linux-node1 ~]# cat /etc/yum.repos.d/zabbix.repo [zabbix] name=Zabbix O ...

  9. 运维监控-使用Zabbix Server 添加自定义 item

    运维监控-使用Zabbix Server 监控自定义 item  作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 本篇博客就直接开门见山如何使用Zabbix Server 监控自定义 ...

  10. zabbix监控报错zabbix server is not running: the information displayed may not be current

    zabbix监控搭建完后打开web界面http://xxx/zabbix报错: zabbix server is not running: the information displayed may ...

随机推荐

  1. 2018-8-10-WPF-DrawingVisual

    title author date CreateTime categories WPF DrawingVisual lindexi 2018-08-10 19:16:53 +0800 2018-2-1 ...

  2. ie 图片拉伸

    终于发现只要设置img为 height:auto,width:auto,就不会出现这种情况了 img { height: auto; width: auto; }

  3. property和attribute的区别---value

    从网上看到很多写关于input的value属性,写的setAttribute可以影响DOM的property的value,在实践中我发现不同现象, 在页面初始化后,用setAttribute对valu ...

  4. String类型的时间大小比较

    不多废话,上代码   (String 的CompareTo方法比较仅仅限于同位数的字符串比较,格式.位数不一样比较结果会错误,原因是CompareTo比较源码是ASCII的比较) 代码一 packag ...

  5. 【leetcode】969. Pancake Sorting

    题目如下: Given an array A, we can perform a pancake flip: We choose some positive integer k <= A.len ...

  6. elementUI 日期时间选择器 只能选择当前及之后的时间

    日期时间选择器  只能选择当前及之后的时间 <el-date-picker class="input-border-null" prefix-icon="el-ic ...

  7. Vue学习笔记【19】——Vue中的动画(使用第三方 CSS 动画库)

    导入动画类库:  <link rel="stylesheet" type="text/css" href="./lib/animate.css& ...

  8. Java——is-a、is-like-a、has-a

    3.8 is-a.is-like-a.has-a 3.8.1 is-a(类和类之间的继承关系,泛化关系) public class Animal{ public void method1() ; } ...

  9. css创建

    CSS 创建 当读到一个样式表时,浏览器会根据它来格式化 HTML 文档. 如何插入样式表 插入样式表的方法有三种: 外部样式表(External style sheet) 内部样式表(Interna ...

  10. Delphi GDI+ 安装方法

    [转]Delphi GDI+ 安装方法转自:万一博客(http://www.cnblogs.com/del/)GDI+ 是 Windows 的一个函数库, 来自 Windows\System32\GD ...