UIUC CS425, Distributed Systems: Fall 2023 Machine Programming 2
See MP Document
- Go 1.20
make build
serve
command start the command server and wait for commands from clients.
./bin/msl serve [flags]
Flags:
-c, --config string path to config file (default ".msl/config.yml")
-h, --help help for serve
-l, --log string path to log file (default "logs/msl.log")
-p, --port string port to listen on (default "7132")
join
command tells the machine to join the group.
./bin/msl join [flags]
Flags:
-h, --help help for join
-c, --config string path to config file (default ".msl/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
leave
command tells the machine to leave the group.
./bin/msl leave [flags]
Flags:
-h, --help help for leave
-c, --config string path to config file (default ".msl/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
fail
command tells the machine's process to fail.
./bin/msl fail [flags]
Flags:
-h, --help help for fail
-c, --config string path to config file (default ".msl/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
list_mem
command lists the membership list.
./bin/msl list_mem [flags]
Flags:
-h, --help help for list_mem
-c, --config string path to config file (default ".msl/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
list_self
command lists self's ID.
./bin/msl list_self [flags]
Flags:
-h, --help help for list_self
-c, --config string path to config file (default ".msl/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
enable suspicion
command enables suspicion.
disable suspicion
command disables suspicion.
./bin/msl enable suspicion [flags]
./bin/msl disable suspicion [flags]
Flags:
-h, --help help for suspicion
-c, --config string path to config file (default ".msl/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
config set-droprate
command sets the drop rate.
./bin/msl config set-droprate [flags]
Flags:
-d, --droprate float32 droprate
-h, --help help for droprate
Global Flags:
-c, --config string path to config file (default ".msl/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
config set-verbose
command sets the verbose level.
./bin/msl config set-verbose [flags]
Flags:
-h, --help help for set-verbose
-v, --verbose enable or disable verbose
Global Flags:
-c, --config string path to config file (default ".msl/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
- Docker
- docker compose
# on one session
docker compose -f docker-compose.dev.yml up [-d] [--build]
# on another session
docker exec -it dev /bin/ash
docker exec -it dev-m[1-10] /bin/ash
$ go run main.go [command] [flags]
msl
binary in each VM home directory- tmux installed
Use tmux to run msl serve
in background on each VM.
# run all msl process
./vm_run_all.sh
# ssh to one machine
./msl [command] [flags]
# kill all msl process
./vm_kill_all.sh