Hi Experts ,
any suggestions !!!
Why not make copies of run.bat, one for each instance, and set the heap sizes in those copies?
The run.bat file in the C:\jboss-4.2.0.GA\bin contains :-
rem JBoss Bootstrap Script for Win32
rem $Id: run.bat 60996 2007-02-28 13:44:01Z firstname.lastname@example.org $
@if not "%ECHO%" == "" echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal
if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%
REM Add bin/native to the PATH if present
if exist "%JBOSS_HOME%\bin\native" set PATH=%JBOSS_HOME%\bin\native;%PATH%
if exist "%JBOSS_HOME%\bin\native" set JAVA_OPTS=%JAVA_OPTS% -Djava.library.path=%JBOSS_HOME%\bin\native
rem Read all command line arguments
REM The %ARGS% env variable commented out in favor of using %* to include
REM all args in java command line. See bug #840239. [jpl]
REM set ARGS=
REM if [%1] ==  goto endloop
REM set ARGS=%ARGS% %1
REM goto loop
rem Find run.jar, or we can't continue
if exist "%RUNJAR%" goto FOUND_RUN_JAR
echo Could not locate %RUNJAR%. Please check that you are in the
echo bin directory when running this script.
if not "%JAVA_HOME%" == "" goto ADD_TOOLS
echo JAVA_HOME is not set. Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
rem A full JDK with toos.jar is not required anymore since jboss web packages
rem the eclipse jdt compiler and javassist has its own internal compiler.
if not exist "%JAVA_HOME%\lib\tools.jar" goto SKIP_TOOLS
rem If exists, point to the JDK javac compiler in case the user wants to
rem later override the eclipse jdt compiler for compiling JSP pages.
rem If JBOSS_CLASSPATH or JAVAC_JAR is empty, don't include it, as this will
rem result in including the local directory in the classpath, which makes
rem error tracking harder.
if not "%JAVAC_JAR%" == "" set RUNJAR=%JAVAC_JAR%;%RUNJAR%
if "%JBOSS_CLASSPATH%" == "" set RUN_CLASSPATH=%RUNJAR%
if "%RUN_CLASSPATH%" == "" set RUN_CLASSPATH=%JBOSS_CLASSPATH%;%RUNJAR%
rem Setup JBoss specific properties
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME%
rem Add -server to the JVM options, if supported
"%JAVA%" -version 2>&1 | findstr /I hotspot > nul
if not errorlevel == 1 (set JAVA_OPTS=%JAVA_OPTS% -server)
rem JVM memory allocation pool parameters. Modify as appropriate.
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m
rem With Sun JVMs reduce the RMI GCs to once per hour
set JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
rem set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%
rem Setup the java endorsed dirs
echo JBoss Bootstrap Environment
echo JBOSS_HOME: %JBOSS_HOME%
echo JAVA: %JAVA%
echo JAVA_OPTS: %JAVA_OPTS%
echo CLASSPATH: %JBOSS_CLASSPATH%
"%JAVA%" %JAVA_OPTS% "-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%" -classpath "%JBOSS_CLASSPATH%" org.jboss.Main %*
if ERRORLEVEL 10 goto RESTART
if "%NOPAUSE%" == "" pause
So, If i change the HEAP SETTINGS of the file for node 1, save it to the bin directory by the name runnode1.bat , and in the command prompt type :-
runnode1 - c node1 -b IP ADDRESS -g CLUSTER NAME
, will that solve my requirement ??
Is that a GOOD IDEA to do that ??
Because I thought , there must be some way to pass the HEAP VALUES at runtime by the run -D option for the nodes !!!
OR , to specify the HEAP VALUES in a configuration file for the specific nodes !!
Thanks & Regards
1 of 1 people found this helpful
Please don't use bold text, it looks as if you are shouting.
You cannot set the heap sizes using -D options.
Your plane on creating runnode1.bat and editing the heap settings in there is a good one. I would go even further and hard-code the "- c node1 -b IP ADDRESS -g CLUSTER NAME" within runnode1.bat - you could add it to this line:
"%JAVA%" %JAVA_OPTS% "-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%" -classpath "%JBOSS_CLASSPATH%" org.jboss.Main - c node1 -b IP ADDRESS -g CLUSTER NAME %*
Isn't there any way to pass the HEAP VALUES at runtime by the run -D option while starting server instances ??
Can we create our own properties and use the C:\jboss-4.2.0.GA\server\node1\deploy\properties-service.xml file utilize them ??
I asked you to not use bold text, so now you are using bold and blue. Does that mean you are yelling at me? I usually do not respond when I get yelled at.
Go and read the JVM documentation regarding the use of the -D option (since you did not believe my original aswer to your question).
OK SORRY , I GOT YOUR MESSAGE LATELY .
WHY SHOULD I SHOUT , WE ARE HERE TO HELP EACH OTHER.
You actually read my mind .
I was about to ask you , how can we include the :- run -c node1 -b ipaddr -g clustername , in the runnode1.bat.
Your suggestions are really helpful , I shall implement them as you have suggested and shall get back to you soon.
Thanks & Regards
Do like this,create two jboss instance say,
/opt/jboss1 and /opt/jboss2 so that your node1 in jboss1 and node2 in jboss2.Finally makeJVM settings in their respective run.bat.
No need to use bold or colored letter .
I liked , Peter's idea of copying the run.bat file in the bin directory , renaming them for different nodes , and modified jvm settings for the specific nodes.
That way , we shall have multiple nodes with different jvm settings in the same JBOSS Server.
I am going to implement it today , and shall update the post.
Thanks & Regards
Your suggestion, has worked fine .
I am able to run the nodes with different JVM configurations.
Thanks & Regards
I have a doubt on Jboss memory allotment
I have 5 cluster nodes in JBOSS1
I want to give 5 different memory settings for all nodes
Cluster1 - 2048
Cluster2 - 1024
Cluster3 - 3.5 GB
Cluster4 - 4GB
Please can I know how can we set the memory setting for each cluster node.