File: start_cluster.sh

package info (click to toggle)
golang-github-hashicorp-serf 0.8.1%2Bgit20180508.80ab4877~ds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,276 kB
  • sloc: sh: 412; python: 11; makefile: 7
file content (21 lines) | stat: -rwxr-xr-x 484 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
SERF="./bin/serf"

# Set secret, blank for disabled
SECRET="1FzgH8LsTtr0Wopn4934OQ=="
#SECRET=""

# Set protocol version
PROTO="1"

for i in {0..99}
do
    BIND=`expr 2 + $i`
    PORT=`expr 7373 + $i`
    echo Starting Serf agent $i on 127.0.0.1:$BIND, RPC on port $PORT
    $SERF agent -node=node$i -rpc-addr=127.0.0.1:$PORT -bind=127.0.0.$BIND -log-level=warn -join=127.0.0.2 -encrypt=$SECRET -protocol=$PROTO &
    if [ $i -eq 0 ]
    then
        sleep 1;
    fi
done