通过FTP传输到Google存储空间 [英] FTP to Google Storage
问题描述
有些文件每天都会上传到FTP服务器,我需要Google Cloud Storage下的那些文件.我不想惹麻烦上传文件的用户来安装任何其他软件,而只是让他们继续使用其FTP客户端. 有没有办法将GCS用作FTP服务器?如果没有,如何创建一个定期从FTP位置提取文件并将其放入GCS的作业? 换句话说:什么是最好和最简单的方法?
Some files get uploaded on a daily basis to an FTP server and I need those files under Google Cloud Storage. I don't want to bug the users that upload the files to install any additional software and just let them keep using their FTP client. Is there a way to use GCS as an FTP server? If not, how can I create a job that periodically picks up the files from an FTP location and puts them in GCS? In other words: what's the best and simplest way to do it?
推荐答案
我已经在Google Compute的VM中使用gcsfs成功地为GCS设置了FTP代理(由 http://ilyapimenov.com/blog/2015/01/19/ftp-proxy-to-gcs.html
I have successfully set up an FTP proxy to GCS using gcsfs in a VM in Google Compute (mentioned by jkff in the comment to my question), with these instructions: http://ilyapimenov.com/blog/2015/01/19/ftp-proxy-to-gcs.html
但是需要一些更改:
- 在/etc/vsftpd.conf中将#write_enable = YES更改为 write_enable = YES
- 在您的GC项目中添加防火墙规则以允许 访问端口21和被动端口15393至15592( https://console.cloud.google .com/networking/firewalls/list )
- In /etc/vsftpd.conf change #write_enable=YES
to write_enable=YES - Add firewall rules in your GC project to allow access to ports 21 and passive ports 15393 to 15592 (https://console.cloud.google.com/networking/firewalls/list)
一些可能的问题:
- 如果您可以使用本地ip访问FTP服务器,而不能使用远程ip,则可能是因为您尚未设置防火墙规则
- 如果您可以访问ftp服务器,但无法写入,则可能是因为您需要write_enable = YES
- 如果您想读取在/mnt上创建的文件夹,但遇到I/O错误,则可能是因为gcsfs_config中的存储桶不正确.
此外,您的ftp客户端需要使用设置为被动"的传输模式.
Also, your ftp client needs to use the transfer mode set to "passive".
这篇关于通过FTP传输到Google存储空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!