双vip web集群基于nginx利用zabbix监控

本文介绍了如何构建一个双VIP Web集群,使用nginx作为负载均衡器,并通过zabbix进行监控。步骤包括关闭防火墙和selinux,安装pssh,配置ssh免密,编译安装nginx,安装zabbix,将Web服务器加入监控,配置NFS保持内容同步,修改nginx配置文件实现负载均衡,以及设置LB-1和LB-2的高可用性。
摘要由CSDN通过智能技术生成

一、项目架构图

二、项目环境

准备七台linux虚拟机(centos7)

zabbxi(安装zabbix、pssh)

LB-1和LB-2(安装nginx、keeplived)

master、slave1、slave2(安装nginx、nfs、zabbix-agent)

三、项目步骤

1、关闭所有虚拟机的防火墙和selinux

service firewalld stop
systemctl disable firewalld

setenforce 0
sed -i '/^SELINUX=/ s/enforcing/disabled/' /etc/sysconfig/selinux

2、再zabbix上安装pssh

yum install epel-release -y
yum install pssh -y

3、在所有虚拟机之间配置ssh免密通道

生成公钥和私钥(除了client,其他六台都要生成)

[root@192 ~]# ssh-keygen -t ecdsa
Generating public/private ecdsa key pair.
Enter file in which to save the key (/root/.ssh/id_ecdsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_ecdsa.
Your public key has been saved in /root/.ssh/id_ecdsa.pub.
The key fingerprint is:
SHA256:235mqpYsgoo6YZa8LorJTVpBePE9WocUBjuW69j+GN0 root@192.168.88.147
The key's randomart image is:
+---[ECDSA 256]---+
|   . ..+.        |
|  . o * .        |
| . o * = .       |
|  o . = o        |
|. .. o  S        |
|.=  = . .o       |
|o..= + o.E.      |
|*o* o + +.  +    |
|%* . +.+..o=     |
+----[SHA256]-----+
[root@192 ~]# cd /root/.ssh
[root@192 .ssh]# ls
id_ecdsa  id_ecdsa.pub

上传公钥(除了clinet其他,六台都要上传)


                
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值