简体   繁体   English

Node.js应用程序的PM2错误

[英]PM2 error with Node.js application

I am running a Node.js application with MongoDB on Ubuntu. 我在Ubuntu上使用MongoDB运行Node.js应用程序。 As lightweight server I am using NGINX. 作为轻量级服务器,我正在使用NGINX。 My current system information are: 我当前的系统信息是:

  • System load: 0.01 系统负载:0.01
  • Processes: 77 工序:77
  • Usage of /: 16.9% of 19.56GB /的使用率:19.56GB的16.9%
  • Users logged in: 1 已登录的用户:1
  • Memory usage: 57% 内存使用率:57%
  • Swap usage: 0% 掉期使用:0%

After reload a site I am getting following message with pm2 logs command 重新加载网站后,我得到以下消息与pm2 logs命令

PM2 App [app] with id [0] and pid [8180], exited with code [0] via signal [SIGKILL] PM2 Starting execution sequence in -fork mode- for app name:app id:0 PM2 App name:app id:0 online ID为[0]和pid为[8180]的PM2应用[app],通过信号[SIGKILL]以代码[0]退出。PM2以-fork模式-为应用名称:app id:0 PM2启动执行序列:0在线

I recognize if I am using less data then I am getting the error not so many times. 我知道如果我使用的数据较少,那么我得到的错误就不会那么多了。 Maybe I will need more memory space or what could be the problem? 也许我将需要更多的存储空间,或者可能是什么问题?

My NGINX configuration looks like: 我的NGINX配置如下所示:

sudo vi /etc/nginx/sites-available/default


server {
    listen 80;

    server_name example.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Many thanx for your help 多谢您的帮助

More Information: 更多信息:

I have recognized that my size(around 9 GB) of db is bigger then the storage size(aroung 3 GB): 我认识到我的数据库大小(大约9 GB)比存储大小(大约3 GB)大:

db.stats()
{
    "db" : "testDB",
    "collections" : 3,
    "objects" : 9632,
    "avgObjSize" : 974.0099667774086,
    "dataSize" : 9381664,
    "storageSize" : 3354624,
    "numExtents" : 0,
    "indexes" : 3,
    "indexSize" : 159744,
    "ok" : 1
}

Maybe it will help to resize the mongodb space? 也许将有助于调整mongodb空间的大小? How can I do that? 我怎样才能做到这一点?

There isn't enough information in the error message you posted to diagnose the problem. 您发布的错误消息中没有足够的信息来诊断问题。 It looks like your node script is hitting some problem and exiting, but doesn't say what the underlying error is. 看来您的节点脚本遇到了一些问题并退出了,但没有说明潜在的错误是什么。 Can you post more of the error message? 您可以发布更多错误消息吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM