Entities:
- Master per system
- Stand-by master per system
- Supervisor per VM
- Task
- Client. Submit job. Local code, SDFS data sources (both input data and file databases).
- Master and supervisor detect each other's failure.
- Supervisor detect Tasks' failure.
i.e. each tasks owns a Unix domain socket on disk and supervisor 'connect/search' for its existence.
- If any socket exists, supervisor needs to report its failure upon starting.
- TODO: Current implementation doesn't support node rejoining. Therefore, always assume all tasks fail simultaneously
- TODO: In the sds close method, need to close all the bolts tasks as well.
Deploy the code, cfg.json and compile the codes on VMs by running ansible-playbook roles/deploy.yml under the ansible directory. Also run make buildlocal to make sure the binaries are available locally.
cp remotecfg.json cfg.jsonto switch to the remote (VM) mode.make runwill spawn the processes on every VMs and setup the gRPC server and Failure detection UDP ports.make jointo connect all VMs together. Each VM will now have the full membership list.- To use the SDFS functionality, go to any live VM and run
sds sdfs put/get/ls/store/get-versionscommands. - To fail any nodes, say, VM1 and VM2, run
sds -n 0,1 close. - To tear down the systems, run
sds close.
- Local files are stored under data/mp3/ directories of each VM.
- Logs are recorded under data/mp2/ directories.
Deploy the source files to VMs and compile using the Makefile. The procedure is described in the MP1 session. After compilation, an extra command dswim will be installed to $GOPATH/bin/dswim. This will be the command that we'll use for this MP.
The steps needed to play the demo is below:
- ssh to one VM and run
dswim -i. The flag-ihere implying the dswim will be the introducer. Uselsfor the stdin input to retrieve the id, which will be used by other nodes to join later. - ssh to other VM and run
dswim. This will block on user input. typejoin <id of the introducer>to join the group. Repeat this process on as many VMs as you like. You can typelsin any VM to get its local membership list and its own ID (i.e. IP:port) - Ctrl-C to kill one of the dswim process to simulate a node failing.
- type leave to actively leave the group. Instead of failure that requires a timeout to be detected, active leave will disseminate its leave immediately.
Install grpc with
go get google.golang.org/grpc, and protoc-gen-go with go get -u github.com/golang/protobuf/protoc-gen-go
Compile the .proto file using
protoc -I protobuf/ protobuf/grep_log.proto --go_out=plugins=grpc:protobuf
- Copy SOURCEME.sh.example to SOURCEME.sh and change the value in latter.
- Modify the
remotecfg.jsonfile to add the appropriate IP addresses and port numbers of the VMs. - Refer to vmsetup/README.md to spawn the corresponding VMs.
- Add 'CS425NETID' environmental variable by
source SOURCEME.sh. make
- To return the line number, need to add
-n. - To return the file name, need to add another null file (e.g. /dev/null)
- The wildcard "*" will not work in exec.Command. Have to do the filepath.Glob manually, or invoke a shell
/bin/sh -c ... - Invoking sh -c results in "#" signs unquoted.
- Go install will make the binary filename based on package name (which is the name of the directory containing "main"), not the name of file containing "main" function.
- To uninstall binaries, use
go clean -i mp/... - gRPC naming conventions link
- [Done] Add json file to support input IP address.
- [Done] Allow user-input grep pattern. (Currently hard-coded)
- Write command that will cleanup the running service instead of manually cancel each server.
- Write code to auto-send IP & port info from server to the client.
- [Done] Add build functionality instead of running
go runall the time.