§ 瀏覽學位論文書目資料
  
系統識別號 U0002-3107201711214700
DOI 10.6846/TKU.2017.01098
論文名稱(中文) 基於DC/OS之微服務架構雲端運算平台實作
論文名稱(英文) Implementation of Microservices for Data Analytics over DC/OS
第三語言論文名稱
校院名稱 淡江大學
系所名稱(中文) 資訊工程學系碩士班
系所名稱(英文) Department of Computer Science and Information Engineering
外國學位學校名稱
外國學位學院名稱
外國學位研究所名稱
學年度 105
學期 2
出版年 106
研究生(中文) 徐銘志
研究生(英文) Ming-Chih Hsu
學號 604410067
學位類別 碩士
語言別 繁體中文
第二語言別
口試日期 2017-06-20
論文頁數 74頁
口試委員 指導教授 - 林其誼(chiyilin@mail.tku.edu.tw)
委員 - 林其誼
委員 - 許輝煌
委員 - 林昌鴻
關鍵字(中) DC/OS
微服物架構
雲端運算
Kafka
Spark
關鍵字(英) DC/OS
Microservice
Cloud Computing
Kafka
Spark
第三語言關鍵字
學科別分類
中文摘要
隨著雲端計算服務的進步和服務的增長, 微服務架構受到了人們的關注。 這一個概念的提出已經有很長一段時間了,但在這幾年卻開始頻繁的出現。微服務架構是一種特定的軟體設計方式-將大型軟體拆分為多個獨立可部署服務組合而成的套件方案。在這個架構出現之前,一個通用的軟體設計模式是使用整體化結構。在這個模式下,應用程式在開發、測試、部署階段都是作為一個整體的存在,這種模式導致擴充應用充滿了挑戰。
在這個研究中,我們會在實驗性計算機叢集中,設計一個基於微服務架構資料分析平台,在此我們會使用DC/OS(Data Center Operating System),一個以Apache Mesos為核心的作業系統,去管理計算機叢集,可以用來管理叢集資源和調度。將這個平台部署在DC/OS可以讓它具有Mesos的高容錯性以及資源共享,也可以輕易地去擴充此平台的功能,讓多種不同類型的服務接合在一起。
我們利用了現有的伺服器構建了雲端叢集,在DC/OS上實作資料分析平台,在這個平台上我們主要使用Node.JS、Kafka、Spark來作為我們資料的分析工具,我們的服務會透過DC/OS部屬,而不是透過手動部署。此外,我們使用了Dcard作為我們的資料來源,在即時處理流程我們提供了一個視覺化的介面,去顯示熱門Hashtag,在離線處理流程,透過網頁伺服器,我們可以從資料庫以API的形式,獲取不同類型的資料,像是發文的男女比例或是點讚或評論前十名的文章,展示了這個平台擁有處理即時資料和離線資料的能力,去顯示我們分析完的結果。
英文摘要
With recent advancement and increasing popularity of cloud computing services, the microservice architecture has been gaining more attention in the software development industry. Although the concept of microservices has existed for a long time, its style of architecturing appears more frequently in many software projects until recently. The idea of the microservice architecture is to use a collection of loosely coupled services to compose a large-scale software application. In traditional monolithic architecture, by contrast, every piece of code is put together, and the application is developed, tested, and deployed as a single application. Obviously, it is challenging for the traditional architecture to scale properly.
In this research, we implement a data analytics platform based on the microservice architecture over our experimental computer cluster. Specifically, we use DC/OS (Data Center Operating System) to manage the cluster, which extends the functionalities of Apache Mesos to achieve resource management and dispatching. On top of DC/OS, our data analytics platform has the advantages of high fault-tolerance, sharing of system resources, ease of scalability, and well interoperability between different services.
Our data analytics platform is built by composing many open-source software such as Node.JS, Apache Kafka, and Apache Spark. The data analytics services will be deployed by DC/OS automatically, without the hassle of error-prone manual deployment. Our data source is Dcard, which is the largest anonymous online community in Taiwan. On streaming processing, our platform offers a visual interface to show the hottest Hashtag. On batch processing, our platform is able to show the statistics such as the ratio of male/female posters, and the top-10 liked or commented posts. The experimental results show that our data analytics platform can do streaming processing and batch processing successfully and reveal useful analytical results.
第三語言摘要
論文目次
目錄
第一章 緒論	1
1.1	研究背景與動機	1
1.2	研究目的與重要性	2
1.3	論文架構	3
第二章 相關研究	5
2.1	DC/OS	5
2.2	微服務架構	8
2.3	Apache Spark Streaming	11
2.4	Promise技術	12
2.5	Kafka	15
2.6	Docker	18
2.7	相關研究	20
第三章 系統架構與研究方法	22
3.1	系統架構簡介	22
3.2	離線處理機制	25
3.3	即時處理機制	29
3.4	核心運算程式	33
第四章 系統實作與成果	37
4.1	系統實作說明	37
4.1.1	開發工具與環境	37
4.1.2	核心運算程式實作	38
4.1.3	即時運算程式實作	42
4.1.4	離線運算程式實作	46
4.2	運行結果	50
4.2.1	離線資料處理流程	51
4.2.2	即時資料處理流程	53
4.3	基於Node.JS之前端頁面實作	59
4.3.1	開發工具	59
4.3.2	各類別功能說明	60
第五章 結論與未來展望	65
參考文獻	67
附錄 – 英文論文	69

圖目錄
圖2- 1 DC/OS架構圖	7
圖2- 2 DC/OS應用部署及資源分配	8
圖2- 3 DC/OS服務環境變數設定	8
圖2- 4微服務中的容器	10
圖2- 5使用了回調函數的非同步程式片段	12
圖2- 6嵌套的回調函數	13
圖2- 7 Promise 狀態圖	15
圖2- 8 Kafka架構圖	18
圖2- 9 Docker和傳統VM比較	20
圖3- 1平台架構圖	24
圖3- 2離線處理流程圖	29
圖3- 3即時處理流程圖	33
圖3- 4 Promise程式範例	34
圖4- 1爬蟲程式運作流程	39
圖4- 2 即時運算流程圖	43
圖4- 3文章Hashtag	44
圖4- 4 Spark與Kafka資料流	46
圖4- 5離線處理流程圖	47
圖4- 6運行成果平台架構圖	50
圖4- 7 離線資料啟動核心程式	51
圖4- 8 爬蟲運作時發生錯誤	51
圖4- 9 log文字紀錄檔	52
圖4- 10資料庫內的資料	52
圖4- 11 API回傳網頁資料-熱門文章	53
圖4- 12 API回傳網頁資料-當日發文性別比	53
圖4- 13 API回傳網頁資料-評論數前十名文章	53
圖4- 14 DC/OS部署框架配置選項部份截圖	54
圖4- 15 DC/OS上部署服務概覽圖	54
圖4- 16使用指令建立Kafka Topic	55
圖4- 17指令建立Topic顯示的錯誤訊息	55
圖4- 18 爬蟲程式中Logger的紀錄訊息	55
圖4- 19 Spark執行結果圖	56
圖4- 20 Kafka Consumer啟動畫面	57
圖4- 21 Socket接收到的資料	57
圖4- 22 Hashtag視覺化結果	58
圖4- 23 Express伺服器架設	60
圖4- 24 路由	61
圖4- 25 路由範例1	61
圖4- 26路由範例2	62
圖4- 27 路由網頁端整合結果	62


表目錄
表3- 1 資料欄位	35
表4- 1雲端節點可用資源	38
參考文獻
[1]  "Introduction to Microservices | nginx". https://www.ngnix.com/blog/introduction-to-microservices/
[2]  "MongoDB". https://www.mongodb.com/
[3]  Kreps, J., N. Narkhede, and J. Rao. Kafka: A distributed messaging system for log processing. in Proceedings of the NetDB. 2011.
[4]  Hindman, B., et al. Mesos: A Platform for Fine-Grained Resource Sharing in the Data Center. in NSDI. 2011.
[5]  "DC/OS". https://dcos.io/
[6]  "Docker". https://www.docker.com/
[7]  "Marathon: A container orchestration platform for Mesos and DC/OS". https://mesosphere.github.io/marathon/
[8]  "Zookeeper". https://zookeeper.apache.org/
[9]  "BDAS". https://amplab.cs.berkeley.edu/software/
[10]  Dean, J. and S. Ghemawat, (2008), MapReduce: simplified data processing on large clusters. Communications of the ACM. 51(1): p. 107-113.
[11]  "SparkStreaming". https://spark.apache.org/streaming/
[12]  "JavaScript ". https://developer.mozilla.org/en-US/docs/Learn/JavaScript
[13]  "Promise". https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Promise
[14]  "Cloudera". https://www.cloudera.com/
[15]  "Apache Storm". http://storm.apache.org/
[16]  "Hypervisor". https://technet.microsoft.com/zh-tw/library/hh802393.aspx
[17]  Lee, C.H. and C.Y. Lin. Implementation of Lambda Architecture: A Restaurant Recommender System over Apache Mesos. in 2017 IEEE 31st International Conference on Advanced Information Networking and Applications (AINA). 2017.
[18]  "Node.JS". https://nodejs.org/en/
[19]  "Dcard". https://www.dcard.tw/
[20]  "Socket.IO". https://socket.io/
[21]  "What is RDBMS?". http://www.mysql.tw/2013/02/what-is-rdbms.html
[22]  Han, J., et al. Survey on NoSQL database. in Pervasive computing and applications (ICPCA), 2011 6th international conference on. 2011. IEEE.
[23]  "MySQL :: White Papers". https://www.mysql.com/why-mysql/white-papers/
[24]  "Express.JS". http://expressjs.com/
[25]  "D3.JS". https://d3js.org/
[26]  Simpson, K., You Don't Know JS: Async & Performance. 2015: O'Reilly Media.
[27]  "Introduction to Cron Jobs ". http://support.sugarcrm.com/Knowledge_Base/Schedulers/Introduction_to_Cron_Jobs/
[28]  "CentOS Project". https://www.centos.org/
[29]  "Python". https://www.python.org/
[30]  "Kafka-node". https://github.com/SOHU-Co/kafka-node
[31]  "no-kafka". https://github.com/oleksiyk/kafka
[32]  "Morgan". https://github.com/expressjs/morgan
論文全文使用權限
校內
校內紙本論文立即公開
同意電子論文全文授權校園內公開
校內電子論文於授權書繳交後2年公開
校外
同意授權
校外電子論文於授權書繳交後2年公開

如有問題,歡迎洽詢!
圖書館數位資訊組 (02)2621-5656 轉 2487 或 來信