2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

14. IBM Cloud: VMware as a Service(VMWaaS) - 検証: VIP切り替えによる高可用性構成の確認(手動切替)

Last updated at Posted at 2024-03-17

1. はじめに

一般的には、高可用性構成を実現するために、VIPを使った切り替えを利用しているアプリケーションは今でも非常に多いと思われます。今回は、192.168.100.100/24というVIPをWEB01(192.168.100.3/24)/WEB02(192.168.100.4/24)というVM間で付け替えることで、WEB01障害時にVDC内部からもVDC外部からもVIPが構成されているVMにアクセスできることを確認したいと思います。

image.png

過去の記事はこちら。

2. NW構成

  • WEB01/WEB02にそれぞれ192.168.100.3/192.168.100.4を割り当てます。なお、WEB01/WEB02にはHTTPサーバーが構成されており、適切なFirewall制御がされているとします(この構成手順を書くのは本稿の本来の目的とズレるため省略)。
    image.png
    image.png
    image.png

  • Firewall構成。VDC外部からHTTP/HTTPSを許可します。VDC内部の通信はDistributed Routingが有効になっており、DFWを構成していないため、任意の通信が許可されています。
    image.png

  • NAT構成。VDC外部から150.xxx.xx.xx``192.168.100.100へのDNAT構成を追加します。
    image.png

3. VIPが割り振られていない状態でのアクセス検証

[root@jumpserver ~]# curl http://192.168.100.3
This is web01

[root@jumpserver ~]# curl http://192.168.100.4
This is web02

[root@jumpserver ~]# curl http://192.168.100.100
curl: (7) Failed to connect to 192.168.100.100 port 80: No route to host

syasuda@MacBook-Pro ~ % curl http://150.xxx.xx.xx
(応答なし)

pingで疎通が確認でき、Web Serverが起動しているにも関わらず、curl実行時にNo route to hostというエラーが出る場合は、OS firewallがフィルタリングしていないかどうかを疑ってみてください。

[root@jumpserver ~]# ping 192.168.100.3
PING 192.168.100.3 (192.168.100.3) 56(84) bytes of data.
64 bytes from 192.168.100.3: icmp_seq=1 ttl=64 time=0.334 ms
64 bytes from 192.168.100.3: icmp_seq=2 ttl=64 time=0.297 ms
64 bytes from 192.168.100.3: icmp_seq=3 ttl=64 time=0.309 ms
64 bytes from 192.168.100.3: icmp_seq=4 ttl=64 time=0.283 ms
^C
--- 192.168.100.3 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3089ms
rtt min/avg/max/mdev = 0.283/0.305/0.334/0.018 ms

[root@jumpserver ~]# curl http://192.168.100.3
curl: (7) Failed to connect to 192.168.100.3 port 80: No route to host

4. WEB01にVIPを割り振った状態でのアクセス検証

[root@web01 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:14:01:b8 brd ff:ff:ff:ff:ff:ff
    altname enp11s0
    inet 192.168.100.3/24 brd 192.168.100.255 scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe14:1b8/64 scope link
       valid_lft forever preferred_lft forever

[root@web01 ~]# ip a add 192.168.100.100/24 dev ens192

[root@web01 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:14:01:b8 brd ff:ff:ff:ff:ff:ff
    altname enp11s0
    inet 192.168.100.3/24 brd 192.168.100.255 scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet 192.168.100.100/24 scope global secondary ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe14:1b8/64 scope link
       valid_lft forever preferred_lft forever
[root@jumpserver ~]# curl http://192.168.100.3
This is web01

[root@jumpserver ~]# curl http://192.168.100.4
This is web02

[root@web01 ~]# curl http://192.168.100.100
This is web01

syasuda@MacBook-Pro ~ % curl http://150.xxx.xx.xx
This is web01

5. WEB02にVIPを割り振った状態でのアクセス検証

WEB01の電源を強制停止(WEB01に障害が発生したという想定)。
image.png

[root@web02 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:14:01:ba brd ff:ff:ff:ff:ff:ff
    altname enp11s0
    inet 192.168.100.4/24 brd 192.168.100.255 scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe14:1ba/64 scope link
       valid_lft forever preferred_lft forever
       
[root@web02 ~]# ip a add 192.168.100.100/24 dev ens192

[root@web02 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:14:01:ba brd ff:ff:ff:ff:ff:ff
    altname enp11s0
    inet 192.168.100.4/24 brd 192.168.100.255 scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet 192.168.100.100/24 scope global secondary ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe14:1ba/64 scope link
       valid_lft forever preferred_lft forever
[root@jumpserver ~]# curl http://192.168.100.3
curl: (7) Failed to connect to 192.168.100.3 port 80: No route to host

[root@jumpserver ~]# curl http://192.168.100.4
This is web02

[root@web01 ~]# curl http://192.168.100.100
This is web02

syasuda@MacBook-Pro ~ % curl http://150.xxx.xx.xx
This is web02
2
1
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?