pm2 部署到 ubuntu 12.0 的 aws micro 实例

pm2 部署到 ubuntu 12.0 的 aws micro 实例

我运行了一个似乎挂起的 pm2 部署脚本,我正在运行一个运行 ubuntu 12 的 aws EC2 Micro 实例。我能知道的唯一错误迹象是我在尝试 ssh 时收到的一条消息
System information disabled due to load higher than 1.0

这是我的 pm2 配置,我想知道的是解决这个问题的最佳后续步骤是什么,我应该停止并启动我的实例,然后重新运行我的 pm2 部署脚本吗?我能够 ssh 进入,但无法运行任何命令。(好吧,我可以运行一些命令,但它非常非常慢,ls需要 3 分钟左右)

module.exports = {
    apps: [
      {
        name: "Website",
        script: "npm",
        args: "start",
        watch: false,
        env: {
          NODE_ENV: "development",
          URL: "http://dev.website.com",
        },
      },
    ],
  
    deploy: {
      development: {
        key: "~/.ssh/website.pem",
        user: "ubuntu",
        host: "ec2-random.compute-1.amazonaws.com",
        ref: "origin/development",
        repo: "[email protected]:website/website.git",
        path: "/home/ubuntu/website",
        "pre-deploy-local": "",
        "post-deploy":
          "npm install && pm2 reload ecosystem.config.js --env development && npm install -g gatsby-cli",
        "pre-setup": "",
      },
    },
  }

更新:我终于从 ubuntu ssh 实例的终端中得到了一些返回结果,需要注意的一点是 pm2 deploy 仍在运行,我只需按 ctrl+c 即可显示部署成功,因此不确定它是否在不断重复执行某项操作。以下是运行以下命令(pm2 logs 和 ls)的输出

ubuntu@ip-172-31-48-164:~$ Failed to import the site module
ls
Traceback (most recent call last):
  File "/usr/lib/python3.6/site.py", line 570, in <module>
studioConscious
    main()
  File "/usr/lib/python3.6/site.py", line 557, in main
ubuntu@ip-172-31-48-164:~$     known_paths = addsitepackages(known_paths)
  File "/usr/lib/python3.6/site.py", line 345, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "/usr/lib/python3.6/site.py", line 213, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "/usr/lib/python3.6/site.py", line 174, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.6/types.py", line 171, in <module>
    import functools as _functools
  File "/usr/lib/python3.6/functools.py", line 21, in <module>
    from collections import namedtuple
  File "/usr/lib/python3.6/collections/__init__.py", line 26, in <module>
    from operator import itemgetter as _itemgetter, eq as _eq
  File "/usr/lib/python3.6/operator.py", line 22, in <module>
    from builtins import abs as _abs
  File "<frozen importlib._bootstrap>", line 1007, in _handle_fromlist
KeyboardInterrupt

答案1

我最终重新启动并再次运行部署脚本,现在它可以正常工作了。如果有人能解释一下它为什么挂起,我会选择它作为答案。

谢谢

相关内容