Piranha Configuration Tool 配置 LVS (DR)
=================================================================================
Piranha Configuration Tool为 LVS 创建所需配置文件 —/etc/sysconfig/ha/lvs.cf
环境:
lvs-DR
1.hosts
cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.2 active.uplook.com active
192.168.1.3 backup.uplook.com backup
192.168.1.10 node1.uplook.com node1
192.168.1.20 node2.uplook.com node2
2.cip 192.168.1.1
dip 192.168.1.2/24
vip 192.168.1.100/32(调度器上无需配置 软件自己分配)
rip1 192.168.1.10/24 vip lo 192.168.1.100/32
rip2 192.168.1.20/24 vip lo 192.168.1.100/32
3.调度器
[rhel6]
name=Red Hat Enterprise Linux
baseurl=file:///mnt/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[LoadBalancer]
name=Red Hat Enterprise Linux
baseurl=file:///mnt/LoadBalancer
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[HighAvailability]
name=Red Hat Enterprise Linux
baseurl=file:///mnt/HighAvailability
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[ResilientStorage]
name=Red Hat Enterprise Linux
baseurl=file:///mnt/ResilientStorage
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[ScalableFileSystem]
name=Red Hat Enterprise Linux
baseurl=file:///mnt/ScalableFileSystem
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
yum install ipvsadm piranha -y (主备都安装)
4.piranha-passwd
redhat
5.[root@active ~]# /etc/init.d/piranha-gui start
[root@active ~]# chkconfig piranha-gui on
[root@active ~]# netstat -tnlp |grep :3636
tcp 0 0 :::3636 :::* LISTEN 1887/httpd
6.登录192.168.1.2 ,用户名和密码如下:
piranha
redhat
1)监控页面 刚开始为down
2)全局确认主调
3)冗余为备调
以上为虚拟服务名称和vip捆绑接口
检测脚本
将配置文件lvs.cf同步到备调度器
[root@active ~]# rsync -va /etc/sysconfig/ha/lvs.cf backup:/etc/sysconfig/ha/
启动进程pulse
[root@active ~]# /etc/init.d/pulse start
[root@active ~]# chkconfig pulse on
[root@backup ~]# /etc/init.d/pulse start
[root@backup ~]# chkconfig pulse on
只有活跃的调度器上才有lvs列表 虚拟ip在主上 注意开启路由转发