Zabbix分布式监控系统

实验过程

ps:

阿里云盘Xnode1获取

xnode1 https://www.alipan.com/s/HgLXfoeBWG2

提取码: eb70

1、xnode1克隆两台虚拟机并修改ip

zabbix-server192.168.224.3

zabbix-agent192.168.224.4

2、修改主机名

复制代码
[root@localhost ~]# hostnamectl set-hostname zabbix-server
[root@localhost ~]#bash

1、修改/etc/hosts文件(2个节点)

复制代码
[root@zabbix-server ~]#vi /etc/hosts

添加:

1 92.168. 224.3 zabbix-server

1 92.168. 224.4 zabbix - agent

复制代码
[root@zabbix-agent ~]#vi /etc/hosts

添加:

1 92.168. 224.3 zabbix-server

1 92.168. 224.4 zabbix - agent

2.配置yum源

1> Zabbix-server

复制代码
[root@zabbix-server ~]# vi /etc/yum.repos.d/local.repo

添加

zabbix

name=zabbix

baseurl=file:///opt/zabbix

gpgcheck=0

enabled=1

复制代码
[root@zabbix-server ~]#mv zabbix /opt

2>Zabbix-agent

复制代码
[root@zabbix-agent ~]# vi /etc/yum.repos.d/local.repo

添加

zabbix

name=zabbix

baseurl=ftp://192.168.224.3/zabbix

gpgcheck=0

enabled=1

3.在zabbix-server节点上安装vsftpd服务

复制代码
[root@zabbix-server ~]# yum install vsftpd -y

修改vsftpd.conf配置文件

复制代码
[root@zabbix-server ~]# vi /etc/vsftpd/vsftpd.conf 

添加:

anon_root=/opt (配置文件最上面)

启动vsftpd服务

复制代码
[root@zabbix-server ~]# systemctl start vsftpd 
[root@zabbix-server ~]# systemctl status vsftpd

4.安装LAMP+Zabbix服务(在zabbix-server节点上)

1>安装httpd服务

复制代码
[root@zabbix-server ~]# yum install httpd -y

2>安装数据库服务

复制代码
[root@zabbix-server ~]# yum install -y mariadb mariadb-server

3>安装zabbix服务

复制代码
[root@zabbix-server ~]# yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent

4>升级trousers服务

复制代码
[root@zabbix-server ~]# yum install trousers -y

5.配置并启动zabbix服务

1>启动httpd服务

复制代码
[root@zabbix-server ~]# systemctl start httpd 
[root@zabbix-server ~]# systemctl enable httpd

2>启动并配置数据库服务

复制代码
[root@zabbix-server ~]# systemctl start mariadb 
[root@zabbix-server ~]# systemctl enable mariadb

登录数据库创建zabbix数据库

复制代码
[root@zabbix-server ~]# mysql

如果不行的话初始化一下数据库

mysql_secure_installation

Enter current password for root (enter for none): #默认按回车

Set root password? Y/n y

New password:123456

Re-enter new password:123456

Remove anonymous users? Y/n y

Disallow root login remotely? Y/n n

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

Reload privilege tables now? Y/n y

复制代码
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;

授予zabbix用户访问权限

复制代码
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@'%' identified by 'zabbix';
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

导入数据库文件

复制代码
[root@zabbix-server ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.15/
[root@zabbix-server zabbix-server-mysql-3.4.15]# zcat create.sql.gz |mysql -uroot zabbix

6.设置时区

1>编辑/etc/php.ini文件,在Date字段下,设置 date.timezone=PRC

Vim查找:/+内容 一开始的;别忘了删除

2>编辑/etc/httpd/conf.d/zabbix.conf 文件,修改时区,

修改 php_value date.timezone 为 Asia/Shanghai

重启httpd服务:

复制代码
root@zabbix-server ~]# systemctl restart httpd

7.修改zabbix配置文件并启动显示行数:set nu

修改/etc/zabbix/zabbix_server.conf 配置文件

91#去掉

124修改

131/132修改

启动zabbix服务:

复制代码
[root@zabbix-server ~]# systemctl start zabbix-server

查看端口号,验证 zabbix-server 的服务端口 10051 是否存在

复制代码
[root@zabbix-server ~]# yum install net-tools

[root@zabbix-server ~]# netstat -ntpl

8.登录界面http://192.168.224.3/zabbix

密码:zabbix

9.Zabbix-agent

vim中给列排序号: :set nu

安装zabbix-agent服务

复制代码
[root@zabbix-agent ~]# yum install -y zabbix-agent

修改/etc/zabbix/zabbix_agentd.conf 配置文件,配置 zabbix-agent,

复制代码
[root@zabbix-agent ~]# vi /etc/zabbix/zabbix_agentd.conf

Server=192.168.224.3

serverActive=192.168.224.3

启动 zabbix-agent 服务,并查看 10050 端口是否存在

复制代码
[root@zabbix-agent ~]# systemctl start zabbix-agent
[root@zabbix-agent ~]# yum install net-tools 
[root@zabbix-agent ~]# netstat -ntpl

10.Web界面

相关推荐
三十..9 分钟前
Ceph分布式存储核心技术精要与运维实践指南
运维·分布式·ceph
蜀道山老天师2 小时前
Docker Compose 多容器编排实战:LNMP、Tomcat 集群、云桌面、Portainer、Zabbix 一键部署
运维·docker·容器·tomcat·zabbix
cfm_29145 小时前
Redis高并发分布式锁了解
redis·分布式
小小编程路5 小时前
分布式核心知识
分布式
bukeyiwanshui5 小时前
20260528 Ceph 分布式存储 集群配置
分布式·ceph
我叫张小白。6 小时前
基于Redis与FastAPI的分布式共享会话体系
数据库·redis·分布式·缓存·中间件·fastapi·依赖注入
天河归来6 小时前
国产数据库安全可靠测评产品观察:从集中式、分布式到 HTAP 的发展趋势
数据库·分布式
小碗羊肉7 小时前
【Redis | 第五篇】分布式锁
数据库·redis·分布式
运维栈记7 小时前
Ceph 入门:一文读懂分布式存储的“瑞士军刀”
分布式·ceph
头歌实践平台7 小时前
HBase 完全分布式安装(新)
数据库·分布式·hbase