zabbix 3.0离线安装手册(其他版本同样适用)

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: zabbix 3.0离线安装手册一.环境介绍操作系统:CentOS-7-x86_64-Minimal-1511.iso最小化安装,语言选择英文iso下载地址:http://mirrors.

zabbix 3.0离线安装手册

一.环境介绍

操作系统:CentOS-7-x86_64-Minimal-1511.iso
最小化安装,语言选择英文
iso下载地址:http://mirrors.163.com/centos/7.2.1511/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso
zabbix:zabbix 3.0.2
rpm包下载地址:http://dl.cactifans.org/zabbix/mysql.tar.gz
http://dl.cactifans.org/zabbix/rpm.tar.gz
安装方式:rpm包安装

二.安装依赖包

由于使用离线安装方式,因此通过rpm包安装所有依赖包。

1.设置基本环境

关闭selinux

<figure class="highlight plain">

|

<pre>

vi /etc/sysconfig/selinux
把SELINUX=enforcing改为SELINUX=disabled

保存并退出,执行

设置好并重启服务器

2.安装数据库

centos7 采用mariadb 数据库(mysql分支)
mysql.tar.gz 上传到服务器,并解压

tar zxvf mysql.tar.gz

cd mysql

rpm -Uvh mariadb-libs-5.5.47-1.el7_2.x86_64.rpm

升级默认的mariadb客户端包
安装mariadb

rpm -ivh mariadb-5.5.47-1.el7_2.x86_64.rpm \

mariadb-server-5.5.47-1.el7_2.x86_64.rpm \

perl-5.16.3-286.el7.x86_64.rpm \

perl-Carp-1.26-244.el7.noarch.rpm \

perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm \

perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm \

perl-constant-1.27-2.el7.noarch.rpm \

perl-Data-Dumper-2.145-3.el7.x86_64.rpm \

perl-DBD-MySQL-4.023-5.el7.x86_64.rpm \

perl-DBI-1.627-4.el7.x86_64.rpm \

perl-Encode-2.51-7.el7.x86_64.rpm \

perl-Exporter-5.68-3.el7.noarch.rpm \

perl-File-Path-2.09-2.el7.noarch.rpm \

perl-File-Temp-0.23.01-3.el7.noarch.rpm \

perl-Filter-1.49-3.el7.x86_64.rpm \

perl-Getopt-Long-2.40-2.el7.noarch.rpm \

perl-HTTP-Tiny-0.033-3.el7.noarch.rpm \

perl-IO-Compress-2.061-2.el7.noarch.rpm \

perl-libs-5.16.3-286.el7.x86_64.rpm \

perl-macros-5.16.3-286.el7.x86_64.rpm \

perl-Net-Daemon-0.48-5.el7.noarch.rpm \

perl-parent-0.225-244.el7.noarch.rpm \

perl-PathTools-3.40-5.el7.x86_64.rpm \

perl-PlRPC-0.2020-14.el7.noarch.rpm \

perl-Pod-Escapes-1.04-286.el7.noarch.rpm \

perl-podlators-2.5.1-3.el7.noarch.rpm \

perl-Pod-Perldoc-3.20-4.el7.noarch.rpm \

perl-Pod-Simple-3.28-4.el7.noarch.rpm \

perl-Pod-Usage-1.63-3.el7.noarch.rpm \

perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm \

perl-Socket-2.010-3.el7.x86_64.rpm \

perl-Storable-2.45-3.el7.x86_64.rpm \

perl-Text-ParseWords-3.29-4.el7.noarch.rpm \

perl-threads-1.87-4.el7.x86_64.rpm \

perl-threads-shared-1.43-6.el7.x86_64.rpm \

perl-Time-HiRes-1.9725-3.el7.x86_64.rpm \

perl-Time-Local-1.2300-2.el7.noarch.rpm

注意是直接复制执行,就会安装mariadb

3.设置mariadb

设置开机启动

systemctl enable mariadb

修改数据库编码

[mysqld] 段加入如下

character-set-server=utf8

max_connections = 10000

完整的my.cnf内容如下

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

#Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

#Settings user and group are ignored when systemd is used.

If you need to run mysqld under a different user or group,

#customize your systemd unit file for mariadb according to the

instructions in http://fedoraproject.org/wiki/Systemd

character-set-server=utf8

max_connections = 10000

[mysqld_safe]

log-error=/var/log/mariadb/mariadb.log

pid-file=/var/run/mariadb/mariadb.pid

include all files from the config directory

!includedir /etc/my.cnf.d

启动mariadb数据库

systemctl start mariadb

设置mariadb,执行

mysql_secure_installation

这里可以设置root密码,我们设置为123456 ,具体过程

[root@localhost mysql]# mysql_secure_installation

/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

  SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current

password for the root user. If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them. This is intended only for testing, and to make the installation

go a bit smoother. You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

... Success!

Normally, root should only be allowed to connect from 'localhost'. This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y

... Success!

By default, MariaDB comes with a database named 'test' that anyone can

access. This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] y

  • Dropping test database...

... Success!

  • Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB

installation should now be secure.

Thanks for using MariaDB!

4.创建zabbix数据库

mysql -uroot -p123456

create database zabbix;

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

flush privileges;

exit;

这里我们创建了zabbix 数据库,并且建立了一个用户zabbix,密码为zabbixpwd123,并把zabbix授权给zabbix用户

二.安装zabbix

1.安装软件包

把rpm.tar.gz 上传到服务器,并解压

tar zxvf rpm.tar.gz

cd rpm

rpm -ivh apr-1.4.8-3.el7.x86_64.rpm \

apr-util-1.5.2-6.el7.x86_64.rpm \

dejavu-fonts-common-2.33-6.el7.noarch.rpm \

dejavu-sans-fonts-2.33-6.el7.noarch.rpm \

fontpackages-filesystem-1.44-8.el7.noarch.rpm \

fping-3.10-1.el7.x86_64.rpm \

httpd-2.4.6-40.el7.centos.1.x86_64.rpm \

httpd-tools-2.4.6-40.el7.centos.1.x86_64.rpm \

iksemel-1.4-2.el7.centos.x86_64.rpm \

libjpeg-turbo-1.2.90-5.el7.x86_64.rpm \

libpng-1.5.13-7.el7_2.x86_64.rpm \

libtool-ltdl-2.4.2-21.el7_2.x86_64.rpm \

libX11-1.6.3-2.el7.x86_64.rpm \

libX11-common-1.6.3-2.el7.noarch.rpm \

libXau-1.0.8-2.1.el7.x86_64.rpm \

libxcb-1.11-4.el7.x86_64.rpm \

libXpm-3.5.11-3.el7.x86_64.rpm \

libxslt-1.1.28-5.el7.x86_64.rpm \

libzip-0.10.1-8.el7.x86_64.rpm \

mailcap-2.1.41-2.el7.noarch.rpm \

net-snmp-libs-5.7.2-24.el7_2.1.x86_64.rpm \

OpenIPMI-libs-2.0.19-11.el7.x86_64.rpm \

OpenIPMI-modalias-2.0.19-11.el7.x86_64.rpm \

php-5.4.16-36.1.el7_2.1.x86_64.rpm \

php-bcmath-5.4.16-36.1.el7_2.1.x86_64.rpm \

php-cli-5.4.16-36.1.el7_2.1.x86_64.rpm \

php-common-5.4.16-36.1.el7_2.1.x86_64.rpm \

php-gd-5.4.16-36.1.el7_2.1.x86_64.rpm \

php-ldap-5.4.16-36.1.el7_2.1.x86_64.rpm \

php-mbstring-5.4.16-36.1.el7_2.1.x86_64.rpm \

php-mysql-5.4.16-36.1.el7_2.1.x86_64.rpm \

php-pdo-5.4.16-36.1.el7_2.1.x86_64.rpm \

php-xml-5.4.16-36.1.el7_2.1.x86_64.rpm \

t1lib-5.1.2-14.el7.x86_64.rpm \

unixODBC-2.3.1-11.el7.x86_64.rpm \

zabbix-agent-3.0.2-1.el7.x86_64.rpm \

zabbix-server-mysql-3.0.2-1.el7.x86_64.rpm \

zabbix-web-3.0.2-1.el7.noarch.rpm \

zabbix-web-mysql-3.0.2-1.el7.noarch.rpm

启动httpd

systemctl enable httpd

systemctl start httpd

设置php.ini参数

vi /etc/php.ini

修改如下参数,并保存
max_execution_time = 300

max_input_time = 300

post_max_size = 16M

date.timezone = Asia/Shanghai

设置好之后重启httpd服务

systemctl restart httpd

导入数据库

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

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

2.web页面初始化

浏览器打开http://ip/zabbix (推荐使用chrome浏览器)就可以看到zabbix 安装的web页面
点击Next step

img_dbfcdd337e0c7adfc239147d1080d034.png
1

检查每个选项是不是ok,查看页面都是ok,直接点Next step

输入zabbix数据库密码,别的都不用改(zabbix数据库的密码为zabbixpwd123,前面设置的)

直接点Next step,不用修改默认就成

这里概显示了设置,确认无误,直接点Next step

点击Finish完成web页面初始化

登录zabbix,默认的用户名为 admin,密码为 zabbix

3.zabbix服务初始化

修改zabbix server配置文件

vi /etc/zabbix/zabbix_server.conf

修改以下选项

DBPassword=zabbixpwd123

启动zabbix server,并设置开机启动

systemctl start zabbix-server

systemctl enable zabbix-server

启动zabbix agent,并设置开机启动

systemctl start zabbix-agent

systemctl enable zabbix-agent

再次查看zabbix web页面,显示zabbix server 已处于运行状态

img_ab97c6cf8ca6cd658f210f4a69f3e7f6.png
8

在web页面启用zabbix server自己的监控,依次点击Congfiguration——>Hosts,点击zabbix server后面的Disabled,启用zabbix server主机的自身监控

4.问题诊断

可通过命令查看zabbix server和zabbix agent的日志,查看错误,根据错误解决问题
zabbix server日志

tail -f /var/log/zabbix/zabbix_server.log

zabbix agent 日志

tail -f /var/log/zabbix/zabbix_agentd.log

---转自当代张思德博客

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
监控 关系型数据库 MySQL
通过docker容器方式部署zabbix-5.2版本监控系统
通过docker容器方式部署zabbix-5.2版本监控系统
436 0
|
存储 监控 关系型数据库
Dockerfile 研究-[zabbix 安装]-mysql版本
Dockerfile 研究-[zabbix 安装]-mysql版本
169 0
Dockerfile 研究-[zabbix 安装]-mysql版本
|
存储 监控 前端开发
【Zabbix】基于CentOS 7.9系统安装部署Zabbix 5.0LTS版本监控系统(详细教程)(上)
【Zabbix】基于CentOS 7.9系统安装部署Zabbix 5.0LTS版本监控系统(详细教程)
701 0
【Zabbix】基于CentOS 7.9系统安装部署Zabbix 5.0LTS版本监控系统(详细教程)(上)
|
监控 网络协议 Linux
【Zabbix】基于CentOS 7.9系统安装部署Zabbix 5.0LTS版本监控系统(详细教程)(下)
【Zabbix】基于CentOS 7.9系统安装部署Zabbix 5.0LTS版本监控系统(详细教程)
437 0
【Zabbix】基于CentOS 7.9系统安装部署Zabbix 5.0LTS版本监控系统(详细教程)(下)
|
监控 前端开发 安全
【Zabbix】基于CentOS 7.9系统安装部署Zabbix 5.0LTS版本监控系统(详细教程)(中)
【Zabbix】基于CentOS 7.9系统安装部署Zabbix 5.0LTS版本监控系统(详细教程)
585 0
【Zabbix】基于CentOS 7.9系统安装部署Zabbix 5.0LTS版本监控系统(详细教程)(中)
|
监控 网络安全
zabbix5.0监控windows.agent5.4(桌面端,服务器版本相同)
zabbix5.0监控windows.agent5.4(桌面端,服务器版本相同)
147 0
zabbix5.0监控windows.agent5.4(桌面端,服务器版本相同)
|
存储 监控 开发工具
Dockerfile 研究-[zabbix 安装]-pgsql版本
-#################################- ----------**PostgreSQL+TimescaleDB**---------- -#################################-
593 0
Dockerfile 研究-[zabbix 安装]-pgsql版本
|
云安全 监控 安全
《Zabbix 监控常用手册》电子版地址
《Zabbix 监控常用手册》电子书
141 0
《Zabbix 监控常用手册》电子版地址
|
监控 API 开发工具
zabbix离线安装 zabbix api批量添加主机
zabbix离线安装 zabbix api批量添加主机
455 0
|
SQL 监控 关系型数据库
centos7上部署zabbix4.0版本--最新配置(二)
1.zabbix4.0监控系统部署 zabbix4.0软件分为:zabbix-server-mysql zabbix-web-mysql 这里虽然是-mysql但是不是安装的数据库哟,而是这个zabbix将来使用什么版本的数据库,可以是postgresql也可以是mysql 预先配置
308 0
centos7上部署zabbix4.0版本--最新配置(二)

推荐镜像

更多