In many case, the master does not allow we use the SSH tunnel for connection between servers.
In order to bypass limit, I designed the light weight remote shell suite, which as SSH working with Tsung nodes, and working well.
First of all, you should git clone https://github.com/weibomobile/tsung_rsh.git
your server :))
Usage: rsh_daemon.sh <options> start|stop|status|restart
Options:
-a <hostname/ip> allow only given hosts to connect to the server (default is tsung_master)
-p <port> use the special port for listen (default is 19999)
-s <the_erl_path> use the special erlang's erts bin path for running erlang (default is blank)
-h display this help and exit
NOTE:
- The allowed given hosts should be the Tsung master's hostname/IP, and can solved it
- Do not modified the listening port default value 19999, unless you wang to change, then don't forget to modified the
rsh_client.sh
's PORT value
Within the Tsung nodes server, starting it:
sh rsh_daemon.sh -a tsung_master start
The Mac OS does not support assign multi values for
-a
parameters.
The _tmp_rsh_filter.sh
(~/tmp/_tmp_rsh_filter.sh) generated by rsh_daemon.sh
file every time when start.�
The script just for executing the client's command:
- Receive
ping
, outputpong
- Executing the
erl
command
For some reason, We don't need install the Erlang at any server, maybe we can just copy (or use the rsync
) the installed (maybe installed by kerl) Erlang erts dir into the target/slave server.
The -s
parameter can help you :
sh rsh_daemon.sh -s /root/.tsung/erlang/r18.1/bin -a 127.0.0.1 start
When get tsung_controller start the slave's command:
erl -detached -noinput -master tsung_controller@tsung_master -sname tsung8@node136 ...
Then the daemon script will do:
exec /root/.tsung/erlang/r18.1/bin/erl -detached -noinput -master tsung_controller@tsung_master -sname tsung8@node136 ...
First of all, starting the daemon :
sh rsh_daemon.sh -a 127.0.0.1,tsung_master start
Just use the nc
or ncat
build-in command as one simulator client:
nc 127.0.0.1 19999
Then type ping
and entry, you will get pong
response.
Now, start the remote Erlang Shell:
ncat 127.0.0.1 19999
Type the command :
erl -sname foo
You will get output, and you can have a try now.
Eshell V7.1 (abort with ^G)
(foo@weibomobile)1>
tsung -r /the_path/rsh_client.sh -f tung.xml
rsh_client.sh
with the target host's port is 19999
The project is to replace the SSH for Tsung Clusters, and it do now :))