Giter Site home page Giter Site logo

looksgood / redisshards Goto Github PK

View Code? Open in Web Editor NEW

This project forked from j03m/redisshards

1.0 1.0 0.0 81 KB

A simple set of scripts for nodejs that allow you to remote start stop pre-sharded redis instances using a json config file

Home Page: www.j03m.com

redisshards's Introduction

What is it: A set of nodejs scripts you can use to manage a number of redis pre-shards. (Here's hoping for great things from cluster)

There are two scripts you want to be aware of: RedisManager.js and redisRing.js

RedisManager.js is a tool that will spin up and configure redis instances on different machines providing you have SSH to those machines.

How to use it: 
1. Modify masterTemplate.conf to your liking
2. Set up redisMaster.conf with your instances, follow the json as an example
3. Set up your pub/priv keys so you can ssh, scp to your instances without entering a pass
4. Modify the path's and then copy redisInitScript.sh, startRedis.sh, stopRedis.sh to your user directory on each instance
5. Make sure your ssh user can execute those scripts on the remote instances
6. Use nodejs to invoke redisManager.js ie, node redisManager.js with the commands: redisManager.js -c [createConfigs|startAll|stopAll|execute]

Make sure you run createConfigs first. Also requires js-opts (https://bitbucket.org/mazzarelli/js-opts/wiki/Home)

redisRing is essentially a wrapper around the node_redis client (https://github.com/mranney/node_redis) that uses
node hash ring (https://github.com/bnoguchi/node-hash-ring) to direct your queries to different shards. The code always
uses your key as the basis for which instance to hit - so there are some obvious gotchas with using the m* operations. Be warned.

All code in this repo is offered on the MIT license http://en.wikipedia.org/wiki/MIT_License






redisshards's People

Contributors

j03m avatar

Stargazers

ken avatar

Watchers

ken 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.