chat box....

Friday, April 12, 2013

mysqldump command for retreiving data from table with condition

mysqldump -t -uprasad -p*******  props base_properties  --where="snapshot_id in ('GA')" > sendTo.sql

Tuesday, April 2, 2013

Jboss Clustering

CREATING THE JBOSS CLUSTERS

Let us try configuring 2 nodes, say node1 and node2

• Create folders namely node1, node2 under jboss4.0.1sp1\server. (Create as many folders as the number nodes you require like node1, node2, node3 etc. Here we consider only 2)

• Copy the jboss4.0.1sp1\server\all to the folders node1, node2

• Create a folder named binding-manager under node1 and node2 folders

• Copy the folder jboss4.0.1sp1\docs\examples\binding-manager to jboss4.0.1sp1\server\node1\

• Rename the file to port-bindings.xml

• In the file jboss4.0.1sp1\server\node1\conf\jboss-service.xml, uncomment the block

<mbean code="org.jboss.services.binding.ServiceBindingManager"
name="jboss.system:service=ServiceBindingManager">
<attribute name="ServerName">ports-01</attribute>
<attribute name="StoreURL">some file </attribute>
<attribute name="StoreFactoryClassName">
org.jboss.services.binding.XMLServicesStoreFactory
</attribute>
</mbean>


• Change the StoreURL as follows
<attribute name="StoreURL">file:../server/node1/binding-manager/port-bindings.xml</attribute>

• Ensure that the following is uncommented <server name="ports-01">

• Copy the folder jboss4.0.1sp1\docs\examples\binding-manager to jboss4.0.1sp1\server\node2\

• Rename the file to port-bindings.xml

• Ensure that the following is uncommented <server name="ports-02">

• In the file jboss4.0.1sp1\server\node2\conf\jboss-service.xml, uncomment the block

<mbean code="org.jboss.services.binding.ServiceBindingManager"
name="jboss.system:service=ServiceBindingManager">
<attribute name="ServerName">ports-01</attribute>
<attribute name="StoreURL">some file </attribute>
<attribute name="StoreFactoryClassName">
org.jboss.services.binding.XMLServicesStoreFactory
</attribute>
</mbean>


• Change <attribute name="ServerName">ports-01</attribute> as
<attribute name="ServerName">ports-02</attribute>

• Change the StoreURL as follows
<attribute name="StoreURL">file:../server/node2/binding-manager/port-bindings.xml</attribute>

• Copy the file jboss4.0.1sp1\server\all\deploy\deploy.last\farm-service.xml to
jboss4.0.1sp1\server\node1\deploy.last and
jboss4.0.1sp1\server\node2\deploy.last

• Open the file jboss-4.0.1sp1\server\node1\deploy\jbossweb-tomcat50.sar\server.xml

• Replace <Engine name="jboss.web" defaultHost="localhost"> with
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1">

• Open the file jboss-4.0.1sp1\server\node2\deploy\jbossweb-tomcat50.sar\server.xml

• Replace <Engine name="jboss.web" defaultHost="localhost"> with
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node2">
 


STARTING THE CLUSTERS
The simplest way to start a JBoss server cluster is to start several JBoss instances on the same local network. We can use the “run -c all” command for each instance. These server instances are all started in the “all” configuration and they detect each other automatically and form a cluster.



• Open Command Prompt

o Start node1 from command line with partition name

jboss4.0.1sp1\bin\ run -c node1

o Leave 10 seconds gap

• Open another Command Prompt

o Start node1 from command line with partition name

jboss4.0.1sp1\bin\ run -c node2

• Both the nodes should be up and running

• Now that we have made sure that the port numbers are changed by application server and so no longer we can access 8080 as the default port for web console for node1 and node2.

It might be 8180 and 8280 respectively.

So if you access thru http://localhost:8180/web-console you can access node1 and
similarly http://localhost:8280/web-console you can access node2 


                                                                                                                  Courtesy : Vibhuti Goel