Smarter way to run cluster of meteor nodes
JavaScript
Latest commit cae0a0b Feb 22, 2015 @arunoda Update README.md
Permalink
Failed to load latest commit information.
lib added support for Meteor Stream Jun 26, 2013
test add support for meteor 0.6.5 Aug 15, 2013
.travis.yml added travis support Jun 5, 2013
README.md Update README.md Feb 22, 2015
package.js add support for meteor 0.6.5 Aug 15, 2013
smart.json version bumped Aug 15, 2013

README.md

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