AWS托管更新覆盖本地文件



我正在使用AWS beanstall来托管我的一个应用程序。我的应用程序不断将本地配置文件保存到.properties和.csv文件中。一切都很好。

直到有一天,我注意到一切都回到了最初的状态:应用程序运行良好,但我在.properties中输入的所有配置和我保存到.csv中的历史记录都消失了。

我查看了豆茎即时历史,注意到AWS对实例进行了如下更新。我想,当AWS实现系统维护时,它只是用我为应用程序部署上传的最后一个.zip文件重新部署应用程序。

我知道我可以创建一个数据库来保存我输入的所有数据,但是,这将是一个很大的变化。

另一个选项(我现在正在使用(是简单地关闭托管更新功能。但由于现在不断更新和补丁,我的实例可能会慢慢消失。

你知道我如何保持托管更新的打开状态,而不是使用最后一个.zip文件来部署应用程序,而是在更新后使用当前工作目录(我认为它是/app目录(吗?

以下是AWS管理更新期间发生的情况:

2022-08-12 23:15:46 UTC+1000    
INFO
Environment update completed successfully.
2022-08-12 23:15:46 UTC+1000    
INFO
Successfully deployed new configuration to environment.
2022-08-12 23:14:38 UTC+1000    
INFO
Updating environment xxx-env's configuration settings.
2022-08-12 23:14:30 UTC+1000    
INFO
Environment update is starting.
2022-08-12 07:13:20 UTC+1000    
INFO
Environment health has transitioned from Info to Ok. Configuration update completed 83 seconds ago and took 11 minutes.
2022-08-12 07:12:37 UTC+1000    
INFO
Environment update completed successfully.
2022-08-12 07:12:37 UTC+1000    
INFO
Successfully deployed new configuration to environment.
2022-08-12 07:12:21 UTC+1000    
INFO
Removed instance [i-025394c6b5dc] from your environment.
2022-08-12 07:09:09 UTC+1000    
INFO
Deployment succeeded. Terminating old instances and temporary Auto Scaling group.
2022-08-12 07:07:50 UTC+1000    
INFO
Updating environment xxx-env's configuration settings.
2022-08-12 07:07:20 UTC+1000    
INFO
Waiting for post-deployment configuration to complete.
2022-08-12 07:07:16 UTC+1000    
INFO
Instance deployment completed successfully.
2022-08-12 07:06:39 UTC+1000    
INFO
Starting post-deployment configuration on new instances.
2022-08-12 07:06:11 UTC+1000    
INFO
Attached new instance(s) to the permanent auto scaling group awseb-e-wiuxjqswqj-stack-AWSEBAutoScalingGroup-AV.
2022-08-12 07:06:07 UTC+1000    
INFO
Detached new instance(s) from temporary auto scaling group awseb-e-wiuxjqswqj-immutable-stack-AWSEBAutoScalingGroup-1I2W.
2022-08-12 07:04:29 UTC+1000    
INFO
Waiting for instance(s) (i-0463ad18900a) to pass health checks. 
2022-08-12 07:03:21 UTC+1000    
INFO
Added instance [i-0463ad18900a] to your environment.
2022-08-12 07:03:21 UTC+1000    
INFO
Environment health has transitioned from Ok to Info. Configuration update in progress on 1 instance. 0 out of 1 instance completed (running for 2 minutes). All instances are in same availability zone (us-west-2c).
2022-08-12 07:00:52 UTC+1000    
INFO
Created temporary auto scaling group awseb-e-wiuxjqswqj-immutable-stack-AWSEBAutoScalingGroup-1I2.
2022-08-12 07:00:21 UTC+1000    
INFO
Immutable deployment policy enabled. Launching one instance with the new settings to verify health.
2022-08-12 07:00:13 UTC+1000    
INFO
Environment update is starting.
2022-08-12 07:00:11 UTC+1000    
INFO
Managed platform update is in-progress.

我的应用程序不断将本地配置文件保存到.properties和.csv文件中。一切都很好。

任何部署、自动扩展事件、托管更新或失败的实例恢复都可能删除您存储到本地Elastic Beanstalk磁盘的文件。您可以从不将文件写入本地Elastic Beanstalk磁盘!

您应该更改应用程序以将数据写入持久数据库,或者使用弹性文件系统(EFS(卷将文件写入。

最新更新