All Projects → SensitiveMix → Node Cluster Email

SensitiveMix / Node Cluster Email

Licence: mit
📨 send email if node cluster throw exception

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Cluster Email

terraform-aws-eks-workers
Terraform module to provision an AWS AutoScaling Group, IAM Role, and Security Group for EKS Workers
Stars: ✭ 82 (+36.67%)
Mutual labels:  cluster, workers
Node Worker Nodes
A node.js library to run cpu-intensive tasks in a separate processes and not block the event loop.
Stars: ✭ 468 (+680%)
Mutual labels:  workers, cluster
Orcinus
Agnostic Orchestration Tools
Stars: ✭ 17 (-71.67%)
Mutual labels:  workers, cluster
Ansible Role Patroni
🐘 Ansible Role for Patroni
Stars: ✭ 40 (-33.33%)
Mutual labels:  cluster
Ksync
Sync files between your local system and a kubernetes cluster.
Stars: ✭ 1,005 (+1575%)
Mutual labels:  cluster
Kubernetes Ovn Heterogeneous Cluster
Bootstrap a Kubernetes cluster that can run both Linux and Windows workloads on Google Cloud.
Stars: ✭ 48 (-20%)
Mutual labels:  cluster
Muster
A universal data layer for components and services
Stars: ✭ 59 (-1.67%)
Mutual labels:  workers
Postdock
PostDock - Postgres & Docker - Postgres streaming replication cluster for any docker environment
Stars: ✭ 985 (+1541.67%)
Mutual labels:  cluster
Bootstrap
Tools to bootstrap micro computers
Stars: ✭ 55 (-8.33%)
Mutual labels:  workers
Docker Redis Cluster
Dockerfile for Redis Cluster (redis 3.0+)
Stars: ✭ 1,035 (+1625%)
Mutual labels:  cluster
Rediscluster Py
a Python interface to a Cluster of Redis key-value store
Stars: ✭ 46 (-23.33%)
Mutual labels:  cluster
Rq
Simple job queues for Python
Stars: ✭ 8,065 (+13341.67%)
Mutual labels:  workers
Kiq
📮 Robust job queue powered by GenStage and Redis
Stars: ✭ 49 (-18.33%)
Mutual labels:  workers
Kube Aliases
Kubernetes Aliases and Bash Functions
Stars: ✭ 40 (-33.33%)
Mutual labels:  cluster
Interference
opensource distributed database with base JPA implementation and event processing support
Stars: ✭ 57 (-5%)
Mutual labels:  cluster
Toro
Multithreaded message processing on Postgres
Stars: ✭ 39 (-35%)
Mutual labels:  workers
Yii2 Rabbitmq
RabbitMQ Extension for Yii2
Stars: ✭ 52 (-13.33%)
Mutual labels:  workers
Dbfs
Distributed Blockchain-based File Storage 📡
Stars: ✭ 45 (-25%)
Mutual labels:  cluster
Docker Swarm
🐳🐳🐳 This repository is part of a blog series on Docker Swarm example using VirtualBox, OVH Openstack, Azure and Amazon Web Services AWS
Stars: ✭ 43 (-28.33%)
Mutual labels:  cluster
Relieve
Ease the implementation of multi processing accross your microservices
Stars: ✭ 47 (-21.67%)
Mutual labels:  workers
                    __                __           __                                       _ __
   ____  ____  ____/ /__        _____/ /_  _______/ /____  _____      ___  ____ ___  ____ _(_) /
  / __ \/ __ \/ __  / _ \______/ ___/ / / / / ___/ __/ _ \/ ___/_____/ _ \/ __ `__ \/ __ `/ / /
 / / / / /_/ / /_/ /  __/_____/ /__/ / /_/ (__  ) /_/  __/ /  /_____/  __/ / / / / / /_/ / / /
/_/ /_/\____/\__,_/\___/      \___/_/\__,_/____/\__/\___/_/         \___/_/ /_/ /_/\__,_/_/_/

Build Status codecov Greenkeeper badge

A module for taking advantage of the built-in cluster module in node v0.8 and above.send email if cluster exception,you will recieve a detail email about worker exception.

Installation

npm install cluster-email

Usage

Initialize mail plugin with the given email(s), with the given options.

Options:

  • from sender email
  • timeout sendmail timeout in milliseconds
  • subject defaulting to "cluster({worker}) exception: {message}"
  • template function called with local variables (usually jade / ejs template etc)

Example

const cluster = require('cluster')
const cpu = require ('os').cpus().length
const mail = require('node-cluster-mail')

/**
 * [if description]
 * @param  {[type]} cluster.isMaster [description]
 * @return {[type]}                  [description]
 */
if (cluster.isMaster) {
  // Fork workers.
  for (let i = 0; i < cpu; i++) {
    cluster.fork();
  }

  cluster.on('exit', function(worker, code, signal) {
    mail('[email protected]',{'from':'[email protected]','cc':'[email protected]'})
    console.log('worker ' + worker.process.pid + ' died');
  });

  cluster.on('fork', function(worker) {
  console.log(`workers: ${worker.id} worker.process.pid :${worker.process.pid}`)
});
} else {
  // Workers can share any TCP connection
  // In this service its a restify server
  require('./app')
}

License

MIT License

Copyright (c) 2016-2018 Jack Sun

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].