跳到主要內容

發表文章

目前顯示的是 5月, 2015的文章

StackDriver for Ubuntu 15

StackDriver出了Ubuntu 15的映像檔,但StackDriver的安裝過程有些錯誤,經詢問Support後,下面是完整的Ubuntu 15的安裝流程,給大家參考 1. sudo su - 2. curl -o /etc/apt/sources.list.d/ stackdriver.list  https://repo.stackdriver.com/trusty.list 3. curl --silent  https://app.google.stackdriver.com/RPM-GPG-KEY-stackdriver  |apt-key add - 4. apt-get update 5. apt-get install stackdriver-agent 6. This will update the installation, prompt you for the API key, and start the agent. If you are installing the agent in an automated fashion [1], you can preset the API key in debconf to avoid being prompted for the key by running the following command, substituting your API key [2] for STACKDRIVER_API_KEY: sudo echo "stackdriver-agent stackdriver-agent/apikey string STACKDRIVER_API_KEY" | debconf-set-selections 7. Continue with Verifying successful Linux installation [3]. [1]:  https://cloud.google.com/monitoring/agent/install-agent#automated_installation [2]:  https://cloud.google.com/monitoring/agent/install-agent#api-key [3]:  htt

GCE Network Load Balancer也可以輕易達到AutoScaler的功能...

截至目前為止,Network Load Balancer尚未能夠結合Instance Group的Auto Scaler設定,但是在創意無限的MiTAC GCP團隊裡,我們(感謝Sunny)化腐朽為神奇.... 下面是透過Auto Scaler加上Instance template中設定startup/shutdown script來動態的加入或移除Network Load Balancer的建置步驟,給大家參考 :D 1. 首先去要先設定network load balancer , target pool . 在這邊pool名稱我們設定為:lb-pool, 須注意,pool name必須在之後的startup與shutdown script中帶入... 2. 增加forwarding rule,並選擇 lb-pool 作為他的target pool 3. 設定instance template , 並且在template中增加startup-script / shutdown-script 為了方便貼上( 關鍵就在這裡! ): startup-script gcloud compute target-pools add-instances lb-pool --instances `hostname` --zone asia-east1-c shutdown-script gcloud compute target-pools remove-instances lb-pool --instances `hostname` --zone asia-east1-c 由於屆時主機需要具備compute engine的操作權限(startup/shutdown script用的...),我們必須在主機權限的部分設定該template所產生的主機具備Compute的"Read Write"的權限... 如果instance中有需要用到其他服務,也需要在這邊一併設定... 4. 建立instance groups,並確認autoscaling的設定打開,設定必須以CPU usa

Cloud Logging for Operation Logs, and BigQuery / CloudStorage export support

一直以來只用到Cloud Logging的GAE Log顯示、查詢功能... 有一天... 發現他查得到GAE的紀錄... 不只這樣,還包含VPN Service跟防火牆設定等等的紀錄喔.... 而現在,GCP的Operation Log可以更準確的查詢了....  最近Cloud Logging的功能加強了,可以在Monitoring > Logs裡面可以找到Exports的設定,透過這個介面可以設定App Engine與Compte Engine的Log到BigQuery或是Cloud Storage中... 然後,就可以在指定的dataset中查詢到更詳細的Operation Log了... 維持Google一貫的程式人員風格,資料還是收容再以non-structure的json格式中,在BigQuery中會以repeat的方式存在,而整個原始資料則是存在"textPayload"中... 有了這些設定,不論在帳務的掌控,或是安全性的稽核,都有更完整的參考資料了喔!

You can find BigTable and Deployments UI now!!

BigTable在儲存(Storage)這個項目下: Deployment在部署與管理(Deploy & Manage)這個項目下: 怎麼玩?!待小弟好好找個時間測測 :D

Google Cloud Storage object url CNAME mapping with SSL

繼Cloud Storage Website Bucket之後,目前GCS上的Object也可以在不轉變為website bucket情況下,簡單的mapping物件的url 關鍵是需要把bucket的名稱以dns命名規則建立,然後開始上傳您的物件... 然後我們需要到DNS server指定CNAME record ( gcsweb.micloud.tw --> c.storage.googleapis.com ),讓網域名稱與bucket名稱可以得到對應... 就是這麼簡單,上傳之後,物件其實就可以以 http://gcsweb.micloud.tw/GCPUG-1.png 來瀏覽... 而,加上SSL的關鍵,其實是使用CloudFlare的CDN功能... 在CloudFlare上,當Domain Name過CDN,在會自動增加SSL的連線能力,讓http跟https都可以通... 只要您的DNS是hosting在Cloudflare,則可以在打開CDN設定後,讓連線可以透過HTTPS連線 https://gcsweb.micloud.tw/GCPUG-1.png 寫到這邊,突然覺得可怕... 如果GCS蟑螂出現,開始book大家的Domain.... 還好Google在建立bucket時候,有檢查網域是否屬於您所擁有... 如果不是您的網域,則會得到下面的錯誤訊息... 必須要經過Bucket Name Verification來認證您是bucket的擁有者喔 :D Reference:  https://cloud.google.com/storage/docs/reference-uris