Make it easier to change the RMI/Server port

git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-1@389618 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: 1d45393e1e
This commit is contained in:
Sebastian Bazley 2006-03-28 22:47:00 +00:00
parent 149e154656
commit 966178e154
3 changed files with 42 additions and 4 deletions

View File

@ -15,11 +15,16 @@
## See the License for the specific language governing permissions and ## See the License for the specific language governing permissions and
## limitations under the License. ## limitations under the License.
## To change the RMI/Server port:
##
## SERVER_PORT=1234 jmeter-server
##
set OLDCLASSPATH=$CLASSPATH set OLDCLASSPATH=$CLASSPATH
export OLDCLASSPATH export OLDCLASSPATH
set CLASSPATH=`dirname $0`/../lib/ext/ApacheJMeter_core.jar:`dirname $0`/../lib/jorphan.jar:`dirname $0`/../lib/logkit-1.2.jar set CLASSPATH=`dirname $0`/../lib/ext/ApacheJMeter_core.jar:`dirname $0`/../lib/jorphan.jar:`dirname $0`/../lib/logkit-1.2.jar
export CLASSPATH export CLASSPATH
rmiregistry & rmiregistry $SERVER_PORT &
set CLASSPATH=$OLDCLASSPATH set CLASSPATH=$OLDCLASSPATH
export CLASSPATH export CLASSPATH
`dirname $0`/jmeter -s "$@" `dirname $0`/jmeter -Dserver_port=${SERVER_PORT:-1099} -s "$@"

View File

@ -1,7 +1,7 @@
@echo off @echo off
rem $Id$ rem $Id$
rem Copyright 2001-2004 The Apache Software Foundation rem Copyright 2001-2004,2006 The Apache Software Foundation
rem rem
rem Licensed under the Apache License, Version 2.0 (the "License"); rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with 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 See the License for the specific language governing permissions and
rem limitations under the License. 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: REM Protect environment against changes if possible:
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
@ -41,7 +50,8 @@ goto exit
:setCP :setCP
echo Found ApacheJMeter_core.jar 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 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 if not "%OS%"=="Windows_NT" goto win9xStart
:winNTStart :winNTStart
@ -73,6 +83,15 @@ goto setupArgs
rem This label provides a place for the argument list loop to break out rem This label provides a place for the argument list loop to break out
rem and for NT handling to skip to. rem and for NT handling to skip to.
if not "%SERVER_PORT%" == "" goto port
jmeter -s %JMETER_CMD_LINE_ARGS% jmeter -s %JMETER_CMD_LINE_ARGS%
goto end
:port
jmeter -Dserver_port=%SERVER_PORT% -s %JMETER_CMD_LINE_ARGS%
:end
:exit :exit

View File

@ -109,6 +109,20 @@ remote_hosts=127.0.0.1
# RMI port to be used by the server (must start rmiregistry with same port) # RMI port to be used by the server (must start rmiregistry with same port)
#server_port=1099 #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 # Logging Configuration
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------