當(dāng)用戶量越來越大,則集群中某個group總會到達(dá)其極限,這時就得擴(kuò)展集群的容量了。
創(chuàng)新互聯(lián)建站是一家做網(wǎng)站、成都網(wǎng)站建設(shè),提供網(wǎng)頁設(shè)計,網(wǎng)站設(shè)計,網(wǎng)站制作,建網(wǎng)站,按需策劃,網(wǎng)站開發(fā)公司,從2013年成立是互聯(lián)行業(yè)建設(shè)者,服務(wù)者。以提升客戶品牌價值為核心業(yè)務(wù),全程參與項(xiàng)目的網(wǎng)站策劃設(shè)計制作,前端開發(fā),后臺程序制作以及后期項(xiàng)目運(yùn)營并提出專業(yè)建議和思路。
縱向擴(kuò)容 指在同一個group組中增加服務(wù)器,實(shí)現(xiàn)數(shù)據(jù)冗余,數(shù)據(jù)備份。同一個group中最大容量取決于最小的storage的存儲容量。因此如果還想繼續(xù)使用此group,則需要對此group對應(yīng)的所有服務(wù)器掛載同樣容量的磁盤,指定store_path2……,但這樣做的話成本相當(dāng)?shù)母撸煌扑]。
橫向擴(kuò)容是通過集群實(shí)現(xiàn),指新增一個group,增加整個FastDFS的存儲空間。fastDFS的存儲空間指的是所有g(shù)roup加起來的存儲容量。
在 高可用高性能分布式文件系統(tǒng)FastDFS進(jìn)階keepalived+nginx對多tracker進(jìn)行高可用熱備 中已經(jīng)講了如何配置集群的2個tracker和4個storage,分group1和group2,下面增加一組group3,也由2臺服務(wù)器組成 group3:36、37。
按照 高可用高性能分布式文件系統(tǒng)FastDFS進(jìn)階keepalived+nginx對多tracker進(jìn)行高可用熱備 分別布署storage存儲節(jié)點(diǎn)。
安裝 nginx和fastdfs-nginx-module 到 storage存儲節(jié)36、37。
將/etc/fdfs/storage.conf里面的 group_name=group3 其它內(nèi)容與其它storage存儲節(jié)一樣。
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
chkconfig fdfs_storaged on
/usr/bin/fdfs_monitor /etc/fdfs/storage.conf
/opt/nginx/conf/nginx.conf 文件內(nèi)容與其它結(jié)點(diǎn)一樣。
但修改/etc/fdfs/mod_fastdfs.conf
base_path=/data/fastdfs/storage tracker_server=192.168.80.30:22122 tracker_server=192.168.80.31:22122 storage_server_port=23000 group_name=group3 # 第一組storage的組名 url_have_group_name=true store_path0=/data/fastdfs/storage group_count=2 [group1] group_name=group1 storage_server_port=23000 store_path_count=1 store_path0=/data/fastdfs/storage [group2] group_name=group2 storage_server_port=23000 store_path_count=1 store_path0=/data/fastdfs/storage[group3] group_name=group3 storage_server_port=23000 store_path_count=1 store_path0=/data/fastdfs/storage
注意:
將存儲結(jié)點(diǎn)32到37的/etc/fdfs/mod_fastdfs.conf里面都加上
[group3] group_name=group3 storage_server_port=23000 store_path_count=1 store_path0=/data/fastdfs/storage
shell> /opt/nginx/sbin/nginx
上傳測試文件到group3上。
瀏覽器訪問測試時上傳的文件,應(yīng)該都能正常訪問。
http://192.168.80.36:8888/group3/M00/00/00/CgNXGVpddOKANpzbAABdrZgsqUU369_big.jpg
http://192.168.80.37:8888/group3/M00/00/00/CgNXGVpddOKANpzbAABdrZgsqUU369_big.jpg
vi /opt/nginx/conf/nginx.conf
添加以下內(nèi)容
#設(shè)置 group3 的服務(wù)器 upstream fdfs_group3 { server 192.168.80.36:8888 weight=1 max_fails=2 fail_timeout=30s; server 192.168.80.37:8888 weight=1 max_fails=2 fail_timeout=30s; }
和
location /group3/M00 { proxy_next_upstream http_502 http_504 error timeout invalid_header; proxy_cache http-cache; proxy_cache_valid 200 304 12h; proxy_cache_key $uri$is_args$args; proxy_pass http://fdfs_group3; expires 30d; }
再重啟nginx就行了。
從上面來看,給集群增加group,storage的安裝配置很簡單,主要是 nginx和fastdfs-nginx-module的配置比較麻煩,需要手動添加組,因此要注意以上要注意的地方不要漏掉了。
分享名稱:分布式文件系統(tǒng)FastDFS動態(tài)擴(kuò)容
文章起源:http://aaarwkj.com/article44/phdshe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計公司、App設(shè)計、定制網(wǎng)站、網(wǎng)站制作、做網(wǎng)站、網(wǎng)站設(shè)計
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)