gpt4 book ai didi

meteor - Digital Ocean 上的 meteor up (mup) 内存问题

转载 作者:行者123 更新时间:2023-12-02 06:33:36 25 4
gpt4 key购买 nike

我找不到与我的问题相关的现有帖子。在 Digital Ocean Droplet 上,mup 设置正常,但当我尝试部署时,出现以下错误。有任何想法吗?谢谢!

root@ts:~/ts-deploy# mup deploy

Meteor Up: Production Quality Meteor Deployments

Building Started: /root/TS/
Bundling Error: code=137, error:
-------------------STDOUT-------------------

Figuring out the best package versions to use. This may take a moment.

-------------------STDERR-------------------
bash: line 1: 31217 Killed meteor build --directory /tmp/dc37af3e-eca0-4a19-bf1a-d6d38bb8f517

下面是日志。 node -v 表示我使用的是 0.10.31。如何检查哪个脚本因错误而退出?还有其他想法吗?谢谢!

error: Forever detected script exited with code: 1
error: Script restart attempt #106
Meteor requires Node v0.10.29 or later.
error: Forever detected script exited with code: 1
error: Script restart attempt #107
Meteor requires Node v0.10.29 or later.
error: Forever detected script exited with code: 1
error: Script restart attempt #108

stepping down to gid: meteoruser
stepping down to uid: meteoruser

在我回到 DO Droplet 的旧备份并重新运行 mup setup 和 mup deploy 之后,我现在在命令行输出中得到了这个

Building Started: /root/TS
Bundling Error: code=134, error:
-------------------STDOUT-------------------

Figuring out the best package versions to use. This may take a moment.

-------------------STDERR-------------------
FATAL ERROR: JS Allocation failed - process out of memory
bash: line 1: 1724 Aborted (core dumped) meteor build --directory /tmp/bfdbcb45-9c61-435f-9875-3fb304358996

这在日志中:

 >> stepping down to gid: meteoruser
>> stepping down to uid: meteoruser
Exception while invoking method 'login' TypeError: Cannot read property '0' of undefined
at ServiceConfiguration.configurations.remove.service (app/server/accounts.js:7:26)
at Object.Accounts.insertUserDoc (packages/accounts-base/accounts_server.js:1024)
at Object.Accounts.updateOrCreateUserFromExternalService (packages/accounts-base/accounts_server.js:1189)
at Package (packages/accounts-oauth/oauth_server.js:45)
at packages/accounts-base/accounts_server.js:383
at tryLoginMethod (packages/accounts-base/accounts_server.js:186)
at runLoginHandlers (packages/accounts-base/accounts_server.js:380)
at Meteor.methods.login (packages/accounts-base/accounts_server.js:434)
at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1594)
at packages/ddp/livedata_server.js:648
Exception while invoking method 'login' TypeError: Cannot read property '0' of undefined
at ServiceConfiguration.configurations.remove.service (app/server/accounts.js:7:26)
at Object.Accounts.insertUserDoc (packages/accounts-base/accounts_server.js:1024)
at Object.Accounts.updateOrCreateUserFromExternalService (packages/accounts-base/accounts_server.js:1189)
at Package (packages/accounts-oauth/oauth_server.js:45)
at packages/accounts-base/accounts_server.js:383
at tryLoginMethod (packages/accounts-base/accounts_server.js:186)
at runLoginHandlers (packages/accounts-base/accounts_server.js:380)
at Meteor.methods.login (packages/accounts-base/accounts_server.js:434)
at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1594)
at packages/ddp/livedata_server.js:648

最佳答案

内存问题源于使用 DigitalOcean 的 5 美元 Droplet。为了解决这个问题,我added swap到服务器,如下所述。

使用 dd 命令创建并启用交换文件:

sudo dd if=/dev/zero of=/swapfile bs=1024 count=256k

“of=/swapfile”指定文件名。在这种情况下,名称是交换文件。

接下来通过创建一个 linux 交换区来准备交换文件:

sudo mkswap /swapfile

结果显示:

Setting up swapspace version 1, size = 262140 KiB
no label, UUID=103c4545-5fc5-47f3-a8b3-dfbdb64fd7eb

通过激活交换文件完成:

sudo swapon /swapfile

然后您将能够在查看交换摘要时看到新的交换文件。

swapon -s
Filename Type Size Used Priority
/swapfile file 262140 0 -1

此文件将保留在虚拟专用服务器上,直到机器重新启动。您可以通过将交换添加到 fstab 文件来确保交换是永久性的。

打开文件:

sudo nano /etc/fstab

粘贴以下行:

 /swapfile       none    swap    sw      0       0 

文件中的 Swappiness 应设置为 10。跳过此步骤可能会导致性能不佳,而将其设置为 10 将导致交换充当紧急缓冲区,防止内存不足崩溃。

您可以使用以下命令执行此操作:

echo 10 | sudo tee /proc/sys/vm/swappiness
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
To prevent the file from being world-readable, you should set up the correct permissions on the swap file:

sudo chown root:root /swapfile
sudo chmod 0600 /swapfile

关于meteor - Digital Ocean 上的 meteor up (mup) 内存问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26216127/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com