8
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GCP超初心者がローカルのgsutilを設定してた際のメモ

Posted at

経緯

昨日参加させて頂いたGCPの勉強会で、Dataflowのハンズオンをしていた際、
gsutilで少し引っかかったため、ググりながら構築してた際の手順を備忘録として纏めてみます。

対象環境

  • MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports) 256GB
  • Mac OS High Sierra

前提

  • Homebrewがインストールされていること

gsutilって何?

Google Cloud Storageを操るコマンドツールらしいです

gsutil ツール  |  Cloud Storage ドキュメント  |  Google Cloud

インストール

Cloud SDKインストール

$ brew cask install google-cloud-sdk

パスの設定

$ cd
$ echo source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc' >> .bash_profile
$ echo source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc' >> .bash_profile
$ source .bash_profile

クラウドのプロジェクト設定

コンポーネントアップデート

$ gcloud components update
All components are up to date.

プロジェクト設定開始

$ gcloud init

GCPを利用するGoogleアカウントにログインします

You must log in to continue. Would you like to log in (Y/n)? Y

ブラウザが表示されたら、GCPで利用するアカウントを選択

スクリーンショット 2018-05-27 1.25.58.png

アクセスを許可します

スクリーンショット 2018-05-27 1.26.07.png
スクリーンショット 2018-05-27 1.26.17.png

コンソールに戻るとログインしたアカウントが表示されています

You are logged in as: [メールアドレス].

プロジェクト選択は既存プロジェクトを選択

Pick cloud project to use:
 [1] プロジェクト名
 [2] Create a new project
Please enter numeric choice or text value (must exactly match list item): 1
Your current project has been set to: [プロジェクト名].

リージョンのデフォルト設定は東京に

Do you want to configure a default Compute Region and Zone? (Y/n)? Y
~~省略~~
[29] asia-southeast1-b
~~省略~~
Please enter numeric choice or text value (must exactly match list
item):  29

結果

gsutil cpコマンドを利用し、GCPのストレージにハンズオン用のデータをアップロードするのになんとか間に合いました

オチ

Macにインストールせずとも、Google Cloud Shellでもgsutil使えたっぽいです。。
コンソールになにがあるのかまだ把握できてません。。

スクリーンショット 2018-05-27 1.40.41.png

8
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?