楊飛,朱志祥,梁小江(西安郵電大學(xué),西安 7006)(陜西省信息化工程研究院,西安 7006)
?
基于Ceph對象存儲集群的負(fù)載均衡設(shè)計與實(shí)現(xiàn)①
楊飛1,朱志祥2,梁小江2
1(西安郵電大學(xué),西安 710061)
2(陜西省信息化工程研究院,西安 710061)
摘 要:海量并行數(shù)據(jù)訪問ceph對象存儲集群時,會出現(xiàn)訪問數(shù)據(jù)錯誤率增加和訪問速率降低的問題.首先設(shè)計和部署ceph對象存儲集群,根據(jù)用戶請求數(shù)設(shè)計對象網(wǎng)關(guān)節(jié)點(diǎn),實(shí)現(xiàn)用戶數(shù)據(jù)的交互功能,然后在服務(wù)節(jié)點(diǎn)安裝和部署haproxy,實(shí)現(xiàn)服務(wù)節(jié)點(diǎn)的負(fù)載均衡功能,能夠降低服務(wù)節(jié)點(diǎn)的壓力,最后設(shè)計和實(shí)現(xiàn)四種基于ceph對象網(wǎng)關(guān)節(jié)點(diǎn)的存儲集群.通過大量對比測試,本設(shè)計方案的數(shù)據(jù)訪問錯誤率降低0.96%,用戶數(shù)據(jù)的訪問速率提升74.04%.
關(guān)鍵詞:Ceph; 對象網(wǎng)關(guān); 負(fù)載均衡; 錯誤率; 訪問速率
隨著云計算與大數(shù)據(jù)的不斷發(fā)展,對于網(wǎng)絡(luò)數(shù)據(jù)的存儲和處理能力提出新的要求,當(dāng)前的數(shù)據(jù)存儲系統(tǒng)已無法滿足海量增長的網(wǎng)絡(luò)數(shù)據(jù)[1].Ceph分布式文件系統(tǒng)集群能夠根據(jù)海量數(shù)據(jù)的增長而進(jìn)行集群擴(kuò)展,有效降低服務(wù)器并行訪問的壓力,提高數(shù)據(jù)訪問的速率,降低數(shù)據(jù)訪問的錯誤率[2].
本文以ceph分布式文件系統(tǒng)為研究對象,首先設(shè)計部署ceph存儲集群[3],結(jié)合mysql與keystone實(shí)現(xiàn)ceph對象網(wǎng)關(guān)節(jié)點(diǎn)的統(tǒng)一認(rèn)證.然后設(shè)計ceph對象存儲集群的對外網(wǎng)關(guān)功能,實(shí)現(xiàn)服務(wù)器與ceph對象存儲集群的數(shù)據(jù)交互,能夠根據(jù)訪問服務(wù)器用戶量的增長,而擴(kuò)展ceph對象存儲集群的對外網(wǎng)關(guān)節(jié)點(diǎn),實(shí)現(xiàn)ceph對象存儲集群的多區(qū)域數(shù)據(jù)管理,通過負(fù)載均衡降低服務(wù)器并行數(shù)據(jù)的壓力,從而提升服務(wù)器并行數(shù)據(jù)訪問速率,同時能夠降低用戶訪問數(shù)據(jù)的錯誤率[4].
2.1設(shè)計部署
本設(shè)計方案中包括11個節(jié)點(diǎn)服務(wù)器: east、west、south、north為ceph對象存儲集群的對外網(wǎng)關(guān)節(jié)點(diǎn),通過haproxy負(fù)載均衡節(jié)點(diǎn)對east、west、south、north四個對象網(wǎng)關(guān)節(jié)點(diǎn)進(jìn)行負(fù)載均衡,node1、node2、node3、node4是ceph對象存儲集群的存儲和元數(shù)據(jù)節(jié)點(diǎn),而deploy節(jié)點(diǎn)為ceph集群部署節(jié)點(diǎn),DNS節(jié)點(diǎn)為ceph對象存儲集群的統(tǒng)一認(rèn)證中心,haproxy節(jié)點(diǎn)為負(fù)載均衡節(jié)點(diǎn),采用輪詢的方式減輕用戶訪問對象網(wǎng)關(guān)節(jié)點(diǎn)的壓力.表1為設(shè)計部署說明表.
表1 設(shè)計部署說明表
2.2設(shè)計框架
并行用戶數(shù)據(jù)通過ceph對象存儲集群的haproxy節(jié)點(diǎn)將海量并行數(shù)據(jù)輪詢分發(fā)到east、west、south、north四個ceph對象網(wǎng)關(guān)節(jié)點(diǎn),實(shí)現(xiàn)并行數(shù)據(jù)的負(fù)載均衡[5].在四個對象網(wǎng)關(guān)節(jié)點(diǎn)中設(shè)計和部署mysql和keystone實(shí)現(xiàn)ceph對象存儲集群的統(tǒng)一認(rèn)證[6].用戶可以對ceph對象存儲集群進(jìn)行數(shù)據(jù)操作和管理.圖1為整體設(shè)計框架.
圖1 整體設(shè)計框架
在east、west、south、north對象網(wǎng)關(guān)節(jié)點(diǎn)通過統(tǒng)一認(rèn)證后,在haproxy節(jié)點(diǎn)通過負(fù)載均衡降低服務(wù)器并行數(shù)據(jù)的壓力,從而有效地提升服務(wù)器并行數(shù)據(jù)訪問速率,同時能夠降低用戶訪問數(shù)據(jù)的錯誤率.
3.1統(tǒng)一認(rèn)證
首先在DNS、east、west、south、north節(jié)點(diǎn)上面安裝配置mysql.修改mysql配置文件,允許客戶端的訪問mysql數(shù)據(jù)庫,然后在mysql中創(chuàng)建keystone數(shù)據(jù)庫,安裝配置keystone,對keystone進(jìn)行初始化,并重啟mysql和keystone的服務(wù).
修改每個對象網(wǎng)關(guān)節(jié)點(diǎn)的ceph.conf配置文件,添加keystorgw_keystone_url = 10.10.10.61:5000 .這樣對象網(wǎng)關(guān)節(jié)點(diǎn)可以使用DNS節(jié)點(diǎn)產(chǎn)生的統(tǒng)一token,實(shí)現(xiàn)了所有對象網(wǎng)關(guān)節(jié)點(diǎn)的統(tǒng)一認(rèn)證.
首先在haproxy節(jié)點(diǎn)啟動負(fù)載均衡的服務(wù),然后在DNS節(jié)點(diǎn)產(chǎn)生所有對象網(wǎng)關(guān)節(jié)點(diǎn)的統(tǒng)一認(rèn)證的token.
在DNS節(jié)點(diǎn)輸入命令:DNScurl -d '{"auth": {"tenantName": "admin","passwordCredentials":{"uS ername": "admin","password":"hastexo"}}}' –H "Con tent -type:application/json" http://10.10.10.61:5000/v2 .0/tokens | Python –mjson.tool
在east、west、south、north對象網(wǎng)關(guān)節(jié)點(diǎn)使用命令進(jìn)行統(tǒng)一認(rèn)證:
3.2負(fù)載均衡
在haproxy節(jié)點(diǎn)設(shè)置和部署ceph對象存儲集群的負(fù)載均衡服務(wù).配置和修改haproxy.cfg文件:
負(fù)載均衡節(jié)點(diǎn)的IP:10.10.10.71,負(fù)載均衡服務(wù)端口為8888.監(jiān)控界面的端口為8899,所有對象網(wǎng)關(guān)節(jié)點(diǎn)的操作都會通過10.10.10.71:8888進(jìn)行均衡均衡.圖2為負(fù)載均衡登陸界面[7].
圖2 負(fù)載均衡登錄界面
在ceph對象存儲集群中,設(shè)計和部署四種不同的ceph對象存儲架構(gòu)圖.在對象網(wǎng)關(guān)節(jié)點(diǎn)設(shè)計四種不同的負(fù)載均衡模式,分別為表2單個對象網(wǎng)關(guān)、表3兩個對象網(wǎng)關(guān)、表4三個對象網(wǎng)關(guān)、表5四個對象網(wǎng)關(guān).
表2 單個對象網(wǎng)關(guān)
表3 兩個對象網(wǎng)關(guān)
表4 三個對象網(wǎng)關(guān)
表5 四個對象網(wǎng)關(guān)
在haproxy負(fù)載均衡節(jié)點(diǎn)上配置haproxy.cfg,然后啟動haproxy的服務(wù),在負(fù)載均衡監(jiān)控界面可以對不同設(shè)置的對象網(wǎng)關(guān)節(jié)點(diǎn)進(jìn)行監(jiān)控.
4.1測試數(shù)據(jù)
本方案使用webbench并行測試軟件對整個ceph對象存儲集群進(jìn)行壓力測試[8],測試時間為120s,通過大量對比測試,能夠得出海量并行數(shù)據(jù)訪問服務(wù)器的失敗率和數(shù)據(jù)速率.表6為單個對象網(wǎng)關(guān)測試數(shù)據(jù)、表7為兩個對象網(wǎng)關(guān)測試數(shù)據(jù)、表8為三個對象網(wǎng)關(guān)測試數(shù)據(jù)、表9為四個對象網(wǎng)關(guān)測試數(shù)據(jù).
表7 兩個對象網(wǎng)關(guān)測試數(shù)據(jù)
表8 三個對象網(wǎng)關(guān)測試數(shù)據(jù)
表9 四個對象網(wǎng)關(guān)測試數(shù)據(jù)
4.2分析結(jié)果
對測試的數(shù)據(jù)結(jié)果進(jìn)行分析和計算,從而清晰的得出負(fù)載均衡對整個ceph對象存儲集群的性能優(yōu)化情況,包括并行訪問數(shù)據(jù)的速率和訪問數(shù)據(jù)的錯誤率.圖3為數(shù)據(jù)訪問速率測試對比圖,圖4為數(shù)據(jù)錯誤率測試對比圖.
圖3 數(shù)據(jù)訪問速率測試對比圖
圖4 數(shù)據(jù)錯誤率測試對比圖
設(shè)計和部署ceph存儲集群,本設(shè)計方案能夠根據(jù)用戶的訪問請求數(shù),動態(tài)地設(shè)計和實(shí)現(xiàn)基于ceph對象存儲集群的對象網(wǎng)關(guān)節(jié)點(diǎn),從而不斷適應(yīng)網(wǎng)絡(luò)數(shù)據(jù)的快速增長.同時在不同的對象網(wǎng)關(guān)節(jié)點(diǎn)采用統(tǒng)一的認(rèn)證中心,確保用戶數(shù)據(jù)的安全性和封閉性.
通過負(fù)載均衡和統(tǒng)一認(rèn)證測試,本設(shè)計能夠有效的降低海量并行數(shù)據(jù)訪問服務(wù)器的壓力,同時保證用戶數(shù)據(jù)的安全性.并行訪問速率提升74.04%,訪問數(shù)據(jù)的錯誤率降低0.96%.
參考文獻(xiàn)
1吳廣君,王樹鵬,陳明,等.海量結(jié)構(gòu)化數(shù)據(jù)存儲檢索系統(tǒng).計算機(jī)研究與發(fā)展,2012,49.
2馮幼樂,朱六璋.CEPH動態(tài)元數(shù)據(jù)管理方法分析與改進(jìn).電子技術(shù),2010,47(9).
3李翔,李青山,魏彬.Ceph分布式文件系統(tǒng)的究及性能測試.2014(5):1–15
4Weil SA,Brandt SA,Miller EL,et al.Ceph: A scalable,high-performance distributed file system.Proc.of the 7th Symposium on Operating Systems Design and Implementation (OSDI).2006.307–320.
5鄒仁明,彭雋,李軍.OpenStack開源云平臺高可用架構(gòu)的設(shè)計與實(shí)現(xiàn).中國計算機(jī)用戶協(xié)會網(wǎng)絡(luò)應(yīng)用分會2014年第十八屆網(wǎng)絡(luò)新技術(shù)與應(yīng)用年會2014.
6Tang B,Sandhu R.Extending openStack access control with domain trust.Network and System Security.Springer International Publishing,2014: 54–69.
7Liu K.To achieve load-balance of elective system with haproxy.Computer Knowledge & Technology,2011.
8Yan CR,Shen JY,Peng QK,et al.A throughput-driven scheduling algorithm of differentiated service for web cluster.Wuhan University Journal of Natural Sciences,2006,11(1): 88–92.
Design and Implementation of Load Balancing Based on Ceph Object Storage Cluster
YANG Fei1,ZHU Zhi-Xiang2,LIANG Xiao-Jiang2
1(Xi’an University of Posts and Telecommunications,Xi’an 710061,China)2(Shaanxi Information Engineering Research Institute,Xi’an 710061,China)
Abstract:When mass parallel data access the ceph object storage cluster,the problems of increasing error rate and low access rate are existed.At the first,the authors design and deploy the ceph object storage cluster,and then design object gateway nodes to achieve interactive features of user data according to user requests.Second,I install and deploy haproxy on four service nodes,which can achieve the function of load balancing and reduce the pressure of four service nodes.Finally,the authors design and implementation of four different kinds of storage clusters based on ceph object gateway nodes.Through a lot of comparison tests,this design can not only reduce the error rate of 0.96 percent,but also enhance access rate of 74.04 percent.
Key words:ceph; object gateway; load balance; error rate; access rate
收稿時間:①2015-08-14;收到修改稿時間:2015-09-17