飛天開放平台編程指南

.....................................................................................................198C.2.3 .....................................................................................................222D.1.9 Touch........................................................................................................230D.3

內容介紹

《飛天開放平台編程指南:阿里雲計算的實踐》不但由淺入深地闡述了雲計算的相關原理,而且用很多實例詳細講解了怎樣利用飛天平台的編程接口來開發各種網際網路套用和服務,讓用戶便捷地利用數千台伺服器來完成以前不能完成甚至不敢想像的任務。《飛天開放平台編程指南:阿里雲計算的實踐》具體內容涵蓋了雲計算的概念、雲計算體系結構、分散式處理、虛擬化與彈性計算、雲存儲、海量結構化數據處理、海量數據分析與挖掘、雲計算編程模型、移動終端開發等。

作品目錄

第 1 章緒論 1
1.1 雲計算的背景.....................................................................................................1
1.1.1 雲計算的概念...........................................................................................................1
1.1.2 雲計算的類型...........................................................................................................3
1.1.3 業界主要的雲計算提供商........................................................................................4
1.2 阿里雲的定位.................................................................................5
1.3 雲生態系統....................................................................................................6
1.4 內容總覽.................................................................................................7
第2 章飛天開放平台總覽8
2.1 飛天平台體系架構.................................................................................8
2.2 飛天平台核心..............................................................................9
2.2.1 分散式系統底層服務................................................................................................9
2.2.2 分散式檔案系統(盤古)......................................................................................11
2.2.3 資源管理和任務調度(伏羲)..............................................................................13
2.2.4 集群監控和部署.....................................................................................................14
2.3 飛天開放服務............................................................................16
2.3.1 彈性計算服務(ECS) ..........................................................................................16
2.3.2 開放存儲服務(OSS) ..........................................................................................17
2.3.3 開放結構化數據服務(OTS) ..............................................................................17
2.3.4 關係型資料庫服務(RDS)..................................................................................18
2.3.5 開放數據處理服務(ODPS) ...............................................................................18
2.3.6 雲服務引擎(ACE)..........................................................................................19
第 3 章彈性計算服務ECS 20
3.1 術語及概念.........................................................................21
3.2 雲伺服器使用流程...................................................................22
3.2.1 購買並創建雲伺服器..............................................................................................23
3.2.2 啟動、停止和重啟雲伺服器..................................................................................23
3.2.3 重置雲伺服器.........................................................................................................24
3.2.4 修改雲伺服器密碼.................................................................................................24
3.2.5 遠程登錄雲伺服器.................................................................................................24
3.2.6 數據盤分區、格式化和掛載...............................................................26
3.3 利用API 管理ECS........................................................................28
3.3.1 公共參數和返回結果..............................................................................................28
3.3.2 雲伺服器控制.........................................................................................................30
3.3.3 鏡像和快照.............................................................................................................36
3.3.4 安全組.....................................................................................................................39
3.4 負載均衡(SLB) .............................................................................................................41
3.5 雲盾...............................................................................................42
3.6 雲監控..................................................................................43
3.7 自動故障恢復.......................................................................43
3.8 套用架構修改............................................................................44
3.9 套用案例..........................................................................44
第4 章開放存儲服務OSS 46
4.1 術語及概念..........................................................................46
4.1.1 Object.......................................................................................................................46
4.1.2 Bucket ......................................................................................................................47
4.1.3 訪問控制.................................................................................................................47
4.1.4 外鏈規則.................................................................................................................48
4.1.5 Access ID 和Access Key ........................................................................................48
4.1.6 使用OSS.................................................................................................................49
4.2 RESTful API.......................................................................................................................50
4.2.1 Service 操作............................................................................................................50
4.2.2 Bucket 操作.............................................................................................................50
4.2.3 Object 操作..............................................................................................................52
4.2.4 分塊上傳(Multipart Upload)操作......................................................................56
4.3 Python SDK 的使用..............................................................59
4.3.1 Bucket 操作.............................................................................................................60
4.3.2 Object 操作..............................................................................................................68
4.3.3 分塊上傳(Multipart Upload)操作......................................................................76
4.3.4 簽名URL ................................................................................................................80
4.4 套用案例...............................................................................81
第5 章開放結構化數據服務OTS 82
5.1 術語及概念..........................................................................................83
5.1.1 表.............................................................................................................................83
5.1.2 視圖.........................................................................................................................84
5.1.3 表組.........................................................................................................................85
5.1.4 命名和限額.............................................................................................................86
5.1.5 事務.........................................................................................................................86
5.1.6 訪問許可權控制.........................................................................................................86
5.2 RESTful API.......................................................................................................................87
5.2.1 表操作.....................................................................................................................87
5.2.2 插入和修改操作.....................................................................................................88
5.2.3 查詢操作.................................................................................................................88
5.2.4 事務操作.................................................................................................................88
5.3 Python SDK 的使用..................................................................89
5.3.1 表操作.....................................................................................................................91
5.3.2 插入和修改操作.....................................................................................................96
5.3.3 查詢數據...............................................................................................................101
5.3.4 事務操作...............................................................................................................104
5.4 套用案例.......................................................................106
第6 章關係型資料庫服務RDS 107
6.1 術語及概念.......................................................................................108
6.2 自動故障恢復..............................................................................109
6.3 分散式RDS...........................................................................110
6.4 利用客戶端軟體進行資料庫管理........................................................110
6.4.1 實例管理...............................................................................................................111
6.4.2 資料庫管理...........................................................................................................112
6.4.3 連線資料庫...........................................................................................................112
6.4.4 表管理...................................................................................................................113
6.4.5 備份恢復...............................................................................................................114
6.4.6 數據遷移...............................................................................................................114
6.4.7 性能分析...............................................................................................................115
6.5 利用API 進行資料庫管理................................................................115
6.5.1 公共參數和返回結果............................................................................................116
6.5.2 API 接口的使用....................................................................................................117
6.6 套用案例..............................................................................127
第7 章開放數據處理服務ODPS 128
7.1 術語及概念....................................................................................128
7.2 套用開發框架.............................................................130
7.2.1 體系架構...............................................................................................................130
7.2.2 套用開發模式.......................................................................................................131
7.3 ODPS SQL 開發........................................................................132
7.3.1 套用示例描述.......................................................................................................133
7.3.2 數據導入...............................................................................................................134
7.3.3 基本功能...............................................................................................................135
7.3.4 高級功能...............................................................................................................136
7.4 ODPS MapReduce 開發............................................................140
7.4.1 入門實例WordCount............................................................................................140
7.4.2 開發實戰...............................................................................................................155
7.5 套用案例.......................................................................................172
第8 章典型套用案例解析173
8.1 傳統網際網路套用....................................................................173
8.1.1 中國網路電視台體育台........................................................................................173
8.1.2 御泥坊...................................................................................................................175
8.1.3 夠快.......................................................................................................................175
8.2 移動網際網路套用.........................................................................176
8.2.1 DeNA.....................................................................................................................176
8.2.2 壹人壹本...............................................................................................................176
8.2.3 金立.......................................................................................................................177
8.3 企業級SaaS 套用...............................................................................177
8.3.1 用友暢捷通...........................................................................................................177
8.3.2 商派.......................................................................................................................178
8.4 新型網際網路套用和服務.........................................................179
8.4.1 阿里雲搜尋...........................................................................................................179
8.4.2 阿里金融...............................................................................................................180
附錄A 飛天開放服務開通流程181
附錄 B RESTful API 和身份驗證184
B.1 RESTful API....................................................................................................................184
B.2 ECS 身份認證.................................................................................................................185
B.3 OSS 身份認證......................................................................................186
B.3.1 在Header 中包含簽名.........................................................................................186
B.3.2 在URL 中包含簽名.............................................................................................188
B.4 OTS 身份認證.............................................................................189
B.4.1 OTS 請求的簽名..................................................................................................189
B.4.2 OTS 回響的簽名..................................................................................................190
B.5 RDS 身份認證...........................................................................191
附錄C 用OSS 構建同步備份網盤193
C.1 網盤功能、設計與使用..................................................................................................193
C.1.1 網盤功能:自動備份和同步多個設備...............................................................193
C.1.2 網盤設計...............................................................................................................193
C.1.3 網盤安裝和使用...................................................................................................194
C.2 原始碼............................................................................................195
C.2.1 netdisk.py ..............................................................................................................196
C.2.2 fs/filesystem.py .....................................................................................................198
C.2.3 fs/hddfs.py.............................................................................................................201
C.2.4 fs/ossfs.py..............................................................................................................204
C.2.5 fs/couldnotconnectserverexception.py ..................................................................207
C.2.6 eventhandlers/netdiskeventhandler.py...................................................................207
附錄D 雲套用引擎CAE 編程211
D.1 雲套用開發入門.........................................................................212
D.1.1 快速創建一個雲套用...........................................................................................212
D.1.2 雲套用檔案結構...................................................................................................215
D.1.3 頁面生命周期.......................................................................................................215
D.1.4 新建頁面..............................................................................................................216
D.1.5 頁面之間相互跳轉...............................................................................................217
D.1.6 引入第三方類庫...................................................................................................218
D.1.7 調用雲端接口.......................................................................................................219
D.1.8 調用CloudAPI .....................................................................................................222
D.1.9 監聽雲套用的掛起和喚醒...................................................................................223
D.1.10 請求和操作XML...............................................................................................224
D.1.11 線上調試............................................................................................................225
D.2 用戶界面開發............................................................................227
D.2.1 滾動條..................................................................................................................227
D.2.2 提示框..................................................................................................................228
D.2.3 jQTouch ................................................................................................................229
D.2.4 Sencha Touch........................................................................................................230
D.3 雲套用開發實例.......................................................................232
D.3.1 花名冊程式...........................................................................................................232
D.3.2 地圖程式..............................................................................................................237
D.4 設計指南與注意事項..................................................................239
D.4.1 雲套用設計指南...................................................................................................239
D.4.2 設計中的注意事項...............................................................................................240
D.4.3 雲套用審核指南...................................................................................................240
參考文獻..................................................................................................241

相關詞條

熱門詞條

聯絡我們