Skip to content

Instantly share code, notes, and snippets.

@Unitech
Last active August 29, 2015 14:07
Show Gist options
  • Save Unitech/35c5e7a21e363099f3c6 to your computer and use it in GitHub Desktop.
Save Unitech/35c5e7a21e363099f3c6 to your computer and use it in GitHub Desktop.
[root@pm2-test-centos examples]# node -v
v0.10.32
[root@pm2-test-centos examples]# pm2 start child.js -i 1
Starting PM2 daemon...
[PM2] You shouldn't use the cluster_mode with node 0.10.x. Instead use fork mode with -x
[PM2] Process child.js launched
┌──────────┬────┬─────────┬──────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼──────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ child │ 0 │ cluster │ 9874 │ online │ 0 │ 0s │ 11.387 MB │ unactivated │
└──────────┴────┴─────────┴──────┴────────┴───────────┴────────┴─────────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
[root@pm2-test-centos examples]# lsof -i | grep "pm2"
pm2: 9872 root 13u IPv4 419571940 0t0 TCP *:irdmi (LISTEN)
pm2: 9874 root 13u IPv4 419571940 0t0 TCP *:irdmi (LISTEN)
[root@pm2-test-centos examples]# pm2 stop all
[PM2] Stopping all
[PM2] stopProcessId process id 0
┌──────────┬────┬─────────┬──────┬─────────┬───────────┬────────┬────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼──────┼─────────┼───────────┼────────┼────────┼─────────────┤
│ child │ 0 │ cluster │ 9874 │ stopped │ 0 │ 0 │ 0 B │ unactivated │
└──────────┴────┴─────────┴──────┴─────────┴───────────┴────────┴────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
[root@pm2-test-centos examples]# lsof -i | grep "pm2"
pm2: 9872 root 13u IPv4 419571940 0t0 TCP *:irdmi (LISTEN)
[root@pm2-test-centos examples]#
[root@pm2-test-centos examples]# node -v
v0.11.14
[root@pm2-test-centos examples]# pm2 start child.js -i 1
Starting PM2 daemon...
[PM2] Process child.js launched
┌──────────┬────┬─────────┬───────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼───────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ child │ 0 │ cluster │ 10189 │ online │ 0 │ 0s │ 15.508 MB │ unactivated │
└──────────┴────┴─────────┴───────┴────────┴───────────┴────────┴─────────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
[root@pm2-test-centos examples]# lsof -i | grep "pm2"
pm2: 10188 root 14u IPv6 419572986 0t0 TCP *:irdmi (LISTEN)
[root@pm2-test-centos examples]# pm2 stop all
[PM2] Stopping all
[PM2] stopProcessId process id 0
┌──────────┬────┬─────────┬───────┬─────────┬───────────┬────────┬────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼───────┼─────────┼───────────┼────────┼────────┼─────────────┤
│ child │ 0 │ cluster │ 10189 │ stopped │ 0 │ 0 │ 0 B │ unactivated │
└──────────┴────┴─────────┴───────┴─────────┴───────────┴────────┴────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
[root@pm2-test-centos examples]# lsof -i | grep "pm2"
[root@pm2-test-centos examples]#
[root@pm2-test-centos examples]# node -v
v0.10.32
[root@pm2-test-centos examples]# pm2 -v
0.10.8
[root@pm2-test-centos examples]# pm2 start child.js -i 1
[PM2] You shouldn't use the cluster_mode with node 0.10.x. Instead use fork mode with -x
[PM2] Process child.js launched
┌──────────┬────┬─────────┬───────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼───────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ child │ 0 │ cluster │ 10420 │ online │ 0 │ 0s │ 11.391 MB │ unactivated │
└──────────┴────┴─────────┴───────┴────────┴───────────┴────────┴─────────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
[root@pm2-test-centos examples]# lsof -i | grep "pm2"
pm2: 10411 root 10u IPv4 419573624 0t0 TCP *:ircu-2 (LISTEN)
pm2: 10411 root 11u IPv4 419573625 0t0 TCP *:ircu-3 (LISTEN)
pm2: 10411 root 13u IPv4 419573668 0t0 TCP *:irdmi (LISTEN)
pm2: 10420 root 0u IPv4 419573658 0t0 TCP localhost:ircu-2->localhost:60714 (CLOSE_WAIT)
pm2: 10420 root 13u IPv4 419573668 0t0 TCP *:irdmi (LISTEN)
[root@pm2-test-centos examples]# pm2 stop all
[PM2] Stopping all
[PM2] All processes stopped
┌──────────┬────┬─────────┬─────┬─────────┬───────────┬────────┬────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼─────┼─────────┼───────────┼────────┼────────┼─────────────┤
│ child │ 0 │ cluster │ 0 │ stopped │ 0 │ 0 │ 0 B │ unactivated │
└──────────┴────┴─────────┴─────┴─────────┴───────────┴────────┴────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
[root@pm2-test-centos examples]# lsof -i | grep "pm2"
pm2: 10411 root 10u IPv4 419573624 0t0 TCP *:ircu-2 (LISTEN)
pm2: 10411 root 11u IPv4 419573625 0t0 TCP *:ircu-3 (LISTEN)
pm2: 10411 root 13u IPv4 419573668 0t0 TCP *:irdmi (LISTEN)
[root@pm2-test-centos examples]# pm2 restart all
[PM2] Process child restarted
[PM2] All processes has been restarted
┌──────────┬────┬─────────┬───────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼───────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ child │ 0 │ cluster │ 10442 │ online │ 0 │ 1s │ 11.871 MB │ unactivated │
└──────────┴────┴─────────┴───────┴────────┴───────────┴────────┴─────────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
[root@pm2-test-centos examples]# lsof -i | grep "pm2"
pm2: 10411 root 10u IPv4 419573624 0t0 TCP *:ircu-2 (LISTEN)
pm2: 10411 root 11u IPv4 419573625 0t0 TCP *:ircu-3 (LISTEN)
pm2: 10411 root 13u IPv4 419573668 0t0 TCP *:irdmi (LISTEN)
pm2: 10442 root 0u IPv4 419573806 0t0 TCP localhost:ircu-2->localhost:60722 (CLOSE_WAIT)
pm2: 10442 root 13u IPv4 419573668 0t0 TCP *:irdmi (LISTEN)
pm2: 10442 root 14u IPv4 419573815 0t0 TCP 178.62.15.149:irdmi->aut75-4-82-230-229-202.fbx.proxad.net:44639 (ESTABLISHED)
pm2: 10442 root 15u IPv4 419573823 0t0 TCP 178.62.15.149:irdmi->aut75-4-82-230-229-202.fbx.proxad.net:44643 (ESTABLISHED)
[root@pm2-test-centos examples]# pm2 stop all
[PM2] Stopping all
[PM2] All processes stopped
┌──────────┬────┬─────────┬─────┬─────────┬───────────┬────────┬────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼─────┼─────────┼───────────┼────────┼────────┼─────────────┤
│ child │ 0 │ cluster │ 0 │ stopped │ 0 │ 0 │ 0 B │ unactivated │
└──────────┴────┴─────────┴─────┴─────────┴───────────┴────────┴────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
[root@pm2-test-centos examples]# lsof -i | grep "pm2"
pm2: 10411 root 10u IPv4 419573624 0t0 TCP *:ircu-2 (LISTEN)
pm2: 10411 root 11u IPv4 419573625 0t0 TCP *:ircu-3 (LISTEN)
pm2: 10411 root 13u IPv4 419573668 0t0 TCP *:irdmi (LISTEN)
[root@pm2-test-centos examples]# curl http://localhost:8000 -m 5
curl: (28) Operation timed out after 5158 milliseconds with 0 out of -1 bytes received
[root@pm2-test-centos examples]#
shant@ultraio: ~/keymetrics/pm2
$ node -v
v0.10.32
shant@ultraio: ~/keymetrics/pm2
$ ./bin/pm2 start examples/child.js -i 1
Starting PM2 daemon...
[PM2] You shouldn't use the cluster_mode with node 0.10.x. Instead use fork mode with -x
[PM2] Process examples/child.js launched
┌──────────┬────┬─────────┬──────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼──────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ child │ 0 │ cluster │ 8660 │ online │ 0 │ 0s │ 13.414 MB │ unactivated │
└──────────┴────┴─────────┴──────┴────────┴───────────┴────────┴─────────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
shant@ultraio: ~/keymetrics/pm2
$ lsof -i | grep "pm2"
pm2: 8658 shant 13u IPv4 914249 0t0 TCP *:8000 (LISTEN)
pm2: 8660 shant 13u IPv4 914249 0t0 TCP *:8000 (LISTEN)
shant@ultraio: ~/keymetrics/pm2
$ ./bin/pm2 stop all
[PM2] Stopping all
[PM2] stopProcessId process id 0
┌──────────┬────┬─────────┬──────┬─────────┬───────────┬────────┬────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼──────┼─────────┼───────────┼────────┼────────┼─────────────┤
│ child │ 0 │ cluster │ 8660 │ stopped │ 0 │ 0 │ 0 B │ unactivated │
└──────────┴────┴─────────┴──────┴─────────┴───────────┴────────┴────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
shant@ultraio: ~/keymetrics/pm2
$ lsof -i | grep "pm2"
pm2: 8658 shant 13u IPv4 914249 0t0 TCP *:8000 (LISTEN)
shant@ultraio: ~/keymetrics/pm2
$
shant@ultraio: ~/keymetrics/pm2
$ node -v
v0.11.14
shant@ultraio: ~/keymetrics/pm2
$ ./bin/pm2 start examples/child.js -i 1
Starting PM2 daemon...
[PM2] Process examples/child.js launched
┌──────────┬────┬─────────┬──────┬────────┬───────────┬────────┬─────────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼──────┼────────┼───────────┼────────┼─────────────┼─────────────┤
│ child │ 0 │ cluster │ 8967 │ online │ 0 │ 0s │ 15.836 MB │ unactivated │
└──────────┴────┴─────────┴──────┴────────┴───────────┴────────┴─────────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
shant@ultraio: ~/keymetrics/pm2
$ lsof -i | grep "pm2"
pm2: 8962 shant 14u IPv6 938751 0t0 TCP *:8000 (LISTEN)
shant@ultraio: ~/keymetrics/pm2
$ ./bin/pm2 stop all
[PM2] Stopping all
[PM2] stopProcessId process id 0
┌──────────┬────┬─────────┬──────┬─────────┬───────────┬────────┬────────┬─────────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
├──────────┼────┼─────────┼──────┼─────────┼───────────┼────────┼────────┼─────────────┤
│ child │ 0 │ cluster │ 8967 │ stopped │ 0 │ 0 │ 0 B │ unactivated │
└──────────┴────┴─────────┴──────┴─────────┴───────────┴────────┴────────┴─────────────┘
Use `pm2 desc[ribe] <id>` to get more details
shant@ultraio: ~/keymetrics/pm2
$ lsof -i | grep "pm2"
shant@ultraio: ~/keymetrics/pm2
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment