我如何克隆我使用的测试仪上的文件系统? [英] How do i clone my filesystem on the dyno i'm using?

查看:101
本文介绍了我如何克隆我使用的测试仪上的文件系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Heroku免费托管解决方案的Facebook应用程序。当我启动我的应用程序时,一切正常。但是,当我使用以下命令克隆应用程序时,

heroku git:clone -a graffiti-galore



我收到了我放入服务器的所有文件。但我也想要我的php / flash应用程序创建的文件。有一堆图像文件被写入到文件系统,并且那个heroku git:clone -a graffiti-galore命令,它不会引入文件系统中的新文件。我知道他们在文件系统上,但我不知道如何检索它们。



请任何人?

解决方案

这是故意不可能的违反了十二因素架构的原则以及一些Heroku约束条件,如临时文件系统

想象一下你正在做一个 git push ,并且您的服务器同时也更改了您要更改的文件,导致出现无法在您手动干预下无法解决的冲突。 / p>

或者想象一下,如果您从一个测功机缩放到20个dynos,会发生什么情况。负载均衡器随机将请求发送到其中一个后端。一些图片上传最终在dyno 1上,一些在dyno 2上,一些在dyno 3上等等。你想如何跨所有实例同步数据?如果关闭具有非同步数据的打印机会发生什么情况?碰撞发生了什么?当启动100个其他dynos时,100 GB的存储上传会发生什么?这就是为什么你不能也不应该在本地文件系统上存储持久数据(比如用户上传)的原因;您需要使用专用的外部存储。有一篇关于上传到S3 此处的专门文章,您还可以直接上传如果您正确设置了CORS的详细信息,则可以在S3应用程序中使用。



您可能还没有意识到 heroku ps:restart heroku ps:scale 以及大约每24小时运行一次的自动操作,就像 git push heroku ,导致您的dynos重新启动,这意味着本地文件系统中的所有更改都将丢失。


I'm using Heroku the free hosting solution for facebook apps. When I launch my app everything works fine. But when I clone the app using the following command,

heroku git:clone -a graffiti-galore

I receive all of the files that I put to my server. But I also want the files that were created by my php/flash application. There are a bunch of image files that get written to the file system and wich that heroku git:clone -a graffiti-galore command, it doesn't bring in the new files that are on the filesystem. I know they are on the filesystem but I do not know how to retrieve them.

Please anybody?

解决方案

This is, intentionally, not possible and is against the principles of the Twelve-Factor architecture as well as several Heroku constraints like the ephemeral filesystem.

Imagine that you're doing a git push, and your server has in the meantime also changed a file you're pushing changes for, leading to a conflict that couldn't be resolved without your manual intervention.

Or imagine what would happen if you scaled from one dyno to 20 dynos. The load balancer randomly sends requests to one of those backends. Some image uploads end up on dyno 1, some on dyno 2, some on dyno 3 and so forth. How do you want that data synchronized across all instances? What happens if you shut one down that has unsynchronized data? What happens on a crash? What happens to 100 GB of stored uploads when you boot 100 other dynos? That's why you cannot and should not store persistent data (such as user uploads) on the local file system; you need to use dedicated external storage instead. There is a dedicated article on uploads to S3 here, and you could also upload straight to S3 from within your Flash app provided you set up the CORS details correctly.

You may also not realize that a heroku ps:restart, heroku ps:scale and an automatism that runs roughly every 24 hours will, just like a git push heroku, lead to your dynos restarting, meaning that all changes in the local file system will be lost.

这篇关于我如何克隆我使用的测试仪上的文件系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆