-
Notifications
You must be signed in to change notification settings - Fork 3
pm2
oldwisenir edited this page Aug 24, 2016
·
3 revisions
npm install pm2@latest -g
create a folder pm2 scripts which will contain all proccesses config files
mkdir pm2-scripts
{
apps : [{
name : "api-services",
script : "app.js",
cwd : "/home/linnovate3/vod/replay-api/api-service",
watch : true,
env : {
MONGO_DATABASE: "replay_dev",
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
},
{
name : "query-service",
script : "app.js",
cwd : "/home/linnovate3/vod/replay-api/query-service",
watch : true,
env : {
MONGO_DATABASE: "replay_dev",
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
},
{
name : "media-url-provider",
script : "app.js",
cwd : "/home/linnovate3/vod/replay-api/media-url-provider",
watch : true,
env : {
MONGO_DATABASE: "replay_dev",
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
}
]
}
{
apps : [{
name : "save-video",
script : "index.js",
cwd : "/home/linnovate3/vod/replay-infra/consumer",
watch : true,
args : "SaveVideo",
env : {
MONGO_DATABASE: "replay_dev",
STORAGE_PATH: "/home/linnovate3/vod_storage_data",
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
},
{
name : "metadata-parser",
script : "index.js",
cwd : "/home/linnovate3/vod/replay-infra/consumer",
watch : true,
args : "MetadataParser",
env : {
MONGO_DATABASE: "replay_dev",
STORAGE_PATH: "/home/linnovate3/vod_storage_data",
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
},
{
name : "metadata-to-mongo",
script : "index.js",
cwd : "/home/linnovate3/vod/replay-infra/consumer",
watch : true,
args : "MetadataToMongo",
env : {
MONGO_DATABASE: "replay_dev",
STORAGE_PATH: "/home/linnovate3/vod_storage_data",
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
},
{
name : "video-boundries",
script : "index.js",
cwd : "/home/linnovate3/vod/replay-infra/consumer",
watch : true,
args : "VideoBoundingPolygon",
env : {
MONGO_DATABASE: "replay_dev",
STORAGE_PATH: "/home/linnovate3/vod_storage_data",
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
},
{
name : "metadata-to-captions",
script : "index.js",
cwd : "/home/linnovate3/vod/replay-infra/consumer",
watch : true,
args : "MetadataToCaptions",
env : {
MONGO_DATABASE: "replay_dev",
STORAGE_PATH: "/home/linnovate3/vod_storage_data",
CAPTIONS_PATH: "captions",
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
}
]
}
{
apps : [{
name : "replay-ui",
script : "gulp",
cwd : "/home/linnovate3/vod/replay",
watch : false,
env : {
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
}]
}
{
apps : [{
name : "video-recorder",
script : "index.js",
cwd : "/home/linnovate3/vod/replay-infra/video-recorder",
watch : true,
env : {
INDEX : "102",
MONGO_DATABASE: "replay_dev",
MONGO_HOST : "localhost",
MONGO_PORT : "27017",
STORAGE_PATH: "/home/linnovate3/vod_storage_data",
NODE_ENV: "development"
},
env_production: {
NODE_ENV: "production"
}
}]
}
note: you might need to change cwd paths on deployment
to run all our node process.json description file use:
pm2 start /path/to/directory/pm2-scripts/*
Keymetrics is the pm2 monitoring gui
in order to use keyframe you need to link it to a pm2 instance
go here https://app.keymetrics.io/#/
- add new Bucket (free versions allow only 1 bucket at a time)
- use the link command specified after creating the bucket