跳到主要內容

發表文章

目前顯示的是有「gcp」標籤的文章

Google Compute Engine‎ - AccessDeniedExceptions 403

原因 打算從 instance 打包 logs 到 google cloud storage 發生了 AccessDeniedException: 403 Insufficient OAuth2 scope to perform this operation. , 看起來是 instance 沒有 storage 權限 解決 Reference: https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#changeserviceaccountandscopes 重新設定 service account 權限 instance 上內建有 gcloud , 就直接用現有的工具查詢一下 instance 的 account. $ gsutil info 或者在本機直接 gcloud compute instances describe INSTANCE_NAMES Account: [alpha-number-compute@developer.gserviceaccount.com] Project: [our-project-name] 會看到 instance 的一些狀態, 接下來就簡單多了, 按照下列的說明, 要先 stop instance, 更改 storage scope 再重新 start 。 To change an instance's service account and access scopes, the instance must be temporarily stopped. To stop your instance, read the documentation for Stopping an instance. After changing the service account or access scopes, remember to restart the instance. # Stop Instance gcloud compute instances stop INSTANCE_NAMES # 設定 storage scope 為 full (Read, Write) gcloud co...

GCP Storage 簡介

GCP Storage 簡介 Overview of storage classes 1.Multi-Regional Storage 適合存放經常存取的 "Hot Data" 或者影音串流(streaming videos),有異地備份的功能。 2.Regional Storage 適合存放與 Google Compute Engine Instance 或 Google Cloud DataProc 服務互相配合的資料,在相同的 Regional 可以降低 latency。Google Compute Engine 跟 Google Cloud DataProc 這些 instances 都是拿來處理, 清理, 運算資料用, 要分析的資料適合用這種類型的儲存。存放的費用比 Multi-Regional 還要低一點($0.016 GB/Month)。 3.Nearline Storage 適合存放較低存取的 "Cold Data",比如每月(隔 30 天才會存取一次)需要存取或修改一次的資料,或者適用於一些資料備份(用來回復跟救援的資料),支援整合 AWS Glacier 轉移。 4.Coldline Storage 適合存放較低存取的 "Cold Data",比起 Nearline Storage,Coldline Storage 更適合線上備份跟救援回復的資料(隔 90 天才會存取一次)。 Pricing https://cloud.google.com/storage/pricing Standar Storage 的建議 如果不清楚,資料的存取用途,建議使用 Standard Storage buckets