Laravel AWS Elastic Beanslack 部署错误 - 内存不足错误
Laravel AWS Elastic Beanslack deployment error- Out of memory error
我在 AWS Elastic Beanslack 中部署了我的应用程序。最初,我直接在 Aws 控制台中部署了我的应用程序。配置完所有东西后。我压缩了我的代码并将其上传到控制台中。当时它的工作完美。
但是现在我尝试用cli部署,它显示错误。我把 eb deploy
命令
Creating application version archive "app-xxxxxxxxx".
Uploading: [##################################################] 100% Done...
2020-03-14 18:51:49 INFO Environment update is starting.
2020-03-14 18:51:55 INFO Deploying new version to instance(s).
2020-03-14 18:52:22 ERROR [Instance: i-xxxxxxxxx] Command failed on instance. Return code: 255 Output: (TRUNCATED)...ar/src/Composer/DependencyResolver/GenericRule.php on line 36
Fatal error: Out of memory (allocated 809508864) (tried to allocate 8192 bytes) in phar:///opt/elasticbeanstalk/support/composer.phar/src/Composer/DependencyResolver/GenericRule.php on line 36.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2020-03-14 18:52:22 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-03-14 18:52:22 ERROR Unsuccessful command execution on instance id(s) 'i-xxxxxxxxx'. Aborting the operation.
2020-03-14 18:52:23 ERROR Failed to deploy application.
从互联网上我尝试了所有这些东西
1) 我在 php.ini 中扩展了内存,但仍然无法正常工作
2) 我创建了 ebextensions 文件夹并做了一些配置,但那也不起作用
我的猜测是最初我手动部署,所以当时我也压缩了供应商文件夹。现在,当我尝试使用 cli 时,它不会占用供应商文件夹。而不是使用 composer install
所以我认为由于这些事情我正面临这个问题
如果我想做任何其他事情,请告诉我们
这是 ElasticBeanstalk 环境中的配置。
增加内存限制:
- 访问 Elastic Beanstalk 部分
- 对您的环境开放
- 转到
Configuration
,然后 Software
- 找到
Memory limit
字段。默认值为 1024M。
- 将值更新为您想要的值
- 应用更改
- 重新部署您的应用程序
使用 ElasticBeanstalk (ELB) 部署时,我们应该检查环境。使用 memory_limit,您可以在“软件”选项卡(配置)
中进行配置
关注:
- 访问 ELB
- 对您的环境开放
- 转到“配置”,然后“软件”选项卡
- 找到内存限制字段。
- 根据需要更改值
- 重新部署
我在 AWS Elastic Beanslack 中部署了我的应用程序。最初,我直接在 Aws 控制台中部署了我的应用程序。配置完所有东西后。我压缩了我的代码并将其上传到控制台中。当时它的工作完美。
但是现在我尝试用cli部署,它显示错误。我把 eb deploy
命令
Creating application version archive "app-xxxxxxxxx".
Uploading: [##################################################] 100% Done...
2020-03-14 18:51:49 INFO Environment update is starting.
2020-03-14 18:51:55 INFO Deploying new version to instance(s).
2020-03-14 18:52:22 ERROR [Instance: i-xxxxxxxxx] Command failed on instance. Return code: 255 Output: (TRUNCATED)...ar/src/Composer/DependencyResolver/GenericRule.php on line 36
Fatal error: Out of memory (allocated 809508864) (tried to allocate 8192 bytes) in phar:///opt/elasticbeanstalk/support/composer.phar/src/Composer/DependencyResolver/GenericRule.php on line 36.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2020-03-14 18:52:22 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-03-14 18:52:22 ERROR Unsuccessful command execution on instance id(s) 'i-xxxxxxxxx'. Aborting the operation.
2020-03-14 18:52:23 ERROR Failed to deploy application.
从互联网上我尝试了所有这些东西 1) 我在 php.ini 中扩展了内存,但仍然无法正常工作 2) 我创建了 ebextensions 文件夹并做了一些配置,但那也不起作用
我的猜测是最初我手动部署,所以当时我也压缩了供应商文件夹。现在,当我尝试使用 cli 时,它不会占用供应商文件夹。而不是使用 composer install
所以我认为由于这些事情我正面临这个问题
如果我想做任何其他事情,请告诉我们
这是 ElasticBeanstalk 环境中的配置。
增加内存限制:
- 访问 Elastic Beanstalk 部分
- 对您的环境开放
- 转到
Configuration
,然后Software
- 找到
Memory limit
字段。默认值为 1024M。 - 将值更新为您想要的值
- 应用更改
- 重新部署您的应用程序
使用 ElasticBeanstalk (ELB) 部署时,我们应该检查环境。使用 memory_limit,您可以在“软件”选项卡(配置)
中进行配置关注:
- 访问 ELB
- 对您的环境开放
- 转到“配置”,然后“软件”选项卡
- 找到内存限制字段。
- 根据需要更改值
- 重新部署