Zabbix安装部署【超级详细】

9 篇文章 5 订阅
2 篇文章 1 订阅

环境准备

VMware Workstation Pro 15.0 版本

系统    Centos7

内存    4G

处理器    2G

硬盘    50G

网络适配器    NAT

清空 /etc/yum.repos.d/ 下面的所有文件,并下载阿里云的centos7镜像和epel7镜像

rm -rf /etc/yum.repos.d/*

wget -O /etc/yum.repos.d/Centos-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

wget -O /etc/yum.repos.d/epel-7 http://mirrors.aliyun.com/repo/epel-7

查看 /etc/yum.repos.d/ 下面的文件,源文件已经下载完成

[root@gpmall ~]# ll /etc/yum.repos.d/
total 8
-rw-r--r-- 1 root root 614 Feb 11 14:46 CentOS-Base.repo
-rw-r--r-- 1 root root 230 Feb 11 14:46 epel-7

清空缓存,生成缓存

yum clean all
yum makecache

下载httpd,关闭防火墙并开启httpd服务

systemctl stop firewalld
systemctl disable firewalld
systemctl enable httpd
systemctl start httpd

安装MySQL

yum install -y mariadb mariadb-server
systemctl enable mariadb
systemctl start mariadb

安装php环境

yum install -y php php-mysql

下载安装包

rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

安装zabbix的包

yum install -y zabbix-server-mysql zabbix-get zabbix-web zabbix-web-mysql zabbix-agent zabbix-sender

创建一个zabbix库并设置为utf8的字符编码格式如图

创建账户并且授权设置密码,刷新并退出如图

切换到此目录下并查看文件

[root@localhost ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.15/
[root@localhost zabbix-server-mysql-3.4.15]# ls
AUTHORS  ChangeLog  COPYING  create.sql.gz  NEWS  README

进行解压

[root@localhost zabbix-server-mysql-3.4.15]# gunzip create.sql.gz 
[root@localhost zabbix-server-mysql-3.4.15]# ls
AUTHORS  ChangeLog  COPYING  create.sql  NEWS  README

 使用zabbix表对表进行导入

mysql
user zabbix;
source create.sql;

配置zabbix server配置文件

配置文件目录

[root@localhost zabbix-server-mysql-3.4.15]# cd /etc/zabbix
[root@localhost zabbix]# vi zabbix_server.conf 
对zabbix_server.conf进行配置
set nu 显示行数
91 DBHost=localhost
100 DBName=zabbix
116 DBUser=zabbix
125 DBPassword=zabbix
131 DBSocket=/var/lib/mysql/mysql.sock

运行zabbix-server服务,开机自启zabbix-server服务如图

[root@localhost zabbix]# systemctl start zabbix-server.service 
[root@localhost zabbix]# systemctl enable zabbix-server.service      
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.

进入 /etc/httpd/conf.d/zabbix.conf 配置时间如图

配置数据库密码

使用mysql_secure_installation,相关操作如下:

[root@localhost ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, 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 MySQL
root user without the proper authorisation.
Set root password? [Y/n]    #是否设置root用户密码,输入y并回车或直接回车
New password:               #设置root用户的密码
Re-enter new password:      #再输入一次你设置的密码
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL 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]   #是否删除匿名用户,生产环境建议删除,所以直接回车
… 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] #是否禁止root远程登录,根据自己的需求选择Y/n并回车,建议禁止
… Success!
By default, MySQL 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] #是否删除test数据库,直接回车
- 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] #是否重新加载权限表,直接回车
… Success!
Cleaning up…
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!

重启httpd服务

systemctl restart httpd

查看 本机IP

登陆zabbix网址:http://IP地址/zabbix

所以我们登录 http://192.168.20.138/zabbix       登陆成功

点击 Next step

点击下一步

点击下一步

后面一直点下一步

登陆账户是Admin

密码是zabbix

安装完成

  • 30
    点赞
  • 402
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 13
    评论
Zabbix是一个功能强大的监控系统,安装部署Zabbix主要包括安装Zabbix Server和Zabbix Proxy,并进行相应的配置。以下是一个详细安装部署步骤: 1. 安装Zabbix储存库:首先需要安装Zabbix的储存库。根据引用中提到的方法,可以使用二进制安装方式,然后按照文档中的指引进行操作。 2. 准备环境和安装依赖组件:在安装Zabbix之前,需要确保系统满足一些基本的要求,并安装所需的依赖组件。具体的依赖组件和环境准备步骤可以参考引用中的详细安装部署文档。 3. 创建用户和导入数据库:在安装Zabbix之前,需要创建一个用于Zabbix的数据库和用户,并导入相应的数据。这些步骤也可以在引用的文档中找到。 4. 编辑配置文件:Zabbix Server、Proxy和Agent都有各自的配置文件,需要根据实际需求进行相应的配置。可以参考引用中提到的配置文件的位置和重要参数,根据需要进行修改。 5. 安装Nginx和配置Zabbix Web:Zabbix Web是Zabbix监控系统的前端界面,通常使用Nginx作为Web服务器。可以按照引用中的指引安装和配置Nginx,然后对Zabbix Web进行相应的配置优化。 6. 部署Zabbix Proxy(可选):Zabbix Proxy可以用于替Zabbix Server收集性能和可用性数据,并且可以分担Zabbix Server的负载。如果需要使用Zabbix Proxy,可以参考引用中的相关文档进行部署。 以上是Zabbix安装部署详细步骤,可以根据实际情况进行操作。希望对你有帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [zabbix介绍及部署(超详细讲解)](https://blog.csdn.net/SmileLife_/article/details/126535575)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Zabbix详细安装部署(最全)](https://blog.csdn.net/u013651427/article/details/106849763)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [Zabbix详细安装部署](https://blog.csdn.net/linux_yanbb/article/details/129843531)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小航冲冲冲

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值