操作系统 RedHat6.5 x64位 RedHat6.5 x64位 RedHat6.5 x64位 lvs Rs1 Rs2 主机名 外部IP(VIP) 内部IP(DIP) 软件 192.168.10.110 192.168.10.118 ipvsadm-1.26 192.168.10.112 192.168.10.118 Apache Server 192.168.10.113 192.168.10.118 Apache Server Windows 8 x64位 Lenovo-shihuan 192.168.10.105 无 浏览器
http://www.linuxvirtualserver.org/software/index.html ipvsadm官方下载地址 http://www.linuxvirtualserver.org/VS-IPTunneling.html IPTunnel官方文档 http://www.linuxvirtualserver.org/zh/index.html lvs中文社区
https://pkgs.org/centos-6/centos-x86_64/下载popt-static-1.13-7.el6.x86_64.rpm包 http://blog.chinaunix.net/uid-24668835-id-2598605.html LVS命令详解
首先给3台RedHat6.5的虚拟机的网卡全部是桥接,保证能用Windows的SecureCRT连接。 3台虚拟机全部关闭防火墙:
[root@lvsdr ~]# service iptables stop [root@lvsdr ~]# chkconfig iptables off
[root@rs1 ~]# service iptables stop [root@rs1 ~]# chkconfig iptables off [root@rs2 ~]# service iptables stop [root@rs2 ~]# chkconfig iptables off
关闭SELINUX
[root@lvsdr ~]# cd /etc/sysconfig [root@lvsdr sysconfig]# vi selinux
把SELINUX=enforcing 改为 SELINUX=disabled
[root@lvsdr rules.d]# cd /etc/sysconfig/network-scripts/ [root@lvsdr network-scripts]# vi ifcfg-eth0
[root@lvsdr network-scripts]# service network restart
设置3台虚拟机的hosts表 [root@lvsdr ~]# vi /etc/hosts
[root@lvsdr ~]# cd /etc/sysconfig [root@lvsdr sysconfig]# vi network
[root@rs1 ~]# vi /etc/hosts
[root@rs2 ~]# vi /etc/hosts
配置yum源并挂载iso光盘
[root@lvsdr ~]# mkdir –p /mnt/cdrom
[root@lvsdr ~]# mount -o loop /dev/cdrom /mnt/cdrom [root@lvsdr ~]# df –h
[root@lvsdr ~]# yum list|grep vsftpd
Rs1和rs2虚拟机用同样的命令进行挂载设置。
查看LVS虚拟机操作系统信息 [root@lvsdr ~]# lsb_release –a [root@lvsdr ~]# uname –a
在rs1和rs2主机上安装Apache Server2.2,笔者这里用RedHat6.5自带的包来安装 [root@rs1 ~]# yum -y install httpd [root@rs1 ~]# /etc/init.d/httpd start [root@rs1 ~]# ps -ef|grep httpd [root@rs1 ~]# /etc/init.d/httpd stop
[root@rs1 ~]# cat /etc/httpd/conf/httpd.conf |grep DocumentRoot
[root@rs1 ~]# cd /var/www/html [root@rs1 html]# vi index.html
RS1
1.1//EN\
[root@rs1 html]# vi /etc/httpd/conf/httpd.conf ? Listen 80
[root@rs1 html]# /usr/sbin/httpd –V
[root@rs1 html]# /etc/init.d/httpd start 在浏览器地址栏输入http://192.168.10.112/
在rs2主机上用同样的命令设置并测试Apache Server2.2.15 在浏览器地址栏输入http://192.168.10.113/
[root@lvsdr ~]# yum -y install popt-static kernel-devel make gcc gcc-c++ openssl-devel lftp libnl* popt*
libcom_err-devel-1.41.12-18.el6.x86_64 zlib-devel-1.2.3-29.el6.x86_64 keyutils-libs-devel-1.4-4.el6.x86_64 libsepol-devel-2.0.41-4.el6.x86_64 libselinux-devel-2.0.94-5.3.el6_4.1.x86_64 krb5-devel-1.10.3-10.el6_4.6.x86_64 openssl-devel-1.0.1e-15.el6.x86_64 libnl-devel-1.1.4-2.el6.x86_64 popt-devel-1.13-7.el6.x86_64 mpfr-2.4.1-6.el6.x86_64 cpp-4.4.7-4.el6.x86_64 ppl-0.10.2-11.el6.x86_64
cloog-ppl-0.15.7-1.2.el6.x86_64 gcc-4.4.7-4.el6.x86_64
libstdc++-devel-4.4.7-4.el6.x86_64 gcc-c++-4.4.7-4.el6.x86_64
[root@lvsdr ~]# cd /opt
[root@lvsdr opt]# rpm -ivh popt-static-1.13-7.el6.x86_64.rpm
[root@lvsdr opt]# cd /usr/local/src [root@lvsdr src]# ls ipvsadm-1.26.tar.gz
[root@lvsdr src]# tar -zxvf ipvsadm-1.26.tar.gz [root@lvsdr src]# cd ipvsadm-1.26
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新小学教育RedHat6.5安装配置LVS-IPTUNNEL 全文阅读和word下载服务。
相关推荐: