简体   繁体   English

如何将我的 Google Cloud Platform(GCP) 实例的额外磁盘空间分配给我的 R 服务器

[英]How can I allocate extra disk space of my Google Cloud Platform(GCP) instance to my R server

I would like to know how to allocate extra disk space of my VM to my R server on Google Cloud Platform(GCP)我想知道如何将我的虚拟机的额外磁盘空间分配给我在谷歌云平台(GCP)上的 R 服务器

I established an R server on GCP based on a number of tutorials on the internet.我根据网上的一些教程在GCP上建立了一个R服务器。 My instance runs on ubuntu 18.04LTS.我的实例在 ubuntu 18.04LTS 上运行。 I succeeded in installing base R and Rstudio.我成功安装了基础 R 和 Rstudio。 I could run some basic analyses with the server.我可以使用服务器运行一些基本分析。

tutorial examples: https://towardsdatascience.com/r-studio-server-on-google-cloud-dd69b8bff80b https://yuhuisdatascienceblog.blogspot.com/2017/07/setting-up-r-studio-server-on-google.html教程示例: https://towardsdatascience.com/r-studio-server-on-google-cloud-dd69b8bff80b https://yuhuisdatascienceblog.blogspot.com/2017/07/setting-up-r google.html

However, I realized that the disk usage of the working directory for my R server was too low after running du -h但是,我意识到运行du -h后我的 R 服务器的工作目录的磁盘使用率太低了

#the working directory for my R server
twinring77@instance-1:~$ pwd
/home/twinring77

#the disk usage of my R server
twinring77@instance-1:~$ du -h
...
2.2G    ./yard/apps/cellranger-6.1.2
3.0G    ./yard/apps
3.0G    ./yard
4.2G    .

It turns out I cannot remotely download any files bigger than 4.2 GB to my working directory on my R server.事实证明,我无法将任何大于 4.2 GB 的文件远程下载到我的 R 服务器上的工作目录中。

Thus I added an extra 1.1TB disk to GCP instance by adding an extra disk based on a tutorial that Google provided tutorial:https://cloud.google.com/compute/docs/disks/add-persistent-disk因此,我根据谷歌提供的教程添加了一个额外的磁盘,为 GCP 实例添加了一个额外的 1.1TB 磁盘:https://cloud.google.com/compute/docs/disks/add-persistent-disk

I also expanded the original free trial disk I was using (10GB) to 1.1TB我还将原来使用的免费试用磁盘 (10GB) 扩展到 1.1TB

After that, I ran df –h to check extra disk space.之后,我运行df –h检查额外的磁盘空间。

twinring77@instance-1:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             59G     0   59G   0% /dev
tmpfs            12G  748K   12G   1% /run
/dev/sda1       1.1T   11G  1.1T   2% /
tmpfs            59G     0   59G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            59G     0   59G   0% /sys/fs/cgroup
/dev/sda15      105M  4.4M  100M   5% /boot/efi
/dev/sdb        1.1T   77M  1.1T   1% /mnt/disks/MOUNT_DIR
tmpfs            12G     0   12G   0% /run/user/1001

So essentially my instance has 2.2TB of free disk space所以基本上我的实例有 2.2TB 的可用磁盘空间

There were some tutorials online about resizing or adding disk space to a VM instance.网上有一些关于调整或向 VM 实例添加磁盘空间的教程。 However I was unable to find out how to precisely allocate it to a server established based on the instance.但是我无法找到如何将它精确地分配给基于实例建立的服务器。

In conclusion, I have plenty of free disk space in my instance that I can spare for my R server.总之,我的实例中有足够的可用磁盘空间,可以为我的 R 服务器腾出空间。 I would like to how to allocate this free disk space for my R server so that I can download/process bigger data.我想知道如何为我的 R 服务器分配这个可用磁盘空间,以便我可以下载/处理更大的数据。

ps.附言。 I'm new to this community and this is actually my first question posted.我是这个社区的新手,这实际上是我发布的第一个问题。 I tried to make all my questions clear after reading many but I'm sorry if I made any mistakes in the process.在阅读了很多内容后,我试图把我所有的问题都弄清楚,但如果我在这个过程中犯了任何错误,我很抱歉。 Please feel free to let me know if I need to correct my questions如果我需要更正我的问题,请随时告诉我

Thank you in advance.先感谢您。

shutting down my gcp instance solved the issue.关闭我的 gcp 实例解决了这个问题。 The extra disk space was allocated after the instance is restarted.额外的磁盘空间是在实例重启后分配的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM