diff --git a/bin/jmeter-server b/bin/jmeter-server index 6afb9cde4d..b1c0a66a6a 100755 --- a/bin/jmeter-server +++ b/bin/jmeter-server @@ -15,11 +15,16 @@ ## See the License for the specific language governing permissions and ## limitations under the License. +## To change the RMI/Server port: +## +## SERVER_PORT=1234 jmeter-server +## + set OLDCLASSPATH=$CLASSPATH export OLDCLASSPATH set CLASSPATH=`dirname $0`/../lib/ext/ApacheJMeter_core.jar:`dirname $0`/../lib/jorphan.jar:`dirname $0`/../lib/logkit-1.2.jar export CLASSPATH -rmiregistry & +rmiregistry $SERVER_PORT & set CLASSPATH=$OLDCLASSPATH export CLASSPATH -`dirname $0`/jmeter -s "$@" +`dirname $0`/jmeter -Dserver_port=${SERVER_PORT:-1099} -s "$@" diff --git a/bin/jmeter-server.bat b/bin/jmeter-server.bat index e5aceb83e7..c792aa3a09 100644 --- a/bin/jmeter-server.bat +++ b/bin/jmeter-server.bat @@ -1,7 +1,7 @@ @echo off rem $Id$ -rem Copyright 2001-2004 The Apache Software Foundation +rem Copyright 2001-2004,2006 The Apache Software Foundation rem rem Licensed under the Apache License, Version 2.0 (the "License"); rem you may not use this file except in compliance with the License. @@ -15,6 +15,15 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. +rem =============================================================== +rem Enviroment variables +rem SERVER_PORT (optional) - define the rmiregistry and server port +rem +rem JVM_ARGS - Java flags - these are handled by jmeter.bat +rem +rem =============================================================== + + REM Protect environment against changes if possible: if "%OS%"=="Windows_NT" setlocal @@ -41,7 +50,8 @@ goto exit :setCP echo Found ApacheJMeter_core.jar set CLASSPATH=%JMETER_HOME%\lib\ext\ApacheJMeter_core.jar;%JMETER_HOME%\lib\jorphan.jar;%JMETER_HOME%\lib\logkit-1.2.jar -START rmiregistry + +START rmiregistry %SERVER_PORT% if not "%OS%"=="Windows_NT" goto win9xStart :winNTStart @@ -73,6 +83,15 @@ goto setupArgs rem This label provides a place for the argument list loop to break out rem and for NT handling to skip to. +if not "%SERVER_PORT%" == "" goto port + jmeter -s %JMETER_CMD_LINE_ARGS% +goto end + + +:port +jmeter -Dserver_port=%SERVER_PORT% -s %JMETER_CMD_LINE_ARGS% + +:end :exit \ No newline at end of file diff --git a/bin/jmeter.properties b/bin/jmeter.properties index 7bf1eaf306..33e42d59a0 100644 --- a/bin/jmeter.properties +++ b/bin/jmeter.properties @@ -109,6 +109,20 @@ remote_hosts=127.0.0.1 # RMI port to be used by the server (must start rmiregistry with same port) #server_port=1099 +# To change the port to (say) 1234: +# On the server(s) +# - set server_port=1234 +# - start rmiregistry with port 1234 +# On Windows this can be done by: +# SET SERVER_PORT=1234 +$ JMETER-SERVER +# +# On Unix: +# SERVER_PORT=1234 jmeter-server +# +# On the client: +# - set remote_hosts=server:1234 + #--------------------------------------------------------------------------- # Logging Configuration #---------------------------------------------------------------------------