Deepstream.io Cluster
Community supported clustering for deepstream.io. Based on Nanomsg.
Usage
yarn install deepstream.io-cluster
The deepstream.io-cluster
module extends the base deepstream.io
.
Peers bootstrap off of each other.
Server A, 192.168.1.1
const Deepstream = ; const server = ;
Server B, 192.168.1.2
const Deepstream = ; const server = cluster: peerAddresses: host: '192.168.1.1' ;
Server C, 192.168.1.3
const Deepstream = ; const server = ; server;
Options
const Deepstream = ; const server = cluster: bindAddress: host: '127.0.0.1' // Optional, default '127.0.0.1' pubsubPort: 6021 // Optional, default 6021 pipelinePort: 6022 // Optional, default 6022 peerAddresses: host: '127.0.0.1' // Required pubsubPort: 6021 // Optional, default 6021 pipelinePort: 6022 // Optional, default 6022 ;
Methods
server;
// Returns a Promise. server;
Automatic peer discovery with node-discover
const options = {}; // See options at https://github.com/wankdanker/node-discover#constructor // Returns a Promise.server; // laterserver;
server; // Returns://// [// {// serverName: "server-2",// host: '192.168.1.2',// pubsubPort: 6021,// pipelinePort: 6022,// },// {// serverName: "server-3",// host: '192.168.1.3',// pubsubPort: 6021,// pipelinePort: 6022,// },// ]