Google云产品
  • Introduction
  • google cloud
    • Cloud Functions
    • Pub / Sub
      • 资料
    • Cloud Storage
      • gsutil 挂载工具
    • Cloud Dataflow
      • 入门
      • 创建和运行模板
      • Apache Beam
        • 介绍
        • Apache Beam SDK 的流水线基础知识
    • BigQuery
      • 入门
      • 运行和管理作业
      • 数据集操作
      • 处理表架构(表字段的修改)
      • 处理表
      • 使用分区表
      • 资料
      • php代码
    • 常用
  • Cloudinary
Powered by GitBook
On this page
  • 挂载方式使用
  • 1.安装Cloud Storage FUSE
  • 2.设置验证的json文件.(GCS.json文件)
  • 3.本地创建一个目录
  • 5.使用 Cloud Storage FUSE 来挂载 bucket (e.g. example-bucket).
  • 6.开始使用挂载的目录
  • 取消挂载

Was this helpful?

  1. google cloud
  2. Cloud Storage

gsutil 挂载工具

PreviousCloud StorageNextCloud Dataflow

Last updated 5 years ago

Was this helpful?

挂载方式使用

1.安装Cloud Storage FUSE

export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s`
echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install gcsfuse
sudo usermod -a -G fuse $USER
gcsfuse --key-file="{keyfile path}" {bucket name} /{mount path}

2.设置验证的json文件.(GCS.json文件)

可以多种方式设置认证

3.本地创建一个目录

$ mkdir /path/to/mount

4.创建一个bucket

5.使用 Cloud Storage FUSE 来挂载 bucket (e.g. example-bucket).

$ gcsfuse --key-file="{keyfile path}/GCS.json" example-bucket /path/to/mount

6.开始使用挂载的目录

$ ls /path/to/mount

注意:在china使用需要开代理才能使用,但是经过测试开启debug可以测试用

$ gcsfuse --foreground  --debug_fuse --debug_gcs --debug_invariants --debug_http --key-file="/home/vidaxl/google/user.json" selling-products /home/vidaxl/google/export

取消挂载

fusermount -u /path/to/mount

if it doesn't already exist, using the .

gcs-fuse
github-gcsfuse
Google Cloud Console