推弹性魔豆删除服务器上创建的文件弹性、器上、魔豆、文件

2023-09-11 12:15:14 作者:污到你湿

我跑我的松紧豆茎PHP应用程序。无论何时,我把更新从我的本地库,使用混帐aws.push ,一个名为图片连同它的所有内容被从服务器中删除。这个目录的本地版本将被添加到的.gitignore ,因为我不想把它推到服务器。在服务器上的目录应保持不动,因为它包含的上载图像。我应该如何阻止我每次按压时间被删除的目录?

I run my php application on elastic beanstalk. Whenever, I push updates from my local repository, using git aws.push, a directory called picture along with it's all content is deleted from server. The local version of this directory is added to .gitignore, because I don't want to push it to the server. The directory on server should remain intact, as it contains uploaded images. How should I stop the directory from being deleted every time I push?

推荐答案

最喜欢的平台即服务提供商,弹性魔豆不提供持久的文件系统:在

Like most Platform as a Service providers, Elastic Beanstalk does not provide a persistent filesystem:

AWS弹性魔豆的应用程序上没有永久的本地存储的Amazon EC2实例上运行。当亚马逊EC2实例终止,本地文件系统不会被保存,新的亚马逊EC2实例启动使用默认的文件系统。您应该设计自己的应用程序将数据存储在一个持久数据源。亚马逊网络服务提供了许多的持久存储选项,您可以利用您的应用程序,包括

Persistent Storage

AWS Elastic Beanstalk applications run on Amazon EC2 instances that have no persistent local storage. When the Amazon EC2 instances terminate, the local file system is not saved, and new Amazon EC2 instances start with a default file system. You should design your application to store data in a persistent data source. Amazon Web Services offers a number of persistent storage options that you can leverage for your application, including    亚马逊简单存储服务(Amazon S3)。有关Amazon S3的更多信息,请访问文档。    亚马逊的弹性块存储(亚马逊EBS)。欲了解更多信息,请访问文档又见文章的专题指南:弹性块存储。    亚马逊DynamoDB 。欲了解更多信息,请访问文档。对于使用亚马逊DynamoDB与AWS弹性魔豆示例,请参阅例:DynamoDB,CloudWatch的,和SNS    亚马逊关系数据库服务(Amazon RDS)。欲了解更多信息,请访问文档又见的亚马逊RDS为C#开发人员。    Amazon Simple Storage Service (Amazon S3). For more information about Amazon S3, go to the documentation. Amazon Elastic Block Store (Amazon EBS). For more information, go to the documentation and see also the article Feature Guide: Elastic Block Store. Amazon DynamoDB. For more information, go to the documentation. For an example using Amazon DynamoDB with AWS Elastic Beanstalk, see Example: DynamoDB, CloudWatch, and SNS. Amazon Relational Database Service (Amazon RDS). For more information, go to the documentation and see also Amazon RDS for C# Developers.

这意味着你不能动态存储文件,并期望他们生存的新的部署。

This means that you cannot store files dynamically and expect them to survive a new deployment.

推荐的解决方案是使用像S3云文件存储提供商

The recommended solution is to use a cloud file storage provider like S3.