Skip to content

pskalle2/GroupMembership

Repository files navigation

MP1 - Distributed Log Querier

Prerequisites

Please make sure that you have Go installed on your local machine.

Instructions

Please clone this github repository to your local machine. Additionally, please clone this repository into another virtual machines that you are using via any method of choice (such as SSHing and running git clone directly on each VM).

Then, from your local machine, please open up the terminal in the MP1 directory. Then, run the following commands:

chmod +x start_servers.sh 
./start_servers.sh <netid>

Now, the server.go files should be running on all 10 VMs. You can proceed to doing testing and manual user inputs, both of which are described in the sections below.

Testing

Run the following command from your local machine terminal in the MP1 directory. Your netid is required for the remoteUser parameter and numVMs defaults to 10 if no value is given.

go test -v -count=1 ./tests -remoteUser=<netid> -numVMs=<int>

You terminal will output the PASS/FAIL results for the 7 distributed test cases across all 10 VMs.

User Input

SSH into your VM of choice, open the MP1 folder, and run the following commands to change directory into client folder and run the client.

cd client
go run client.go <number_of_servers> [grep_options] "search_pattern"

The second command, which directly runs the client, may seem complicated so here is an explanation of what the command means:

  • <number_of_servers>: Specify how many VMs you want to query from. "4" would query servers from VMS 01-04, whereas "10" would query from all 10 VMs.
  • [grep_options]: Takes in any of the standard grep flags, like -e, -c, -n, etc.
  • "search_pattern": The grep search pattern that you are looking for.

After running this command, the terminal should display the number of lines from the grep output on each VM, followed by the total number of matching lines summed across all VMs. Then, you have the option to input the numbers of the VMs in a space separated list (i.e. 1 3 9 10) of which you would like to display the output lines of. This loop will continue until you choose to quit by entering "q", at which point you exit.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors