Giter VIP home page Giter VIP logo

cs425-mp1-distributed-grep's Introduction

Distributed grep

This project implements distributed grep functionality which enables querying of distributed log files on multiple machines, from any one of those machines.

Design

A simple Client-server architecture has been used. All the machines from which log files have to be queried must have the server (called grep-server) running. A client (called grep-client) takes grep queries from user and displays back matching lines. The client additionally requires a configuration file which stipulates the addresses of the servers and local logfile path in the machines.

The processing paradigm is as follows. The client takes the grep query from user and spawns multiple threads (each talking to one server). Each thread relays the query to its server. In the server, the grep query is executed locally and the matching lines are relayed back to the client thread. The client thread then prints this matching line.

Multithreaded client and multithreaded server not only ensure faster execution due to paralellization, but also add fault tolerance. The fault tolerance guarantee of the system is that it fetches answers from all machines that have not failed.

Package Dependencies

  • Java 7
  • Maven

Instructions

Step 1 - Run all servers

grep-server has to be run in all machines containing required log files. The following are the steps to run server in one machine :

  1. ssh into the vm machine : Eg - ssh <NETID>@fa15-cs425-gNN-XX.cs.illinois.edu
  2. Type git clone https://gitlab-beta.engr.illinois.edu/cs425-agupta80-pmazmdr2/mp1-distributed-logging.git
  3. cd into the project root directory
  4. run mvn -DskipTests package. You should see build success.
  5. Type cd ./scripts/ && ./run_server <PORT_NUMBER_XX>

Step 2 - Populate configuration file

The configuration file has 3 lines : serverAddress, serverPort and logFilePath. This file stores the server address (fa15-cs425-gNN-XX.cs.illinois.edu), server port (same as <PORT_NUMBER_XX> in step 1.5) and filepath of the log file for all the machines. Refer to ./src/main/resources/config.properties for format details.

Step 3 (Optional) - Run unit tests

Once the grep-servers are all running and configuration file is properly set, validation can be done by running unittest. This can be done by running mvn test in project root directory.

Step 4 - Run grep client

grep-client takes grep query and grep matching control options from user. The configuration file path (populated in step 2) and the grep query string are required arguments, other switches are optional. The help switch shows usage instructions.

  1. cd ./scripts/
  2. run_client -help

cs425-mp1-distributed-grep's People

Contributors

mazumdarparijat avatar

Stargazers

 avatar

Watchers

Ashu Gupta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.