注:本实验环境在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. svnserve - 使用 `svn' 访问仓库时的服务器

    SYNOPSIS 总览 svnserve [options] DESCRIPTION 描述 svnserve 允许使用 svn 网络协议访问 Subversion 仓库.它可以运行为独立的服务器进程, ...

  2. 记录一下取ul中li的值

    //#id 事件 $('#onLineUser').on('click','li',function () { $(".list-group-item").removeClass( ...

  3. 检查目录下 文件的权限-linux shell脚本

    #!/bin/bash #History: #2019/07/23    Fsq #This Program will check Permissions on dir PATH=/bin:/sbin ...

  4. 手机作为蓝牙音频源连接到Linux时,如何通过音量键调节传入的音量大小

    背景一: 我们知道,把手机作为音频源通过蓝牙连接到电脑,就可以把手机的声音转移到电脑上. 背景二: 我喜欢带着耳机用我的Linux本刷youtube,也喜欢用我的iPhone听音乐.为了同时做这两件事 ...

  5. js 实现 间隙滚动效果

    代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3. ...

  6. Windows NtQueryInformationProcess()

    { https://www.orcode.com/article/Processes_20126324.html } { 或代码 文章 编程通用 线程,进程及IPC 与NtQueryInformati ...

  7. PHP ftp_pwd() 函数

    定义和用法 ftp_pwd() 函数返回指定 FTP 连接的当前目录名称. 语法 ftp_pwd(ftp_connection) 参数 描述 ftp_connection 必需.规定要使用的 FTP ...

  8. 高级运维(五):构建memcached服务、LNMP+memcached、使用Tomcat设置Session、Tomcat实现session共享

    一.构建memcached服务 目标: 本案例要求先快速搭建好一台memcached服务器,并对memcached进行简单的添.删.改.查操作: 1> 安装memcached软件,并启动服务d ...

  9. xml配置离线约束的目的和ecplipse离线约束配置

    正常情况下如果电脑已经联网的情况下,Spring的核心配置文件编写内容的时候是可以自动提示的,假设电脑如果离线情况下想要自动提示的话,就得配置离线约束文件. https://blog.csdn.net ...

  10. BZOJ 3230: 相似子串(后缀数组)

    传送门 解题思路 其实题目挺好想的.首先子串排名可以由后缀数组求得,因为不算重复的,所以后缀数组的每个后缀排名的去掉\(lcp\)的前缀排名为当前后缀的子串排名.这样就可以预处理出每个后缀的\(l,r ...