跳到主要內容

發表文章

目前顯示的是 七月, 2014的文章

Google cloud storage parallel upload ...

下面是簡單的Cloud Storage切割上傳+重組的過程給大家參考:

1. Split a huge file use "split -b [size] [file]"


2. upload to cloud storage us parameter "-m" 3. check the process forked, there will be more than one upload processes

4. Compose the uploaded object in cloud storage

最後,如果希望把不必要的檔案砍掉 可以用: gsutil rm -rf gs://[your-bucket]/x*

Compute Engine新功能

今天突然發現Compute Engine的新功能... 居然可以透過頁面提供SSH Console!!! (雖然做法不難,不過Google真是有誠意拉!)直接在machine detail頁面,展開最上方SSH右邊的選單,選擇"Open in browser window" 即可開啟SSH視窗


SSH動作是透過cloudssh這檯主機來做SSH轉導服務,當然,事前需要透過該Server進行SSH key的產生...


Key產生後,會建立一筆臨時使用的SSH金鑰,然後就可以直接連線....


金鑰的一樣會塞到~/.ssh/authorized_keys,格式如下:


仔細看,public key後面會有:
google-ssh {"userName":"simonsu@mitac.com.tw","expireOn":"2014-07-15T14:13:40+0000"}
有寫上expire time...,看起來僅作為一次登入使用...
測試一下最麻飯的vi模式,也通用喔!


真是要稱讚一下Google,厲害啊!

Mount Google Cloud Storage...

Google Cloud Storage終於有神人提供fuse工具拉,也就是說可以透過mount的方式來掛載google coud storage (GCS)成為filessystem,下面是測試的狀況

Download & Install 

下載點:gcsfs-downloads (on Google Drive).
In Local: $ gcutil push [your-instance-name] ~/Downloads/gcsfs-0.15-1.x86_64.rpm [your-instance-folder] $ gcutil ssh [your-instance-name]
In remote: $ cd [your-instance-folder] $ sudo yum localinstall gcsfs-0.15-1.x86_64.rpm
Initial
Generate Access Token
$ mkdir .gcsfs $ gcsfs_gs_get_token ~/.gcsfs/gs.token Paste this URL into your browser: https://accounts.google.com/o/oauth2/auth?client_id=591551582755.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&scope=https%3a%2f%2fwww.googleapis.com%2fauth%2fdevstorage.read_write&response_type=code

Please enter the authorization code: 4/4VNfqTct.....mbpQjgI <--在這邊填入授權碼 curl_easy_handle::pre_init: ssl version: NSS/3.15.3 Done!
Check generated token
$ cat .gcsfs/gs.token 1/RnWOX.................oSFjBA

Make a Regional Bucket
$ gsutil mb -c DRA -l ASIA gs://simonb…