Giter VIP home page Giter VIP logo

distributedlogquery's Introduction

Distributed Log Querier

Description

A Go distributed log querier with concurrency and fault tolerance that allows you to query distributed log files on multiple machines from any one of those machines. This project is implemented by hangy6(Hang Yu) and tian23(Tian Luan).

Installation

You can clone this project to the machines you need to grep log from using following command:

ssh: git clone [email protected]:hangy6/mp1-hangy6-tian23.git
https: git clone https://gitlab.engr.illinois.edu/hangy6/mp1-hangy6-tian23.git

Build

To build the client and server programs local easily, you can use the bash scripts, please follow the commands below:

cd src/scripts/
bash build.sh

or you can build the client and server program by yourself following the commands below:

cd src/
go build -o ../bin/client ./client_main.go
cd src/
go build -o ../bin/server ./server_main.go

Usage

To grep log from multiple machines, please build the server and client program first following previous instruction, and then run server program on these machines. After that please run client program on the machine you want to use.

To run server program on a machine, please use following command:

bin/server

You can use config.json to configure the machines you want to query log from.

To run client program on a machine, please use following command:

bin/client [query]

The [query] in the above command should follow:

grep [options] [pattern] [log_name] [output_file_path](optional)

Here for [options] we have:

-c counts the number of lines that contain matching pattern in a file and prints it or (output to specified file)

-Ec counts the number of lines that contain matching pattern using regex in a file and prints it or (output to specified file)

[output_file_path] is optional, if you input this, the result of grep command will be output to [output_file_path]

If you want to run server on multiple machines at the same time, you can use the run_all_server.sh at src/scripts/ but please make slight change for your ipaddress.

Tests

To run unit test, please use following command to run the corresponding script:

go test src/test/[test_script_name]

If you want to see the execute time of tests, please use option -v. The local_test.go is to test the client-server mode locally where distributed_test.go will communicate with servers on other machines.

Support

If you have any questions, please contact [email protected] or [email protected]

Authors

Tian Luan & Hang Yu

distributedlogquery's People

Contributors

t1u4n avatar

Watchers

 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.