-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_servers.sh
executable file
·36 lines (27 loc) · 1.1 KB
/
run_servers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# How many chunkservers to start
N_CHUNKSERVERS=${1:-2}
# Create a docker network for our system
echo "Creating network"
docker network create --driver bridge gfs-net
# Launch in detached mode the chunkservers
echo "Launching chunkservers"
for i in $(seq 1 $N_CHUNKSERVERS); do
cs_name="chunkserver$i"
echo "Name: $cs_name"
volume_name="vol_$i"
docker run -d --mount source=${volume_name},target=/chunk_storage --name $cs_name --network gfs-net chunkserver --self_ip $cs_name --master_ip master --master_port 50051
done
# docker container ls -a
# Launch in attached mode the master
echo "Launching master"
docker run --name master --network gfs-net master --self_ip master --self_port 50051
# To view any instance, run "docker attach <name>" in a separate terminal
# Start some greeters in the background, pinging each other
# echo "Starting $N_GREETERS greeters"
# for i in $(seq 1 $N_GREETERS); do
# GREETER_NAME="greeter-$i"
# echo "Starting $GREETER_NAME"
# docker run --name $GREETER_NAME --network gfs-net greeter --master_ip # TODO fill in
# done
# docker network rm gfs-net