3 个 Magento 服务器迁移到 1 个 - 产品图像
我最近开始在一家在线销售大量产品的公司工作。随着业务的增长,他们没有寻求更具可扩展性的托管解决方案,而是通过托管提供商添加了 VPS 实例,在现在的三台 VPS 机器之间创建了 SSH 隧道以促进本地 MySQL 连接,并将不同的域分配给不同的 VPS机器。
我已经整理出了我们现在要迁移到的大型可扩展服务器,并以与我们拥有的三台 VPS 服务器相同的方式设置了新服务器。
我将一台服务器的 Magento 安装内容 rsync 到我的本地计算机,进行了一些测试,更改了一些配置选项,并且上传后,一切都可以在新服务器上运行。我遇到的问题是,对于某些网站(三台 VPS 机器上分布着大约 15 个网站),没有产品图片。
我认为这是因为 Magento 已将这些产品图像放入域分配到的服务器的文件系统中。
我的问题确实是,将 ./media/catalog 的内容从每个 VPS 服务器同步到主服务器是否安全,或者 Magento 是否创建自己的文件结构并在这样做时可能会覆盖某些内容?
希望你们能指出我正确的方向。
干杯,
戴夫
I recently started working for a company that sells a large amount of products online. As the business grew, instead of looking towards a more scalable solution for their hosting they have just added VPS instances with their hosting provider, created an SSH tunnel between the now three VPS machines to facilitate a local MySQL connection and assigned different domains to different VPS machines.
I've sorted out a large, scalable server that we're now migrating to and have setup the new server to be configured in the same way as the three VPS servers we have.
I had rsync'd the contents of one server's Magento installation down to my local machine, did some testing, changed some configuration options and everything works on the new server once uploaded. The issue that I'm having is that with some sites (there are around 15 spread across the three VPS machines), there are no product images.
I assume this is because Magento has put these product images in the file system of the server that domain is assigned to.
My question really is, is it safe to rsync the contents of ./media/catalog from each VPS server to the main server, or does Magento create a file-structure of its own and in doing that may overwrite things?
Hope you guys can point me in the right direction.
Cheers,
Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用类似的设置。我们至少有 3 台负载平衡服务器,通过 SSH 隧道从一个数据库运行。
您对 Magento 存储图像的位置是正确的。当 Magento 在 /magento/media/ 中创建图像时,它将使用文件名的前两个字符创建两个文件夹。例如,上传到目录的名为“Image1.jpg”的文件将转到:
我们没有将所有其他服务器重新同步,而是将管理区域设置为直接解析到主服务器,并从主服务器重新同步媒体文件每 5 分钟左右向其他人发出一次。
无论如何,这都不是一个完美的解决方案,但目前它对我们有用。我们研究过在服务器之间共享文件系统,但这有其自身的缺点。
希望这有帮助。
I work with a similar set up. We have a minimum 3 load balanced servers that operate from one database with an SSH tunnel.
You're right about where Magento is storing the images. When Magento creates images in /magento/media/ it will create two folders with the first two characters of the filename. eg a file named "Image1.jpg" uploaded to the catalog will go to:
Instead of rsyncing all the other servers back, we have set up our admin area to resolve directly to the main server, and rsync the media files from the main server out to the others every 5 minutes or so.
It's not a perfect solution by any means, but it works for us at the moment. We've looked at sharing a file system between the servers, but that has it's own drawbacks.
Hope this helps.