How to identify the node process ID?

To find the PID of the node process, you can either look in the pid file of in the log file.

Look in the pid file

The process ID is written in var/run/pid.

Look in the log file

Open the main log file (usually named node.log and located in the <installDir>/var/log directory) and look for the banner displayed when the node starts.

2014-08-08 15:16:43,407 [FelixStartLevel] INFO platform - ###############################################################################
2014-08-08 15:16:43,408 [FelixStartLevel] INFO platform - #                                                                             #
2014-08-08 15:16:43,408 [FelixStartLevel] INFO platform - #   JVM INFORMATION                                                           #
2014-08-08 15:16:43,408 [FelixStartLevel] INFO platform - #                                                                             #
2014-08-08 15:16:43,409 [FelixStartLevel] INFO platform - ###############################################################################
2014-08-08 15:16:43,411 [FelixStartLevel] INFO platform - Java home: /mnt/data/app/jdk1.7.0_60/jre
2014-08-08 15:16:43,411 [FelixStartLevel] INFO platform - Java version: 1.7.0_60
2014-08-08 15:16:43,412 [FelixStartLevel] INFO platform - Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
2014-08-08 15:16:43,412 [FelixStartLevel] INFO platform - Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
2014-08-08 15:16:43,412 [FelixStartLevel] INFO platform - Oracle Corporation Java HotSpot(TM) 64-Bit Server VM version 24.60-b09
2014-08-08 15:16:43,412 [FelixStartLevel] INFO platform - JIT compiler: HotSpot 64-Bit Tiered Compilers
2014-08-08 15:16:43,412 [FelixStartLevel] INFO platform - Runtime name: 17729@server
2014-08-08 15:16:43,413 [FelixStartLevel] INFO platform - Runtime arguments: [-Duser.timezone=, -Xms128M, -Xmx512M, -XX:MaxPermSize=128M, ...
...

The PID is the number displayed for the Runtime name property. In the above example, the PID is 17729.

On Linux, the following command prints the PID from the log:

$ grep -o 'Runtime name:\s[0-9]\+@' node.log | grep -o '[0-9]\+'

Related Links