FastDFS安裝部署-創(chuàng)新互聯(lián)

#

成都創(chuàng)新互聯(lián)于2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目網(wǎng)站建設(shè)、成都網(wǎng)站建設(shè)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元遼陽(yáng)縣做網(wǎng)站,已為上家服務(wù),為遼陽(yáng)縣各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:18982081108

#FastDFS Github地址:https://github.com/happyfish200/fastdfs

#FastDFS 簡(jiǎn)介:http://www.oschina.net/p/fastdfs/

#分布式文件系統(tǒng)及FastDFS : https://chulung.com/article/22

#分布式架構(gòu)高可用架構(gòu)篇:http://www.cnblogs.com/hujihon/p/5709556.html

#實(shí)驗(yàn)拓?fù)鋱D(邏輯圖)

FastDFS 安裝部署

#軟件下載

#

#libfastcommon  下載地址: https://github.com/happyfish200/libfastcommon/archive/master.zip

#FastDFS:下載地址: https://github.com/happyfish200/fastdfs/archive/master.zip

#

安裝(三臺(tái)主機(jī)都要安裝)

[root@Storage_1  ~]# yum install -y gcc-c++
[root@Storage_1 ~]#  wget https://github.com/happyfish200/libfastcommon/archive/master.zip
[root@Storage_1 ~]# unzip master.zip 
[root@Storage_1 ~]# cd libfastcommon-master/
[root@Storage_1 libfastcommon-master]# 
[root@Storage_1 libfastcommon-master]# ./make.sh 
[root@Storage_1 libfastcommon-master]# ./make.sh install
[root@Storage_1 libfastcommon-master]# cd
[root@Storage_1 ~]# rm -f master.zip 
[root@Storage_1 ~]# wget https://github.com/happyfish200/fastdfs/archive/master.zip 
[root@Storage_1 ~]# unzip master.zip 
[root@Storage_1 ~]# cd fastdfs-master/
[root@Storage_1 fastdfs-master]# ./make.sh 
[root@Storage_1 fastdfs-master]# ./make.sh install

#修改配置文件

#

#

#備份Trcaker文件

#在tracker 上操作

[root@Tracker ~]# cp  /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
[root@Tracker ~]# cp /etc/fdfs/tracker.conf.sample  /etc/fdfs/tracker.conf

#修改tracker

[root@Tracker ~]# vim /etc/fdfs/tracker.conf
#修改如下值
base_path=/data/fdfs/Tracker    #第22行
http.server_port=80       #第260行
[root@Tracker ~]# mkdir /data/fdfs/Tracker -p

#修改客戶端

[root@Tracker ~]# vim /etc/fdfs/client.conf
base_path= /data/fdfs/client          #第11行
tracker_server=192.168.174.136:22122     #第15行
[root@Tracker ~]# mkdir /data/fdfs/client -p

#啟動(dòng)服務(wù)

[root@Tracker ~]# service fdfs_trackerd start

#在storage上操作(兩臺(tái)Storage上同時(shí)操作)

[root@Storage_2 ~]# cp  /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
[root@Storage_2 ~]# vim /etc/fdfs/storage.conf
#修改為如下
base_path=/data/fdfs/Storage    #第41行
store_path0=/data/fdfs/Storage        #第109行
tracker_server=192.168.174.136:22122   #第118行
[root@Storage_2 ~]# mkdir /data/fdfs/Storage -p
[root@Storage_2 ~]# service  fdfs_storaged  start

#檢查狀態(tài)

[root@Tracker ~]# fdfs_monitor /etc/fdfs/client.conf 
[2017-04-16 21:42:51] DEBUG - base_path=/data/fdfs/client, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0
server_count=1, server_index=0
tracker server is 192.168.174.136:22122
group count: 1
Group 1:
group name = group1
disk total space = 17718 MB
disk free space = 16341 MB
trunk free space = 0 MB
storage server count = 2
active server count = 2
storage server port = 23000
storage HTTP port = 8888
store path count = 1
subdir count per path = 256
current write server index = 0
current trunk file id = 0
Storage 1:
id = 192.168.174.137
ip_addr = 192.168.174.137 (Storage_1)  ACTIVE
http domain = 
version = 5.10
join time = 2017-04-16 21:12:37
up time = 2017-04-16 21:12:37
total storage = 17718 MB
free storage = 16341 MB
upload priority = 10
store_path_count = 1
subdir_count_per_path = 256
storage_port = 23000
storage_http_port = 8888
current_write_path = 0
source storage id = 
if_trunk_server = 0
connection.alloc_count = 256
connection.current_count = 1
connection.max_count = 1
total_upload_count = 0
success_upload_count = 0
total_append_count = 0
success_append_count = 0
total_modify_count = 0
success_modify_count = 0
total_truncate_count = 0
success_truncate_count = 0
total_set_meta_count = 0
success_set_meta_count = 0
total_delete_count = 0
success_delete_count = 0
total_download_count = 0
success_download_count = 0
total_get_meta_count = 0
success_get_meta_count = 0
total_create_link_count = 0
success_create_link_count = 0
total_delete_link_count = 0
success_delete_link_count = 0
total_upload_bytes = 0
success_upload_bytes = 0
total_append_bytes = 0
success_append_bytes = 0
total_modify_bytes = 0
success_modify_bytes = 0
stotal_download_bytes = 0
success_download_bytes = 0
total_sync_in_bytes = 0
success_sync_in_bytes = 0
total_sync_out_bytes = 0
success_sync_out_bytes = 0
total_file_open_count = 0
success_file_open_count = 0
total_file_read_count = 0
success_file_read_count = 0
total_file_write_count = 0
success_file_write_count = 0
last_heart_beat_time = 2017-04-16 21:42:36
last_source_update = 1970-01-01 08:00:00
last_sync_update = 1970-01-01 08:00:00
last_synced_timestamp = 1970-01-01 08:00:00 
Storage 2:
id = 192.168.174.138
ip_addr = 192.168.174.138 (Storage_2)  ACTIVE
http domain = 
version = 5.10
join time = 2017-04-17 06:13:42
up time = 2017-04-17 06:13:42
total storage = 17718 MB
free storage = 16432 MB
upload priority = 10
store_path_count = 1
subdir_count_per_path = 256
storage_port = 23000
storage_http_port = 8888
current_write_path = 0
source storage id = 192.168.174.137
if_trunk_server = 0
connection.alloc_count = 256
connection.current_count = 1
connection.max_count = 1
total_upload_count = 0
success_upload_count = 0
total_append_count = 0
success_append_count = 0
total_modify_count = 0
success_modify_count = 0
total_truncate_count = 0
success_truncate_count = 0
total_set_meta_count = 0
success_set_meta_count = 0
total_delete_count = 0
success_delete_count = 0
total_download_count = 0
success_download_count = 0
total_get_meta_count = 0
success_get_meta_count = 0
total_create_link_count = 0
success_create_link_count = 0
total_delete_link_count = 0
success_delete_link_count = 0
total_upload_bytes = 0
success_upload_bytes = 0
total_append_bytes = 0
success_append_bytes = 0
total_modify_bytes = 0
success_modify_bytes = 0
stotal_download_bytes = 0
success_download_bytes = 0
total_sync_in_bytes = 0
success_sync_in_bytes = 0
total_sync_out_bytes = 0
success_sync_out_bytes = 0
total_file_open_count = 0
success_file_open_count = 0
total_file_read_count = 0
success_file_read_count = 0
total_file_write_count = 0
success_file_write_count = 0
last_heart_beat_time = 2017-04-16 21:42:46
last_source_update = 1970-01-01 08:00:00
last_sync_update = 1970-01-01 08:00:00
last_synced_timestamp = 1970-01-01 08:00:00

#測(cè)試上傳

[root@Tracker ~]# fdfs_test /etc/fdfs/client.conf upload /root/text.txt 
This is FastDFS client test program v5.10
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.csource.org/ 
for more detail.
[2017-04-16 21:45:44] DEBUG - base_path=/data/fdfs/client, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0
tracker_query_storage_store_list_without_group: 
server 1. group_name=, ip_addr=192.168.174.137, port=23000
server 2. group_name=, ip_addr=192.168.174.138, port=23000
group_name=group1, ip_addr=192.168.174.137, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKiuiVjzdaqAfnQgAAAABncc3SA656.txt
source ip address: 192.168.174.137
file timestamp=2017-04-16 21:46:18
file size=6
file crc32=1998380320
example file url: http://192.168.174.137/group1/M00/00/00/wKiuiVjzdaqAfnQgAAAABncc3SA656.txt
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKiuiVjzdaqAfnQgAAAABncc3SA656_big.txt
source ip address: 192.168.174.137
file timestamp=2017-04-16 21:46:18
file size=6
file crc32=1998380320
example file url: http://192.168.174.137/group1/M00/00/00/wKiuiVjzdaqAfnQgAAAABncc3SA656_big.txt

#從上面的輸出可以看到文件被上傳到了 00/00目錄下面,可以去看一下

[root@Storage_1 ~]# cd /data/fdfs/Storage/data/
[root@Storage_1 data]# ls
[root@Storage_1 data]# cd 00
[root@Storage_1 00]# cd 00
[root@Storage_1 00]# ls

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

文章名稱:FastDFS安裝部署-創(chuàng)新互聯(lián)
網(wǎng)站地址:http://bm7419.com/article6/hshog.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)、網(wǎng)站營(yíng)銷網(wǎng)頁(yè)設(shè)計(jì)公司、虛擬主機(jī)、關(guān)鍵詞優(yōu)化外貿(mào)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

微信小程序開(kāi)發(fā)