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界面

相关推荐
今年下半年4 小时前
【Spring Boot】多种存储文件(FastDFS / MinIO / 阿里云 OSS)接入设计说明(附源码)
spring boot·分布式·中间件·简单工厂模式·策略模式
ShineWinsu5 小时前
对于Redis:string类型的解析
java·c++·redis·分布式·缓存·面试·string
仍然.9 小时前
RabbitMQ---可靠性传输
网络·分布式·rabbitmq
灯澜忆梦11 小时前
【RabbitMQ #13】 | 延迟消息
分布式·rabbitmq·ruby
青山木12 小时前
秒杀系统设计(二):数据正确性——防超卖、分布式锁与一人一单
分布式·后端·mysql·中间件·架构
weixin_4241836121 小时前
开放—封闭原则实战(下):基于策略的流程编排与编译期多态
c++·分布式·系统架构
frjc1 天前
分布式事务:场景与选型决策表
分布式
GISMagic1 天前
5.《Designing Data-Intensive Applications》:系统设计与分布式能力提炼
分布式·ai coding
需要8261 天前
分布式 ID 生成:雪花算法、号段模式与时钟回拨
分布式·算法
灯澜忆梦1 天前
【RabbitMQ #11】 | 消费者可靠性
分布式·rabbitmq·ruby