博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Piranha LVS DR 模式 HA 集群配置
阅读量:2242 次
发布时间:2019-05-09

本文共 2210 字,大约阅读时间需要 7 分钟。

Piranha 是 Redhat 提供的一个基于 Web 进行 LVS 集群及 HA 配置管理软件,可以省去手工配置 LVS 的繁琐工作.


LVS拓扑图


一、 配置 Real Server 节点

  • RS 1 :  172.30.2.155

  • RS 2 :  172.30.2.156

  • 两个RS节点配置好lnmp集群后做以下操作


1、 调整内核参数解决 ARP 响应问题

[root@web1 ~]# echo "net.ipv4.conf.all.arp_ignore = 1" >> /etc/sysctl.conf[root@web1 ~]# echo "net.ipv4.conf.all.arp_announce = 2" >> /etc/sysctl.conf[root@web1 ~]# sysctl  -p

2、 添加 lo:1 网卡配置

[root@web1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-lo:1DEVICE=lo:1ONBOOT=yesBOOTPROTO=staticIPADDR=172.30.2.22NETMASK=255.255.255.255

3、 重启网络 lo:1 绑定VIP

[root@web1 ~]# /etc/init.d/network restart[root@web1 ~]# ifconfig lo:1lo:1      Link encap:Local Loopback            inet addr:172.30.2.22  Mask:255.255.255.255          UP LOOPBACK RUNNING  MTU:16436  Metric:1

二、 配置调度器节点

  • 主调度器:  172.30.2.155

  • 备调度器:  172.30.2.156

  • 两个调度节点都做以下操作


1、 关闭 Selinux 及 iptables

# 临时修改,立即生效[root@lvs ~]# setenforce 0# 永久修改,需要重启[root@lvs ~]# vim /etc/sysconfig/selinuxSELINUX=disabled[root@lvs ~]# /etc/init.d/iptables stop

2、 修改内核参数开启路由转发

[root@lvs ~]# sed -i 's/net.ipv4.ip_forward\ =\ 0/net.ipv4.ip_forward\ =\ 1/' /etc/sysctl.conf [root@lvs ~]# sysctl -p

3、安装 piranha 及 ipvsadm

[root@lvs ~]# yum install piranha -y[root@lvs ~]# chkconfig pulse on

4、主节点配置 Prianha Web

# 设置 web 登陆密码[root@lvs ~]# piranha-passwdNew Password:Verify:Adding password for user piranha# 启动 piranha-gui[root@lvs ~]# /etc/init.d/piranha-gui start

5、通过 web 界面配置 LVS

  • http://192.168.2.11:3636/login 登陆配置集群

6、复制配置文件到备用节点

# 拷贝主节点lvs配置文件[root@lvs ~]# scp /etc/sysconfig/ha/lvs.cf 172.30.2.12:/etc/sysconfig/ha/

7、启动LVS服务(先主后从)

[root@lvs ~]# /etc/init.d/pulse startStarting pulse:                                            [确定]

8、访问及查看 LVS 转

[root@lvs ~]# ipvsadm -ln      IP Virtual Server version 1.2.1 (size=4096)Prot LocalAddress:Port Scheduler Flags  -> RemoteAddress:Port           Forward Weight ActiveConn InActConnTCP  172.30.2.22:80 wlc persistent 360  -> 172.30.2.155:80              Route   1      0          0           -> 172.30.2.156:80              Route   1      0          0         TCP  172.30.2.22:443 wlc persistent 360  -> 172.30.2.155:443             Route   1      0          0           -> 172.30.2.156:443             Route   1      1          0

这里写图片描述

这里写图片描述

转载地址:http://usgbb.baihongyu.com/

你可能感兴趣的文章
TP5.1事务操作和TP5事务回滚操作多表
查看>>
composer install或composer update 或 composer require phpoffice/phpexcel 失败解决办法
查看>>
TP5.1项目从windows的Apache服务迁移到linux的Nginx服务需要注意几点。
查看>>
win10安装软件 打开时报错 找不到 msvcp120.dll
查看>>
PHPunit+Xdebug代码覆盖率以及遇到的问题汇总
查看>>
PHPUnit安装及使用
查看>>
PHP项目用xhprof性能分析(安装及应用实例)
查看>>
composer安装YII
查看>>
Sublime text3快捷键演示
查看>>
sublime text3 快捷键修改
查看>>
关于PHP几点建议
查看>>
硬盘的接口、协议
查看>>
VLAN与子网划分区别
查看>>
Cisco Packet Tracer教程
查看>>
02. 交换机的基本配置和管理
查看>>
03. 交换机的Telnet远程登陆配置
查看>>
微信小程序-调用-腾讯视频-解决方案
查看>>
phpStudy安装yaf扩展
查看>>
密码 加密 加盐 常用操作记录
查看>>
TP 分页后,调用指定页。
查看>>