大家好,又见面了,我是你们的朋友全栈君。[kiosk@foundation15 Desktop]$ rht-vmctl start all
Starting node1.
Starting node2.
Starting node3.
Starting node4.
Starting lvs1.
Starting lvs2.
[kiosk@foundation15 Desktop]$ rht-vmctl start all
Error: node1 not started (is already running)
Error: node2 not started (is already running)
Error: node3 not started (is already running)
Error: node4 not started (is already running)
Error: lvs1 not started (is already running)
Error: lvs2 not started (is already running)
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
root@172.25.15.14’s password:
Last login: Thu Jul 2 16:02:25 2015 from 172.25.0.250
[root@rhel6 ~]# wget http://classroom.example.com/content/ula/cluster/clusterinit.sh
–2016-09-30 09:51:04– http://classroom.example.com/content/ula/cluster/clusterinit.sh
Resolving classroom.example.com… 172.25.254.254
Connecting to classroom.example.com|172.25.254.254|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 2550 (2.5K) [application/x-sh]
Saving to: “clusterinit.sh”
100%[======================================>] 2,550 –.-K/s in 0s
2016-09-30 09:51:04 (246 MB/s) – “clusterinit.sh” saved [2550/2550]
[root@rhel6 ~]# bash clusterinit.sh lvs1-f15.example.com
Stopping NetworkManager daemon: [ OK ]
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
[root@rhel6 ~]# reboot
Broadcast message from root@lvs1-f15.example.com
(/dev/pts/0) at 9:51 …
The system is going down for reboot NOW!
[root@rhel6 ~]# Connection to 172.25.15.14 closed by remote host.
Connection to 172.25.15.14 closed.
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
\root@172.25.15.14’s password:
Last login: Fri Sep 30 09:50:08 2016 from 172.25.15.250
[root@lvs1-f15 ~]# vim /etc/sysctl.conf
[root@lvs1-f15 ~]# sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
error: “net.bridge.bridge-nf-call-ip6tables” is an unknown key
error: “net.bridge.bridge-nf-call-iptables” is an unknown key
error: “net.bridge.bridge-nf-call-arptables” is an unknown key
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
[root@lvs1-f15 ~]# yum groupinstall “load Balancer”
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
HighAvailability | 3.9 kB 00:00
HighAvailability/primary_db | 43 kB 00:00
LoadBalancer | 3.9 kB 00:00
LoadBalancer/primary_db | 7.0 kB 00:00
ResilientStorage | 3.9 kB 00:00
ResilientStorage/primary_db | 47 kB 00:00
ScalableFileSystem | 3.9 kB 00:00
ScalableFileSystem/primary_db | 6.8 kB 00:00
server | 3.9 kB 00:00
server/primary_db | 3.1 MB 00:00
Setting up Group Process
HighAvailability/group_gz | 4.0 kB 00:00
LoadBalancer/group_gz | 2.1 kB 00:00
ResilientStorage/group_gz | 5.6 kB 00:00
ScalableFileSystem/group_gz | 2.7 kB 00:00
server/group_gz | 204 kB 00:00
Resolving Dependencies
–> Running transaction check
—> Package ipvsadm.x86_64 0:1.26-2.el6 will be installed
—> Package piranha.x86_64 0:0.8.6-4.el6 will be installed
–> Processing Dependency: php for package: piranha-0.8.6-4.el6.x86_64
–> Running transaction check
—> Package php.x86_64 0:5.3.3-26.el6 will be installed
–> Processing Dependency: php-common(x86-64) = 5.3.3-26.el6 for package: php-5.3.3-26.el6.x86_64
–> Processing Dependency: php-cli(x86-64) = 5.3.3-26.el6 for package: php-5.3.3-26.el6.x86_64
–> Running transaction check
—> Package php-cli.x86_64 0:5.3.3-26.el6 will be installed
—> Package php-common.x86_64 0:5.3.3-26.el6 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
ipvsadm x86_64 1.26-2.el6 LoadBalancer 41 k
piranha x86_64 0.8.6-4.el6 LoadBalancer 624 k
Installing for dependencies:
php x86_64 5.3.3-26.el6 server 1.1 M
php-cli x86_64 5.3.3-26.el6 server 2.2 M
php-common x86_64 5.3.3-26.el6 server 525 k
Transaction Summary
================================================================================
Install 5 Package(s)
Total download size: 4.5 M
Installed size: 18 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): ipvsadm-1.26-2.el6.x86_64.rpm | 41 kB 00:00
(2/5): php-5.3.3-26.el6.x86_64.rpm | 1.1 MB 00:00
(3/5): php-cli-5.3.3-26.el6.x86_64.rpm | 2.2 MB 00:00
(4/5): php-common-5.3.3-26.el6.x86_64.rpm | 525 kB 00:00
(5/5): piranha-0.8.6-4.el6.x86_64.rpm | 624 kB 00:00
——————————————————————————–
Total 4.6 MB/s | 4.5 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-common-5.3.3-26.el6.x86_64 1/5
Installing : php-cli-5.3.3-26.el6.x86_64 2/5
Installing : php-5.3.3-26.el6.x86_64 3/5
Installing : ipvsadm-1.26-2.el6.x86_64 4/5
Installing : piranha-0.8.6-4.el6.x86_64 5/5
HighAvailability/productid | 1.7 kB 00:00
LoadBalancer/productid | 1.7 kB 00:00
ResilientStorage/productid | 1.7 kB 00:00
ScalableFileSystem/productid | 1.8 kB 00:00
server/productid | 1.7 kB 00:00
Verifying : piranha-0.8.6-4.el6.x86_64 1/5
Verifying : php-5.3.3-26.el6.x86_64 2/5
Verifying : php-cli-5.3.3-26.el6.x86_64 3/5
Verifying : php-common-5.3.3-26.el6.x86_64 4/5
Verifying : ipvsadm-1.26-2.el6.x86_64 5/5
Installed:
ipvsadm.x86_64 0:1.26-2.el6 piranha.x86_64 0:0.8.6-4.el6
Dependency Installed:
php.x86_64 0:5.3.3-26.el6 php-cli.x86_64 0:5.3.3-26.el6
php-common.x86_64 0:5.3.3-26.el6
Complete!
[root@lvs1-f15 ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.25.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1004 0 0 eth2
0.0.0.0 172.25.15.254 0.0.0.0 UG 0 0 0 eth0
[root@lvs1-f15 ~]# cat /proc/sys/net/ipv4/ip_forward
1
[root@lvs1-f15 ~]# service piranha-gui start
Starting piranha-gui: [ OK ]
[root@lvs1-f15 ~]# chkconfig piranha-gui on
[root@lvs1-f15 ~]# piranha-passwd
New Password:
Verify:
Adding password for user piranha
[root@lvs1-f15 ~]# yum -y install links
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package elinks.x86_64 0:0.12-0.21.pre5.el6_3 will be installed
–> Processing Dependency: libnss_compat_ossl.so.0()(64bit) for package: elinks-0.12-0.21.pre5.el6_3.x86_64
–> Running transaction check
—> Package nss_compat_ossl.x86_64 0:0.9.6-1.el6 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
elinks x86_64 0.12-0.21.pre5.el6_3 server 838 k
Installing for dependencies:
nss_compat_ossl x86_64 0.9.6-1.el6 server 34 k
Transaction Summary
================================================================================
Install 2 Package(s)
Total download size: 871 k
Installed size: 2.6 M
Downloading Packages:
(1/2): elinks-0.12-0.21.pre5.el6_3.x86_64.rpm | 838 kB 00:00
(2/2): nss_compat_ossl-0.9.6-1.el6.x86_64.rpm | 34 kB 00:00
——————————————————————————–
Total 2.8 MB/s | 871 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : nss_compat_ossl-0.9.6-1.el6.x86_64 1/2
Installing : elinks-0.12-0.21.pre5.el6_3.x86_64 2/2
Verifying : nss_compat_ossl-0.9.6-1.el6.x86_64 1/2
Verifying : elinks-0.12-0.21.pre5.el6_3.x86_64 2/2
Installed:
elinks.x86_64 0:0.12-0.21.pre5.el6_3
Dependency Installed:
nss_compat_ossl.x86_64 0:0.9.6-1.el6
Complete!
[root@lvs1-f15 ~]# vim /bin/testlink.sh
[root@lvs1-f15 ~]# bash /bin/testlink.sh 192.168.122.41
ok
[root@lvs1-f15 ~]# chmod +x /bin/testlink.sh
[root@lvs1-f15 ~]# scp /bin/testlink.sh lvs2-f15:/bin
The authenticity of host ‘lvs2-f15 (172.25.15.15)’ can’t be established.
RSA key fingerprint is cf:7c:26:aa:4f:41:7b:21:5e:09:ce:8a:15:2c:97:32.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘lvs2-f15,172.25.15.15’ (RSA) to the list of known hosts.
root@lvs2-f15’s password:
testlink.sh 100% 98 0.1KB/s 00:00
[root@lvs1-f15 ~]# ll /bin/testlink.sh
-rwxr-xr-x 1 root root 98 Sep 30 10:55 /bin/testlink.sh
[root@lvs1-f15 ~]# scp /etc/sysconfig/ha/lvs.cf lvs2-f15:/etc/sysconfig/ha/lvs.cf
root@lvs2-f15’s password:
lvs.cf 100% 977 1.0KB/s 00:00
[root@lvs1-f15 ~]# service pulse start
Starting pulse: [ OK ]
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.15.100:80 wlc
-> 192.168.122.40:80 Masq 1 0 0
-> 192.168.122.41:80 Masq 1 0 0
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.15.100:80 wlc
-> 192.168.122.40:80 Masq 1 0 0
-> 192.168.122.41:80 Masq 1 0 0
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.15.100:80 wlc
-> 192.168.122.40:80 Masq 1 0 0
-> 192.168.122.41:80 Masq 1 0 0
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.15.100:80 wlc
-> 192.168.122.40:80 Masq 1 0 0
-> 192.168.122.41:80 Masq 1 0 0
[root@lvs1-f15 ~]# poweroff
[root@lvs1-f15 ~]#
Broadcast message from root@lvs1-f15.example.com
(/dev/pts/0) at 10:59 …
The system is going down for power off NOW!
Connection to 172.25.15.14 closed by remote host.
Connection to 172.25.15.14 closed.
[kiosk@foundation15 Desktop]$ rht-vmctl start all
Error: node1 not started (is already running)
Error: node2 not started (is already running)
Error: node3 not started (is already running)
Error: node4 not started (is already running)
Starting lvs1.
Error: lvs2 not started (is already running)
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
^[[A^[[Assh: connect to host 172.25.15.14 port 22: Connection refused
[kiosk@foundation15 Desktop]$ rht-vmctl start all^C
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
root@172.25.15.14’s password:
Last login: Fri Sep 30 09:52:38 2016 from 172.25.15.250
[root@lvs1-f15 ~]# service pulse start
Starting pulse: [ OK ]
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@lvs1-f15 ~]# service pulse stop
Shutting down pulse: [ OK ]
[root@lvs1-f15 ~]# service pulse start
Starting pulse: [ OK ]
[root@lvs1-f15 ~]# ll /etc/sysconfig/ha/lvs.cf
-rw-rw-r– 1 root piranha 977 Sep 30 10:57 /etc/sysconfig/ha/lvs.cf
[root@lvs1-f15 ~]# service pulse start
Starting pulse:
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.15.100:80 wlc
-> 192.168.122.40:80 Masq 1 0 0
-> 192.168.122.41:80 Masq 1 0 0
[root@lvs1-f15 ~]# service pulse stop
Shutting down pulse: [ OK ]
[root@lvs1-f15 ~]# service pulse start
Starting pulse: [ OK ]
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.15.100:80 wlc
-> 192.168.122.40:80 Masq 1 0 0
-> 192.168.122.41:80 Masq 1 0 0
[root@lvs1-f15 ~]# reboot
[root@lvs1-f15 ~]#
Broadcast message from root@lvs1-f15.example.com
(/dev/pts/0) at 11:06 …
The system is going down for reboot NOW!
Connection to 172.25.15.14 closed by remote host.
Connection to 172.25.15.14 closed.
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
root@172.25.15.14’s password:
Last login: Fri Sep 30 11:00:20 2016 from 172.25.15.250
[root@lvs1-f15 ~]# service pulse stop
Shutting down pulse: [FAILED]
[root@lvs1-f15 ~]# rm /etc/sysconfig/ha/lvs.cf
rm: remove regular file `/etc/sysconfig/ha/lvs.cf’? y
[root@lvs1-f15 ~]# service piranha-gui restart
[root@lvs1-f15 ~]# touch /etc/sysconfig/ha/lvs.cf
[root@lvs1-f15 ~]# service piranha-gui restart
Shutting down piranha-gui: [ OK ]
Starting piranha-gui: [ OK ]
[root@lvs1-f15 ~]# ll /etc/sysconfig/ha/lvs.cf
-rw-r–r– 1 root root 977 Sep 30 11:11 /etc/sysconfig/ha/lvs.cf
[root@lvs1-f15 ~]# chuser -g piranha /etc/sysconfig/ha/lvs.cf
-bash: chuser: command not found
[root@lvs1-f15 ~]# chown root:piranha /etc/sysconfig/ha/lvs.cf
[root@lvs1-f15 ~]# service piranha-gui restart
Shutting down piranha-gui: [ OK ]
Starting piranha-gui: [ OK ]
[root@lvs1-f15 ~]# chmod 664 /etc/sysconfig/ha/lvs.cf
[root@lvs1-f15 ~]# service piranha-gui restart
Shutting down piranha-gui: [ OK ]
Starting piranha-gui: [ OK ]
[root@lvs1-f15 ~]# scp /etc/sysconfig/ha/lvs.cf lvs2-f15:/etc/sysconfig/ha/lvs.cf
root@lvs2-f15’s password:
lvs.cf 100% 977 1.0KB/s 00:00
[root@lvs1-f15 ~]# service pulse start
Starting pulse: [ OK ]
[root@lvs1-f15 ~]# ipvsadm -L -m
Illegal ‘forwarding-method’ option with the ‘list’ command
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.15.100:80 wlc
-> 192.168.122.40:80 Masq 1 0 0
-> 192.168.122.41:80 Masq 1 0 0
[root@lvs1-f15 ~]# poweroff
[root@lvs1-f15 ~]#
Broadcast message from root@lvs1-f15.example.com
(/dev/pts/0) at 11:18 …
The system is going down for power off NOW!
Connection to 172.25.15.14 closed by remote host.
Connection to 172.25.15.14 closed.
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
^[[A^[[A^C
[kiosk@foundation15 Desktop]$ rht-vmctl start all
Error: node1 not started (is already running)
Error: node2 not started (is already running)
Error: node3 not started (is already running)
Error: node4 not started (is already running)
Starting lvs1.
Error: lvs2 not started (is already running)
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
ssh: connect to host 172.25.15.14 port 22: Connection refused
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
root@172.25.15.14’s password:
Last login: Fri Sep 30 11:07:07 2016 from 172.25.15.250
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@lvs1-f15 ~]# service pulse start
Starting pulse: [ OK ]
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.15.100:80 wlc
-> 192.168.122.40:80 Masq 1 0 0
-> 192.168.122.41:80 Masq 1 0 0
[root@lvs1-f15 ~]# service pulse stop
Shutting down pulse: [ OK ]
[root@lvs1-f15 ~]# service pulse restart
Shutting down pulse: [FAILED]
Starting pulse: [ OK ]
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 172.25.15.100:80 wlc
-> 192.168.122.40:80 Masq 1 0 0
-> 192.168.122.41:80 Masq 1 0 0
[root@lvs1-f15 ~]# poweroff
[root@lvs1-f15 ~]#
Broadcast message from root@lvs1-f15.example.com
(/dev/pts/0) at 11:29 …
The system is going down for power off NOW!
Connection to 172.25.15.14 closed by remote host.
Connection to 172.25.15.14 closed.
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
^[[A^C
[kiosk@foundation15 Desktop]$ rht-vmctl start all
Error: node1 not started (is already running)
Error: node2 not started (is already running)
Error: node3 not started (is already running)
Error: node4 not started (is already running)
Starting lvs1.
Error: lvs2 not started (is already running)
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
root@172.25.15.14’s password:
Last login: Fri Sep 30 11:21:06 2016 from 172.25.15.250
[root@lvs1-f15 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth2
[root@lvs1-f15 ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down interface eth2: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Determining if ip address 172.25.15.14 is already in use for device eth0…
[ OK ]
[root@lvs1-f15 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:00:0F:0E
inet addr:172.25.15.14 Bcast:172.25.15.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe00:f0e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:671 errors:0 dropped:0 overruns:0 frame:0
TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:62821 (61.3 KiB) TX bytes:18449 (18.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 b) TX bytes:240 (240.0 b)
[root@lvs1-f15 ~]# ifconfig eth0:0 192.168.115.44 netmask 255.255.255.0
[root@lvs1-f15 ~]# service pirnaha restart
pirnaha: unrecognized service
[root@lvs1-f15 ~]# service pirnaha-gui restart
pirnaha-gui: unrecognized service
[root@lvs1-f15 ~]# service piranha-gui restart
Shutting down piranha-gui: [ OK ]
Starting piranha-gui: [ OK ]
[root@lvs1-f15 ~]# service pulse restart
Shutting down pulse: [FAILED]
Starting pulse: [ OK ]
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@lvs1-f15 ~]# ping 172.25.0.254
PING 172.25.0.254 (172.25.0.254) 56(84) bytes of data.
64 bytes from 172.25.0.254: icmp_seq=1 ttl=64 time=0.697 ms
64 bytes from 172.25.0.254: icmp_seq=2 ttl=64 time=0.670 ms
64 bytes from 172.25.0.254: icmp_seq=3 ttl=64 time=0.716 ms
^C
— 172.25.0.254 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2303ms
rtt min/avg/max/mdev = 0.670/0.694/0.716/0.028 ms
[root@lvs1-f15 ~]# arp -an |grep 254
? (172.25.15.254) at 52:54:00:00:00:fe [ether] on eth0
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@lvs1-f15 ~]# service pulse restart
Shutting down pulse: [ OK ]
Starting pulse: [ OK ]
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@lvs1-f15 ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@lvs1-f15 ~]# ping 192.168.115.40
PING 192.168.115.40 (192.168.115.40) 56(84) bytes of data.
64 bytes from 192.168.115.40: icmp_seq=1 ttl=64 time=0.489 ms
64 bytes from 192.168.115.40: icmp_seq=2 ttl=64 time=0.606 ms
^C
— 192.168.115.40 ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 1983ms
rtt min/avg/max/mdev = 0.489/0.547/0.606/0.063 ms
[root@lvs1-f15 ~]# ping 192.168.115.41
PING 192.168.115.41 (192.168.115.41) 56(84) bytes of data.
64 bytes from 192.168.115.41: icmp_seq=1 ttl=64 time=0.628 ms
64 bytes from 192.168.115.41: icmp_seq=2 ttl=64 time=0.483 ms
64 bytes from 192.168.115.41: icmp_seq=3 ttl=64 time=0.491 ms
^C
— 192.168.115.41 ping statistics —
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
root@172.25.15.14’s password:
Last login: Fri Sep 30 12:25:27 2016 from 172.25.15.250
[root@lvs1-f15 ~]# ssh 192.168.115.40
The authenticity of host ‘192.168.115.40 (192.168.115.40)’ can’t be established.
RSA key fingerprint is cf:7c:26:aa:4f:41:7b:21:5e:09:ce:8a:15:2c:97:32.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.115.40’ (RSA) to the list of known hosts.
root@192.168.115.40’s password:
Last login: Fri Sep 30 12:12:15 2016 from 172.25.15.250
[root@node1-f15 ~]# cd /tmp
[root@node1-f15 tmp]# vim ip.sh
[root@node1-f15 tmp]# vim ip.sh
[root@node1-f15 tmp]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.115.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
[root@node1-f15 tmp]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.115.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
[root@node1-f15 tmp]# route add default gw 172.25.0.254
SIOCADDRT: No such process
[root@node1-f15 tmp]# bash ip sh
/sbin/ip: /sbin/ip: cannot execute binary file
[root@node1-f15 tmp]# bash ip.sh
[root@node1-f15 tmp]# route add default gw 172.25.0.254
SIOCADDRT: No such process
[root@node1-f15 tmp]# ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:00:0F:0A
inet addr:192.168.115.40 Bcast:192.168.115.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe00:f0a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:27673 errors:0 dropped:0 overruns:0 frame:0
TX packets:2129 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5789156 (5.5 MiB) TX bytes:212066 (207.0 KiB)
eth0:1 Link encap:Ethernet HWaddr 52:54:00:00:0F:0A
inet addr:172.25.15.100 Bcast:172.25.15.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:960 (960.0 b) TX bytes:960 (960.0 b)
[root@node1-f15 tmp]# bash ip.sh
SIOCADDRT: File exists
[root@node1-f15 tmp]# route add default gw 172.25.0.254
SIOCADDRT: No such process
[root@node1-f15 tmp]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.25.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.115.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 172.25.15.254 0.0.0.0 UG 0 0 0 eth0
[root@node1-f15 tmp]# arp -an
? (192.168.115.44) at 52:54:00:00:0f:0e [ether] on eth0
? (172.25.15.254) at 52:54:00:00:00:fe [ether] PERM on eth0
[root@node1-f15 tmp]# cat ip.sh
#!/bin/bash
VIP=172.25.15.100
VIPCAST=172.25.15.255
RIP=192.168.115.40
DGW=172.25.15.254
DGWMAC=”52:54:00:00:00:fe”
arptables -F
arptables -A IN -d $VIP -j DROP
arptables -A OUT -s $VIP -j mangle –mangle-ip-s $RIP
/sbin/ifconfig eth0:1 $VIP broadcast $VIPCAST netmask 255.255.255.0 up
arp -s $DGW $DGWMAC
/sbin/route add default gw $DGW
[root@node1-f15 tmp]# service status httpd
status: unrecognized service
[root@node1-f15 tmp]# service httpd status
httpd is stopped
[root@node1-f15 tmp]# service httpd start
Starting httpd: [ OK ]
[root@node1-f15 tmp]# echo node1-f15 > /var/www/html/index.html
[root@node1-f15 tmp]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@node1-f15 tmp]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.25.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.115.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 172.25.15.254 0.0.0.0 UG 0 0 0 eth0
[root@node1-f15 tmp]# route add default gw 172.25.15.254
SIOCADDRT: File exists
[root@node1-f15 tmp]#
[kiosk@foundation15 Desktop]$ ssh root@172.25.15.14
root@172.25.15.14’s password:
Last login: Fri Sep 30 12:34:26 2016 from 172.25.15.250
[root@lvs1-f15 ~]# ssh 192.168.115.41
^[[Assh: connect to host 192.168.115.41 port 22: No route to host
[root@lvs1-f15 ~]# ssh 192.168.115.41^C
[root@lvs1-f15 ~]# ssh root@192.168.115.41
ssh: connect to host 192.168.115.41 port 22: No route to host
[root@lvs1-f15 ~]# ssh root@192.168.115.41
ssh: connect to host 192.168.115.41 port 22: No route to host
[root@lvs1-f15 ~]# ssh 192.168.115.41
ssh: connect to host 192.168.115.41 port 22: No route to host
[root@lvs1-f15 ~]# ping 192.168.115.41
PING 192.168.115.41 (192.168.115.41) 56(84) bytes of data.
From 192.168.115.44 icmp_seq=2 Destination Host Unreachable
From 192.168.115.44 icmp_seq=3 Destination Host Unreachable
From 192.168.115.44 icmp_seq=4 Destination Host Unreachable
^C
— 192.168.115.41 ping statistics —
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4829ms
pipe 3
[root@lvs1-f15 ~]# ping 192.168.115.41
PING 192.168.115.41 (192.168.115.41) 56(84) bytes of data.
64 bytes from 192.168.115.41: icmp_seq=1 ttl=64 time=0.658 ms
64 bytes from 192.168.115.41: icmp_seq=2 ttl=64 time=0.510 ms
64 bytes from 192.168.115.41: icmp_seq=3 ttl=64 time=0.544 ms
^C
— 192.168.115.41 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2366ms
rtt min/avg/max/mdev = 0.510/0.570/0.658/0.069 ms
[root@lvs1-f15 ~]# ssh 192.168.115.41
The authenticity of host ‘192.168.115.41 (192.168.115.41)’ can’t be established.
RSA key fingerprint is cf:7c:26:aa:4f:41:7b:21:5e:09:ce:8a:15:2c:97:32.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.115.41’ (RSA) to the list of known hosts.
root@192.168.115.41’s password:
Last login: Fri Sep 30 12:21:56 2016 from 172.25.15.250
[root@node2-f15 ~]# cd /tmp
[root@node2-f15 tmp]# vim ip.sh
[root@node2-f15 tmp]# bash ip.sh
[root@node2-f15 tmp]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.25.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.115.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 172.25.15.254 0.0.0.0 UG 0 0 0 eth0
[root@node2-f15 tmp]# service httpd start
Starting httpd: [ OK ]
[root@node2-f15 tmp]# echo node2-f15 > /var/www/html/index.html
[root@node2-f15 tmp]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@node2-f15 tmp]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.25.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.115.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 172.25.15.254 0.0.0.0 UG 0 0 0 eth0
[root@node2-f15 tmp]# route add default gw 172.25.15.254
SIOCADDRT: File exists
[root@node2-f15 tmp]#
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/163785.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...