Rhel6-piranha配置文档

系统环境: rhel6 x86_64 iptables and selinux disabled

主机: 192.168.122.119 server19.example.com

192.168.122.25 server25.example.com

192.168.122.163 server63.example.com

192.168.122.193 server93.example.com

yum仓库配置:

[rhel-source]

name=Red
Hat Enterprise Linux $releasever - $basearch - Source

baseurl=ftp://192.168.122.1/pub/yum

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[HighAvailability]

name=Instructor
Server Repository

baseurl=ftp://192.168.122.1/pub/yum/HighAvailability

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

enabled=1

[LoadBalancer]

name=Instructor
Server Repository

baseurl=ftp://192.168.122.1/pub/yum/LoadBalancer

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

enabled=1

[ResilientStorage]

name=Instructor
Server Repository

baseurl=ftp://192.168.122.1/pub/yum/ResilientStorage

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

enabled=1

[ScalableFileSystem]

name=Instructor
Server Repository

baseurl=ftp://192.168.122.1/pub/yum/ScalableFileSystem

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

enabled=1

Realserver1
192.168.122.163:apache

Realserver2
192.168.122.193:apache

Load
Balance 192.168.122.119:piranha

Load
Balance 192.168.122.25:piranha

以下步骤在server19server25上实施:

[root@server19
~]# yum install piranha -y

[root@server19
~]# piranha-passwd

以下步骤在server19server25上实施:

[root@server19
~]# /etc/init.d/piranha-gui start

[root@server19
~]# netstat -antple

tcp
0 0 :::3636 :::*
LISTEN 0 11213 2268/httpd

端口,能查看到此端口表示启动成功.

看到如下页面:

Rhel6-piranha配置文档

选择Login登录,用户名为piranha,密码为之前执行piranha-passwd时候设置的密码.

Rhel6-piranha配置文档

选择GLOBAL SETTINGS

Rhel6-piranha配置文档

选择REDUNDANCY

Rhel6-piranha配置文档

选择ENABLE

Rhel6-piranha配置文档

按如下如图配置并提交(按ACCEPT)

Rhel6-piranha配置文档

选择VIRTUAL SERVERS

Rhel6-piranha配置文档

选择ADD

Rhel6-piranha配置文档

选择EDIT

Rhel6-piranha配置文档

按如下如图配置并提交(按ACCEPT)

Rhel6-piranha配置文档

选择REAL SERVER

Rhel6-piranha配置文档

选择ADD然后选择EDIT

Rhel6-piranha配置文档

按如下如图配置并提交(按ACCEPT)设置Realserver

Rhel6-piranha配置文档

Rhel6-piranha配置文档

选择MONITORING SCRIPTS,无需设置直接提交(按ACCEPT)

Rhel6-piranha配置文档

选择REAL SERVER并选择(DE)ACTIVE将所有的Realserver激活

Rhel6-piranha配置文档

选择VIRTUAL SERVERS并选择(DE)ACTIVE将其激活

Rhel6-piranha配置文档

注:所有的操作都将自动写如server19的/etc/sysconfig/ha/lvs.cf中.

[root@server19
ha]# scp lvs.cf root@192.168.122.25:/etc/sysconfig/ha/

以下步骤在server63上实施:

[root@server63
~]# yum install arptables_jf httpd -y

[root@server63
~]# arptables -A IN -d 192.168.122.178 -j DROP

[root@server63
~]# arptables -A OUT -s 192.168.122.178 -j mangle --mangle-ip-s
192.168.122.163

[root@server63
~]# /etc/init.d/arptables_jf save

[root@server63
~]# ifconfig eth0:0 192.168.122.178 netmask 255.255.255.255 up

[root@server63
~]# echo `hostname` > /var/www/html/index.html

[root@server63
~]# /etc/init.d/httpd start

以下步骤在server93上实施:

[root@server93
~]# yum install arptables_jf httpd -y

[root@server93
~]# arptables -A IN -d 192.168.122.178 -j DROP

[root@server93
~]# arptables -A OUT -s 192.168.122.178 -j mangle --mangle-ip-s
192.168.122.193

[root@server93
~]# /etc/init.d/arptables_jf save

[root@server93
~]# ifconfig eth0:0 192.168.122.178 netmask 255.255.255.255 up

[root@server93
~]# echo `hostname` > /var/www/html/index.html

[root@server93
~]# /etc/init.d/httpd start

以下步骤在server19server25上实施:

[root@server19
~]# /etc/init.d/pulse start

测试:

piranha启动后,会在主备server19产生一个eth0:1接口,当主备的宕掉(例如:piranha关闭,网断,内核崩溃)后,会由备用的server25接管,充当调度器.

上一篇:设计模式理解(八)结构型——装饰者模式(记得加上UML图 --- 未完)


下一篇:mysql以ROOT权限提权方法