Git Product home page Git Product logo

meteor-cluster's Introduction

This is an archived project

Are you looking for our newest Meteor Cluster project?

Meteor Cluster is now retired & Meteor's Collection implementation implementation with Oplog support can be used to run a cluster of Meteor nodes.

meteor-cluster Build Status

Smarter way to run cluster of meteor nodes

See: Meteor Cluster - Introduction & How it works article

Meteor is not a toy anymore. People keen to build enterprise apps on top of the meteor. So people need to run cluster of meteor nodes for several reasons.

But when running cluster of nodes, meteor is not realtime anymore(between nodes). It get synced but takes few seconds.

Here comes the solution - meteor-cluster

Meteor Cluster in Action

Installation

just run mrt add cluster

Redis

meteor-cluster uses redis as the communicate channel between nodes. It uses pub/sub functionality of redis. So you need to have redis-server running.

If you are new to redis, read this guide

Configurations

meteor-cluster needs to know

  • how to connect with redis
  • what collections it needs to sync

It just a two lines of configuration. Add following inside you server code.

Meteor.startup(function() {
    Meteor.Cluster.init(); //assumes you are running redis-server locally
    Meteor.Cluster.sync(Posts, Notifications, Comments); //these are my collections
});

How to scale

Just fire up new nodes and it just works.

Tests

  • start redis-server before testing
  • mrt test-packages ./

API

Meteor.Cluster.init(redisConfig)

Initialize and connect to redis.

  • redisConfig - null or {port: 6337, host: "localhost", auth: null, db: null}
  • alternatively you can pass redis config via CLUSTER_URL env variable
  • CLUSTER_URL formart: redis://redis:<password>@<host>:<port>

Meteor.Cluster.sync(collections...)

Sync given set of collection between nodes

  • collections... - Collections defined as list of arguments

meteor-cluster's People

Contributors

arunoda avatar rhyslbw 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.