问题
Is there a way to mount a storage bucket to an instance so it can be used by the webserver as storage? If not, how can I add more storage to the instance without adding another persistent disk with an OS?
回答1:
You can certainly create a new (larger) Persistent Disk and attach it to your instance as a data disk. This is a very good option, since it keeps your website data separate from your operating system. See the Persistent Disk docs for details on all the options.
In your case:
- Create a new Persistent Disk for the data. Pick a size large enough for your data and large enough to get the I/O throughput you want. (See this chart for details)
- Attach the disk to your instance.
回答2:
Aside from attaching a new persistent disk, you could also use a number of FUSE based utilities to mount either a Google Cloud Storage or AWS S3 bucket as a local disk.
s3fs: *Can work with Google Cloud or AWS *Bucket can be mounted on multiple systems at same time *Files are stored as objects on the bucket, so the files can be manipulated externally *A con is that it can be a little bit slow if you have a lot of files
S3QL: *Can work with Google Cloud or AWS *Bucket can be mounted on one system *Files are stored in a proprietary format, can't be manipulated outside of the mounted filesystem *Much faster than s3fs for many files *Doesn't handle network connectivity issues so well (manual fsck and remount if you lose network).
Hope this helps.
来源:https://stackoverflow.com/questions/22728821/gce-use-cloud-storage-bucket-as-mounted-drive