4.4. Viewing virtual IP addresses
Each IPaddr2 resource sets a virtual IP address that clients use to request access to a service. If the Controller node with that IP address fails, the IPaddr2 resource reassigns the IP address to a different Controller node.
Show all virtual IP addresses
Run the pcs resource show
command with the --full
option to display all resources that use the VirtualIP
type:
$ sudo pcs resource show --full
The following example output shows each Controller node that is currently set to listen to a particular virtual IP address:
ip-10.200.0.6 (ocf::heartbeat:IPaddr2): Started overcloud-controller-1 ip-192.168.1.150 (ocf::heartbeat:IPaddr2): Started overcloud-controller-0 ip-172.16.0.10 (ocf::heartbeat:IPaddr2): Started overcloud-controller-1 ip-172.16.0.11 (ocf::heartbeat:IPaddr2): Started overcloud-controller-0 ip-172.18.0.10 (ocf::heartbeat:IPaddr2): Started overcloud-controller-2 ip-172.19.0.10 (ocf::heartbeat:IPaddr2): Started overcloud-controller-2
Each IP address is initially attached to a specific Controller node. For example, 192.168.1.150
is started on overcloud-controller-0. However, if that Controller node fails, the IP address is reassigned to other Controller nodes in the cluster.
The following table describes the IP addresses in the example output and shows the original allocation of each IP address.
IP Address | Description | Allocated From |
---|---|---|
| Public IP address |
|
| Controller virtual IP address |
Part of the |
| Provides access to OpenStack API services on a Controller node |
|
| Storage virtual IP address that provides access to the Glance API and to Swift Proxy services |
|
| Provides access to Redis service on a Controller node |
|
| Provides access to storage management |
|
View a specific IP address
Run the pcs resource show
command.
$ sudo pcs resource show ip-192.168.1.150
Example output:
Resource: ip-192.168.1.150 (class=ocf provider=heartbeat type=IPaddr2) Attributes: ip=192.168.1.150 cidr_netmask=32 Operations: start interval=0s timeout=20s (ip-192.168.1.150-start-timeout-20s) stop interval=0s timeout=20s (ip-192.168.1.150-stop-timeout-20s) monitor interval=10s timeout=20s (ip-192.168.1.150-monitor-interval-10s)
View network information for a specific IP address
- Log in to the Controller node that is assigned to the IP address you want to view.
Run the
ip addr show
command to view network interface information.$ ip addr show vlan100
Example output:
9: vlan100: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN link/ether be:ab:aa:37:34:e7 brd ff:ff:ff:ff:ff:ff inet *192.168.1.151/24* brd 192.168.1.255 scope global vlan100 valid_lft forever preferred_lft forever inet *192.168.1.150/32* brd 192.168.1.255 scope global vlan100 valid_lft forever preferred_lft forever
Run the
netstat
command to show all processes that listen to the IP address.$ sudo netstat -tupln | grep "192.168.1.150.haproxy"
Example output:
tcp 0 0 192.168.1.150:8778 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:8042 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:9292 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:8080 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:80 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:8977 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:6080 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:9696 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:8000 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:8004 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:8774 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:5000 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:8776 0.0.0.0:* LISTEN 61029/haproxy tcp 0 0 192.168.1.150:8041 0.0.0.0:* LISTEN 61029/haproxy
注記Processes that are listening to all local addresses, such as
0.0.0.0
, are also available through192.168.1.150
. These processes includesshd
,mysqld
,dhclient
,ntpd
.
View port number assignments
Open the /var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg
file to see default port number assignments.
The following example shows the port numbers and the services that they listen to:
- TCP port 6080: nova_novncproxy
- TCP port 9696: neutron
- TCP port 8000: heat_cfn
- TCP port 80: horizon
- TCP port 8776: cinder
In this example, most services that are defined in the haproxy.cfg
file listen to the 192.168.1.150
IP address on all three Controller nodes. However, only the controller-0 node is listening externally to the 192.168.1.150
IP address.
Therefore, if the controller-0 node fails, HAProxy only needs to re-assign 192.168.1.150
to another Controller node and all other services will already be running on the fallback Controller node.