Master-Slave deployment
vithun.v Feb 1, 2012 7:40 AMI wanted to try out my application in master slave mode. i.e., one active deployment would be running at once.
I tried to google for the document that speaks about this particular configuration in JBOSS AS 7.1, I couldn't find one. So i made an assumption that, starting two servers, one with host-master.xml and the other with host-slave.xml would do the trick.
I started the servers with the following host configuration (just modified the original file a bit, blue highlight shows the diff)
host-master.xml
<?xml version='1.0' encoding='UTF-8'?>
<host name="master" xmlns="urn:jboss:domain:1.1">
<management>
<security-realms>
<security-realm name="ManagementRealm">
<authentication>
<properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>
</authentication>
</security-realm>
</security-realms>
<management-interfaces>
<native-interface security-realm="ManagementRealm">
<socket interface="management" port="9999"/>
</native-interface>
<http-interface security-realm="ManagementRealm">
<socket interface="management" port="9990"/>
</http-interface>
</management-interfaces>
</management>
<domain-controller>
<local/>
</domain-controller>
<interfaces>
<interface name="management">
<inet-address value="192.168.27.220"/>
</interface>
</interfaces>
</host>
host-slave.xml
<?xml version='1.0' encoding='UTF-8'?>
<host name="slave1" xmlns="urn:jboss:domain:1.1">
<management>
<security-realms>
<security-realm name="ManagementRealm">
<authentication>
<properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>
</authentication>
<server-identities>
<secret value="YWRtaW4xMjM="/>
</server-identities>
</security-realm>
</security-realms>
<management-interfaces>
<native-interface security-realm="ManagementRealm">
<socket interface="management" port="9999"/>
</native-interface>
</management-interfaces>
</management>
<domain-controller>
<remote host="192.168.27.220" port="9999" security-realm="ManagementRealm"/>
</domain-controller>
<interfaces>
<interface name="management">
<inet-address value="192.168.27.149"/>
</interface>
<interface name="public">
<inet-address value="127.0.0.1"/>
</interface>
</interfaces>
<jvms>
<jvm name="default">
<heap size="64m" max-size="256m"/>
</jvm>
</jvms>
<servers>
<server name="server-one" group="main-server-group"/>
<server name="server-two" group="other-server-group">
<!-- server-two avoids port conflicts by incrementing the ports in
the default socket-group declared in the server-group -->
<socket-bindings port-offset="150"/>
</server>
</servers>
</host>
I started the server without any content in the servers and then after the servers started, i deployed a WAR file using jboss-admin console. I could see that the content, though added on both machines, its active only in slave and master doesn't take charge when I trun the slave down.
Was the assumption i made wrong. I just wanted it to behave like how it would if i had deployed in deploy-hasingleton folder in AS 5.
Sorry if I'd done anything stupid.
If would be really happy to know when i can see the completed cluster document online .