Giter VIP home page Giter VIP logo

grange-server's Introduction

grange-server

A read-only range server frontend to grange. See there for documentation of concepts and query language.

Cluster and group data is specified in YAML files.

Installation

  1. Setup your go environment if needed

     mkdir $HOME/go
     export GOPATH=$HOME/go
    
  2. Install grange-server and erg client

     go get -v -u github.com/square/grange-server
     go get -v -u github.com/square/erg
    

Usage

Put some range YAML files in clusters/, then:

$GOPATH/bin/grange-server --port=8888 $GOPATH/src/github.com/square/grange-server/grange.gcfg

Simple expansion (with erg client):

erg -v 1..2

Find all clusters that have type key set to "mysql":

erg -v '%{has(TYPE;mysql)}'

Features

  • Read-only serving of cluster YAML files on disk.
  • -parse option to dry-run parse source files and not start the server. Will return non-zero exit code if any warnings were emitted.
  • Reloads configuration file in response to HUP signal. Allows dynamic log level and cluster changes.
  • Can report HTTP response metrics to statsd.

Format

See the clusters directory for sample YAML files. At minimum, your directory should contain a GROUPS.yaml. See grange.gcfg for a sample configuration.

grange-server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grange-server's Issues

Feature: user defined functions to let users dynamically generate content

Lot of us who use range have instances running in Amazon AWS where the node list is not static due the auto-scaling property of AMZ. IMHO we can solve this in following ways

  1. manually edit content in YAML to keep it in sync
  2. generate the YAML file automatically though a separate system
  3. give an option to udf to generate the content

(1) is not an option because it won't scale. Problem with (2) is, if we use version control to version the changes in YAML file, we might run into race conditions where the final YAML files cannot be merged.

(3) seems to be better because users can write their on functions to generate content on fly without the need of editing YAML file. Down side for this is, a slow user defined function will make the end point drag. (udf could be a REST call to make interaction easy).

key1:
  - udf(fn(someargs))

where udf is a keyword to let the system know we are looking for at an user defined function, fn could be the function name with someargs as the argument passed to the function (or fn could be a REST endpoint using someargs as its GET param)

I am willing to write a patch if you are interested. Please feel to close the issue if you think it is not in the scope :-)

scalar parse error.

From the clusters data in this repo

When server starts.

WARN  [2016-01-20 13:28:17.552] Could not parse query: %!!(MISSING)s(bool=false)

Queries

$ erg %dc2-mysql:KEYS
ALL,CLUSTER,DOC,DOWN,EXTRA,PORT,TYPE,UP
$ erg %dc2-mysql:UP
Error:  Could not parse query: %!s(bool=false)

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.