Mindmajix

Clustering with server nodes on the same machine

Clustering with server nodes on the same machine

The second variant of the standalone configuration comes into picture when your server nodes are located (all or some of them) on the same machine. This scenario applies generally when you are scaling up your architecture by adding more hardware resources to your system.

Configuring server nodes on the same machine obviously requires duplicating your AS7 distribution on your filesystem. Then, in order to avoid a port conflict between server distributions, you have to choose between two options:

1. Defining multiple IP address on the same machine.
2. Defining a port offset for each server distribution.

This is also known as multihoming and requires some O/S tweaks to get working. Obviously, each operating system uses different approaches to achieve it, which may also vary depending on its version. Being out of the scope of this book to illustrate all possible ways to configure multihoming, we will just show two common scenarios.

When using a Linux box, just issue an ifconfig command to activate each IP address:

# ifconfig eth0 192.168.10.1 up
# ifconfig eth1 192.168.10.2 up

When using a Windows machine, you have to reach, from the network configuration panel, to your Ethernet card’s TCP-IP properties. Once there, click on the Advanced button and add all addresses that will be part of the cluster:

Screenshot_31

Once you have set up your network interface correctly, it’s time to update your standalone-ha.xml file. Follow the same steps exposed for multiple host cluster (for each server distribution, reach to the interfaces section, and within the nested interface element insert the IP address of the standalone server).

In the end, the first server distribution will be bound to the IP Address 192.168.10.1 and the second one to 192.168.10.2. (as an alternative, use the –b and –bmanagement switches exposed in the earlier section). The following diagram depicts this scenario:

Screenshot_32

Configuring multihoming is not always a viable choice because it requires some degree of administration experience or maybe because you are lacking in permissions on your machine, in which case, you could still set up a clustering configuration by defining a port offset for your each cluster member.

By defining a port offset for each server, the entire default server binding interfaces will shift to a fixed amount, and hence you will not have two servers engaging the same IP address and the same port.

Screenshot_33

When using this configuration, you can bind each server network address to the same IP address. So, for all your server distributions, we will configure the standalone-

ha.xml as follows:
<interfaces>
<interface name=”management”>
<inet-address value=”192.168.10.1″/>
</interface>
<interface name=”public”>
<inet-address value=”192.168.10.1″/>
</interface>
</interfaces>
Then, the first server will use the default socket binding ports:
<!–server 1 UNCHANGED –>
<socket-binding-group name=”standard-sockets” defaultinterface=”
public”>
. . . . . .
</socket-binding-group>
While the second one will specify a port-offset element of 150:
<!–server 2 –>
<socket-binding-group name=”standard-sockets” defaultinterface=”
public” port-offset=”150″>
. . . . . .
</socket-binding-group>
Also, in order to avoid port conflicts, you have to choose a different port for the management interfaces. Again, we will leave the default values for the first server:
<!–server 1 UNCHANGED –>
<socket-binding-group name=”standard-sockets” defaultinterface=”
public” >
. . . . . . .
<socket-binding name=”management-native”
interface=”management” port=”9999″/>
<socket-binding name=”management-http” interface=”management”
port=”9990″/>
. . . . . . .
</socket-binding-group>
On the second server distribution, we will engage a different port:
<!–server 2 –>
<socket-binding-group name=”standard-sockets” defaultinterface=”
public” port-offset=”150″>
. . . . . . .
<socket-binding name=”management-native”
interface=”management” port=”19999″/>
<socket-binding name=”management-http” interface=”management”

port=”19990″/>
. . . . . . .
</socket-binding-group>
Your cluster configuration is complete. Verify it by starting each server distribution by passing it as an argument to the configuration file.
standalone.bat –server-config=standalone-ha.xml


0 Responses on Clustering with server nodes on the same machine"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.