UIUC CS425, Distributed Systems: Fall 2023 Machine Programming 3
See MP Document
- Go 1.20
make build
serve
command starts the command server and waits for commands from clients.
./bin/sdfs serve [flags]
Flags:
-c, --config string path to config file (default ".sdfs/config.yml")
-h, --help help for serve
-l, --log string path to log file (default "logs/sdfs.log")
join
command tells the machine to join the group.
./bin/sdfs join [flags]
Flags:
-h, --help help for join
-c, --config string path to config file (default ".sdfs/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/sdfs leave [flags]
Flags:
-h, --help help for leave
-c, --config string path to config file (default ".sdfs/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/sdfs fail [flags]
Flags:
-h, --help help for fail
-c, --config string path to config file (default ".sdfs/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/sdfs list_mem [flags]
Flags:
-h, --help help for list_mem
-c, --config string path to config file (default ".sdfs/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
list_self
command lists the self's ID.
./bin/sdfs list_self [flags]
Flags:
-h, --help help for list_self
-c, --config string path to config file (default ".sdfs/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/sdfs enable suspicion [flags]
./bin/sdfs disable suspicion [flags]
Flags:
-h, --help help for suspicion
-c, --config string path to config file (default ".sdfs/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/sdfs config set-droprate [flags]
Flags:
-d, --droprate float32 droprate
-h, --help help for droprate
Global Flags:
-c, --config string path to config file (default ".sdfs/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/sdfs 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 ".sdfs/config.yml")
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
get
command get file from SDFS.
Usage:
sdfs get [sdfsfilename] [localfilename] [flags]
Examples:
sdfs get sdfs_test local_test
put
command put file to SDFS.
Usage:
sdfs put [localfilename] [sdfsfilename] [flags]
Examples:
sdfs put local_test sdfs_test
delete
command delete file from SDFS.
Usage:
sdfs delete sdfsfilename [flags]
Examples:
delete sdfs_test
ls
command list file from SDFS.
Usage:
sdfs ls [sdfsfilename] [flags]
Examples:
sdfs ls sdfs_test
store
command store file from SDFS.
Usage:
sdfs store [flags]
Examples:
sdfs store
multiread
command launches multiple machines to read a file from SDFS.
Usage:
sdfs multiread [sdfsfilename] [localfilename] [flags]
Examples:
sdfs multiread sdfs_test local_test -m "0[1-9]"
Flags:
-c, --config string path to config file (default ".sdfs/config.yml")
-h, --help help for multiread
-m, --machine-regex string regex for machines to join (e.g. "0[1-9]") (default ".*")
multiwrite
command launches multiple machines to write a file to SDFS.
Usage:
sdfs multiwrite [localfilename] [sdfsfilename] [flags]
Examples:
sdfs multiwrite local_test sdfs_test -m "0[1-9]"
Flags:
-c, --config string path to config file (default ".sdfs/config.yml")
-h, --help help for multiwrite
-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/bash
docker exec -it dev-m[1-10] /bin/bash
$ go run main.go [command] [flags]
sdfs
binary in each VM home directory- tmux installed
Use tmux to run sdfs serve
in background on each VM.
# run all sdfs process
./vm_run_all.sh
# ssh to one machine
./sdfs [command] [flags]
# kill all sdfs process
./vm_kill_all.sh