Consultor Eletrônico



Kbase P122791: How to create and test a fault tolerant AppServer configuration using UDP
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/13/2010
Status: Verified

GOAL:

How to create and test a fault tolerant AppServer configuration using UDP

GOAL:

How to make a replicating NameServer using UDP

GOAL:

How to test a fault tolerant NameServer using UDP

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x
All Supported Operating Systems

FIX:

This method requires two hosts (host1 and host2) that are connected at the same subnet.
This will allow the use of a UDP broadcast address to address both hosts.
To determine if the two hosts are at the same subnet they have to have the same UDP broadcast address.

On Windows it is possible to get the UDP broadcast address using the ipconfig command:
C:\>ipconfig
Windows IP Configuration

Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : blabla.speak.com
IP Address. . . . . . . . . . . . : 192.128.3.24
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . : 192.128.3.1

To get the UDP broadcast address make Boolean NOT operation on the subnet mask bits, this will be for this example 0.0.255.255 then a Boolean OR between the IP address and this value.

192.128. 3. 24
OR 0. 0.255.255
_________________
192.128.255.255 = UDP broadcast address


On most UNIX platforms it is possible to get the UDP broadcast address directly using the netstat -i and ifconfig commands:


$ netstat -i
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
lo0 8232 loopback localhost 42318894 0 42318894 0 0 0
le0 1500 psc-bed oasis 163625559 16 3679807506 0 0 0
$ ifconfig le0
ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.128.5.30 netmask ffff0000 broadcast 192.128.255.255

Using the default settings on the ubroker.properties we use the UDP broadcast address and do the following:


1.- Start the AdminServer in host1 and host2 using:

proadsv -start

2.- Start NameServer in host1 and host2 using:

nsman -i NS1 -start
3.- Start the AppServer broker asbroker1 in host1 and host2 using:

asbman -i asbroker1 -start
4.- At the working directory on both host1 and host2 create a file named apps_prog.p with the following program.

DEFINE OUTPUT PARAMETER c AS CHARACTER INITIAL "".
OS-COMMAND SILENT hostname > hostname.txt.
&nbs.p;
INPUT FROM hostname.txt.
DO WHILE c = "":
IMPORT UNFORMATTED c.
END.
INPUT CLOSE.
RETURN

5.- In a remote client create a file named local_prog.p with the the following program:

DEFINE VARIABLE servhdl AS HANDLE.
DEFINE VARIABLE ret AS LOGICAL.
DEFINE VARIABLE C AS CHARACTER FORMAT "x(20)".
CREATE SERVER servhdl.
/* ASSIGN ret = servhdl:CONNECT("-S 5162 -H <UDP Broadcast Address> -AppService asbroker1"). */
ASSIGN ret = servhdl:CONNECT("-S 5162 -H 192.128.255.255 -AppService asbroker1").

IF ret THEN RUN apps_prog.p ON SERVER servhdl TRANSACTION DISTINCT (OUTPUT C).
DISPLAY C LABEL "Host: " WITH SIDE-LABELS.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.

ASSIGN ret = servhdl:DISCONNECT().
DELETE OBJECT servhdl.
QUIT.
6.- Run the local_prog.p program several times and shut or disconnect the AppServer in one of the host, then do the opposite you will see the name of the host that is answering the request. Use the pro command:

prowin32 -p local_prog.p.