Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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 value

Within 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 :))