从RStudio中的Google云存储访问文件 [英] Accessing files from Google cloud storage in RStudio

查看:90
本文介绍了从RStudio中的Google云存储访问文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在Google云存储和RStudio服务器(我在Google云中启动的服务器)之间建立连接,以便我可以访问R中的文件以进行总和分析.我在网络上找到了三种不同的方法来实现它,但是到目前为止,我对这些方法的理解还不够清晰.

I have been trying to create connection between the Google cloud storage and RStudio server(The one I spinned up in Google cloud), so that I can access the files in R to run sum analysis on. I have found three different ways to do it on the web, but I don't see many clarity around these ways so far.

  1. 使用特定于文件的公共URL访问文件[这不是我的选择]
  2. 将Google云存储作为光盘安装在RStudio服务器中,并像服务器中的任何其他文件一样对其进行访问[我见过有人张贴过有关此方法的信息,但找不到任何指南或资料来说明其实现方式]
  3. 使用googleCloudStorageR软件包来完全访问Cloud Storage存储桶.

步骤3看起来很标准.但是当我尝试点击gcs_auth()命令时出现以下错误

The step 3 looks like the pretty standard way to do it. But I get following error when I try to hit the gcs_auth() command

gar_auto_auth(required_scopes,new_user = new_user,no_auto =no_auto ,:无法验证-options(googleAuthR.scopes.selected)需要设置为包括https://www.googleapis.com/auth/devstorage.full_control或 https://www.googleapis.com/auth/devstorage.read_write https://www.googleapis.com/auth/cloud-platform

有关如何使用此连接的指南,请参见 https://github.com/cloudyr/googleCloudStorageR 但是它说它需要一个service-auth.json文件来设置环境变量以及所有其他密钥和秘密密钥,但是并没有真正说明它们的真正含义.

The guide on how to connect using this is found on https://github.com/cloudyr/googleCloudStorageR but it says it requires a service-auth.json file to set the environment variables and all other keys and secret keys, but do not really specify on what these really are.

如果有人可以帮助我了解它的实际设置方式,或者为我提供设置环境的不错指南,我将不胜感激.

If someone could help me know how this is actually setup, or point me to a nice guide on setting the environment up, I would be very much grateful.

谢谢.

推荐答案

您可能需要FUSE适配器-这将使您可以将GCS存储桶安装为服务器上的目录.

You probably want the FUSE adaptor - this will allow you to mount your GCS bucket as a directory on your Server.

  1. 在R服务器上安装gcsfuse.
  2. 创建一个mnt目录.
  3. 运行gcsfuse您的存储桶/path/to/mnt

请注意,尽管相对于FUSE,RW性能并不理想

Be aware though that RW performance isnt great vis FUSE

完整文档

https://cloud.google.com/storage/docs/gcs-fuse

这篇关于从RStudio中的Google云存储访问文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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