Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weibomobile/tsung_rsh
Replace SSH Tunnel for Tsung Clusters
https://github.com/weibomobile/tsung_rsh
Last synced: 28 days ago
JSON representation
Replace SSH Tunnel for Tsung Clusters
- Host: GitHub
- URL: https://github.com/weibomobile/tsung_rsh
- Owner: weibomobile
- Created: 2016-07-18T08:40:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-25T13:57:03.000Z (over 8 years ago)
- Last Synced: 2024-08-04T02:07:55.123Z (4 months ago)
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 38
- Watchers: 3
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-tsung - tsung_rsh - Replace SSH tunnel for Tsung clusters. (Tools / Distributed)
README
## README
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.
## How To Use it
First of all, you should `git clone https://github.com/weibomobile/tsung_rsh.git` your server :))
### 1. Starting the `rsh_daemon.sh`
#### 1). `rsh_daemon.sh` Usage
```bash
Usage: rsh_daemon.sh start|stop|status|restart
Options:
-a allow only given hosts to connect to the server (default is tsung_master)
-p use the special port for listen (default is 19999)
-s 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 valueWithin the Tsung nodes server, starting it:
```bash
sh rsh_daemon.sh -a tsung_master start
```> The Mac OS does not support assign multi values for `-a` parameters.
#### 2). The tmp `_tmp_rsh_filter.sh` file
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:
1. Receive `ping`, output `pong`
2. Executing the `erl` command#### 3). You can assign the Erlang Runtime path
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 :
```bash
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:
```bash
erl -detached -noinput -master tsung_controller@tsung_master -sname tsung8@node136 ...
```
Then the daemon script will do:```bash
exec /root/.tsung/erlang/r18.1/bin/erl -detached -noinput -master tsung_controller@tsung_master -sname tsung8@node136 ...
```#### 4). How debug the rsh daemon server ?
First of all, starting the daemon :
```bash
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:
```bash
nc 127.0.0.1 19999
```Then type `ping` and entry, you will get `pong` response.
Now, start the remote Erlang Shell:
```bash
ncat 127.0.0.1 19999
```Type the command :
```bash
erl -sname foo
```
You will get output, and you can have a try now.```bash
Eshell V7.1 (abort with ^G)
(foo@weibomobile)1>
```### 2. Starting Tsung with `rsh_client.sh`
```bash
tsung -r /the_path/rsh_client.sh -f tung.xml
```> `rsh_client.sh` with the target host's port is **19999**
## Summary
The project is to replace the SSH for Tsung Clusters, and it do now :))