jackieli123723 / jackieli123723.github.io

✅lilidong 个人博客
9 stars 0 forks source link

linux+node常用命令 #52

Open jackieli123723 opened 6 years ago

jackieli123723 commented 6 years ago

node系统进程

[worker@ali-ly-basic-data-118 ~]$ ps -aux|grep node
worker    1243  0.0  0.0 977028 12916 ?        Sl    2017   0:00 node app.js
worker    6670  0.0  0.1 938728 43908 ?        Ssl  Mar05   4:37 node /home/worker/node-server-longyaun-mall-c/longyuan-rms-front/deploy.js
worker    6944  0.0  0.1 940036 46324 ?        Ssl  Mar06   4:27 node /home/worker/node-server-longyaun-mall-c/longyuan-gm-all-front/deploy.js
worker    7815  0.0  0.0 925808 28224 ?        Ssl   2017  42:06 node /home/worker/node-server-longyaun-mall-c/longyuan-store-mobile-front/deploy.js
worker   10330  0.0  0.1 938856 42176 ?        Ssl  Jan26  25:03 node /home/worker/node-server-longyaun-mall-c/webhook/node-sever/vue-longyuan-store-front/koa-
worker   10527  0.0  0.1 930956 35788 ?        Ssl  Feb27   7:43 node /home/worker/node-server-longyaun-mall-c/webhook/auto-deploy/index-email.js
worker   10532  0.0  0.1 929420 33088 ?        Ssl  Feb27   7:38 node /home/worker/node-server-longyaun-mall-c/webhook/auto-deploy/angular-longyuan-store-front
worker   10537  0.0  0.1 1201144 40384 ?       Ssl  Feb27   7:44 node /home/worker/node-server-longyaun-mall-c/webhook/auto-deploy/longyuan-rms-front_onlineTes
worker   10544  0.0  0.1 1067392 36780 ?       Ssl  Feb27   7:43 node /home/worker/node-server-longyaun-mall-c/webhook/auto-deploy/longyuan_gm_all_front_online
worker   10557  0.0  0.1 1201984 41616 ?       Ssl  Feb27   8:16 node /home/worker/node-server-longyaun-mall-c/webhook/auto-deploy/monit.js
root     11686  0.0  0.0 882144 13016 ?        Sl   Feb10   0:00 node --expose-http2 index.js http2-https
worker   12157  0.0  0.1 1248312 59012 ?       Ssl  Jan24  26:00 node /home/worker/node-server-longyaun-mall-c/webhook/node-sever/vue-longyuan-store-front/api.
root     15807 22.5  0.0 596436 10836 ?        Ssl  Feb10 10011:36 python /home/worker/node-server-longyaun-mall-c/webhook/node-sever/python/upload.py
worker   17747  0.0  0.1 934316 34612 ?        Ssl  Jan26  24:07 node /home/worker/node-server-longyaun-mall-c/webhook/node-sever/angular-longyuan-store-front-
worker   21528  0.0  0.1 1026924 56680 ?       Ssl  Mar08   2:55 node /home/worker/node-server-longyaun-mall-c/webhook/node-sever/node-ai-speech/bin/www
worker   22426  0.0  0.1 937700 39284 ?        Ssl  Jan24  24:56 node /home/worker/node-server-longyaun-mall-c/webhook/node-sever/vue-longyuan-store-front-mobi
worker   22431  0.0  0.1 1248188 59052 ?       Ssl  Jan24  25:47 node /home/worker/node-server-longyaun-mall-c/webhook/node-sever/vue-longyuan-store-front-mobi
worker   28303  1.4  0.0 917980 27144 ?        Ssl  13:11   0:00 node /home/worker/node-server-longyaun-mall-c/webhook/auto-deploy/longyuan_gm_all_front_online
worker   28361  0.0  0.0 112652   976 pts/2    S+   13:12   0:00 grep --color=auto node

node监听端口

[worker@ali-ly-basic-data-118 ~]$ netstat -ntlp|grep node
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:3001          0.0.0.0:*               LISTEN      1243/node
tcp6       0      0 :::9200                 :::*                    LISTEN      10330/node /home/wo
tcp6       0      0 :::7000                 :::*                    LISTEN      17747/node /home/wo
tcp6       0      0 :::9210                 :::*                    LISTEN      22426/node /home/wo
tcp6       0      0 :::7100                 :::*                    LISTEN      6944/node /home/wor
tcp6       0      0 :::3004                 :::*                    LISTEN      22431/node /home/wo
tcp6       0      0 :::3008                 :::*                    LISTEN      12157/node /home/wo
tcp6       0      0 :::7777                 :::*                    LISTEN      10527/node /home/wo
tcp6       0      0 :::7778                 :::*                    LISTEN      10537/node /home/wo
tcp6       0      0 :::7779                 :::*                    LISTEN      10532/node /home/wo
tcp6       0      0 :::4900                 :::*                    LISTEN      6670/node /home/wor
tcp6       0      0 :::7780                 :::*                    LISTEN      10544/node /home/wo
tcp6       0      0 :::5000                 :::*                    LISTEN      7815/node /home/wor
tcp6       0      0 :::9001                 :::*                    LISTEN      21528/node /home/wo

结束进程

 ps -aux|grep node
kill -9 18299

日志

 tail -f ~/.forever/forever.log

通用dockerfile

FROM node:7
MAINTAINER Mumudeveloper
#hardcode
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime //服务器时间本地化
RUN yarn global add forever

# Create www directory
RUN mkdir -p /api
COPY ./api /api

# Install www dependencies
WORKDIR /api
RUN yarn install

EXPOSE 7001
# Define default command.  
ENTRYPOINT forever start  -l forever.log -a index.js && tail -f ~/.forever/forever.log

node安装目录

$ which node
/d/Program Files/nodejs/node

$ which nodejs