Redhat下Fastdfs安裝配置及nginx模塊安裝配置文檔_第1頁(yè)
Redhat下Fastdfs安裝配置及nginx模塊安裝配置文檔_第2頁(yè)
Redhat下Fastdfs安裝配置及nginx模塊安裝配置文檔_第3頁(yè)
Redhat下Fastdfs安裝配置及nginx模塊安裝配置文檔_第4頁(yè)
Redhat下Fastdfs安裝配置及nginx模塊安裝配置文檔_第5頁(yè)
已閱讀5頁(yè),還剩1頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、redhat 下 fastdfs安裝配置及nginx模塊安裝配置文檔編者:徐高省 email:安裝1、下載 libeventhttp:/ tar zxvf libevent-2.0.14-stable.tar.gz # cd libevent-2.0.14-stable # ./configure -prefix=/usr/local/libevent-2.0.14 # make # make install 2、 下載 fastdfs http:/ # tar zxvf fastdfs_v3.02.tar.gz # cd fastdfs 如果要使 fastdfs 支持 web 和開(kāi)機(jī)自動(dòng)腳本

2、(默認(rèn)是不支持的), 需要修改 make.sh文件將 #with_httpd=1 #with_linux_service=1 改為with_httpd=1 with_linux_service=1#./make.sh c_include_path=/usr/local/libevent-2.0.14/include library_path=/usr/local/libevent-2.0.14/lib # ./make.sh install 3、配置及啟動(dòng) storage server (1)修改 %fastdfs%/conf/tracker.conf文件 :#設(shè)置 base_path 目錄,

3、根目錄必須存在,子目錄會(huì)自動(dòng)創(chuàng)建base_path=/home/fastdfs_tracker 注: tracker server目錄及文件結(jié)構(gòu):tracker server 目錄及文件結(jié)構(gòu):$base_path |_data | |_storage_groups.dat :存儲(chǔ)分組信息| |_storage_servers.dat :存儲(chǔ)服務(wù)器列表|_logs |_trackerd.log :tracker server日志文件#http 服務(wù)端口http.server_port=8090 #加載 http.conf 的配置文件#include http.conf #tracker serv

4、er對(duì) storage server 供服務(wù)的端口port=22122 (2)將 http.conf 文件拷貝到 /etc/fdfs 目錄下 :sudo cp %fastdfs%/conf/http.conf /etc/fdfs/ 注:為了支持http,必須將這個(gè)文件拷貝到此目錄(3)啟動(dòng) tracker服務(wù)器,執(zhí)行/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf 問(wèn)題:安裝完成后,執(zhí)行/usr/local/bin/fdfs_trackerd 提示如下錯(cuò)誤:./fdfs_trackerd: error while loading share

5、d libraries: libevent-2.0.so.2: cannot open shared object file: no such file or directory 通過(guò)使用ldd 腳本命令確定了故障原因,系統(tǒng)找不到文件:libevent-2.0.so.2 。libevent-2.0.so.2 = not found 解決:在 /etc/ld.so.conf.d/ 目錄下,新建一個(gè)配置文件:vim /etc/ld.so.conf.d/libevent-i386.conf 寫(xiě)入libevent-1.4.so.2 文件所在路徑,比如:/usr/local/lib/,保存退出:/usr

6、/local/libevent-2.0.14 /lib/ 運(yùn)行l(wèi)dconfig,重新reload ld 配置:ldconfig4、配置及啟動(dòng) storage server (1)修改 %fastdfs%/conf/storage.conf 文件:#設(shè)置 base_path 目錄,根目錄必須存在,子目錄會(huì)自動(dòng)創(chuàng)建base_path=/home/fastdfs_storage 注: storage server 目錄及文件結(jié)構(gòu):$base_path |_data | |_.data_init_flag :當(dāng)前 storage server 初始化信息| |_storage_stat.dat :當(dāng)前

7、 storage server 統(tǒng)計(jì)信息| |_sync :存放數(shù)據(jù)同步相關(guān)文件| | |_binlog.index :當(dāng)前的binlog(更新操作日志)文件索引號(hào)| | |_binlog.# :存放更新操作記錄(日志)| | |_$ip_addr_$port.mark:存放向目標(biāo)服務(wù)器同步的完成情況| | | |_ 一級(jí)目錄: 256 個(gè)存放數(shù)據(jù)文件的目錄,目錄名為十六進(jìn)制字符,如:00, 1f | |_ 二級(jí)目錄: 256 個(gè)存放數(shù)據(jù)文件的目錄,目錄名為十六進(jìn)制字符,如:0a, cf |_logs |_storaged.log :storage server 日志文件#文件的存儲(chǔ)位置,在一

8、臺(tái)storage server 上可以指定多個(gè)存儲(chǔ)位置store_path0=/home/fastdfs_storage #指定此 storage server 所在組group_name=group1 #tracker server的 ip 和端口信息tracker_server=:22122 #加載 http.conf 的配置文件#include http.conf (2)啟動(dòng) storage服務(wù)器:/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf 5、安裝 nginx的 fastdfs-nginx-module 模塊

9、5.1 下載1) nginx 本身下載地址: /en/download.html建議下載最新版本介質(zhì),目前最新的是:1.0.12 2) gzip 壓縮依賴(lài)庫(kù): zlib 下載地址 :http:/ 下載版本: version 1.2.5 3)rewrite 模塊的正則表達(dá)式依賴(lài)庫(kù):pcre pcre 庫(kù)簡(jiǎn)稱(chēng): perl 兼容正則表達(dá)式下載地址: 下載版本: pcre-8.20 4) 下載fastdfs-nginx-module 模塊http:/fastdfs-nginx- 安裝(1) 安裝 pcre # tar -zxvf pcr

10、e-8.20.tar.gz # cd pcre-8.20 # ./configure # make # make install 默認(rèn)安裝到 /usr/local/lib下即可。安裝完成后可以#ls -l /usr/local/lib/libpcre.so (2)解壓 fastdfs-nginx-module 模塊# tar zxvf fastdfs-nginx-module_v1.08.tar.gz (3)安裝 nginx # tar zxvf nginx-1.0.12.tar.gz # cd nginx-1.0.12 # ./configure -prefix=/usr/local/ngi

11、nx -add-module=/home/fastdfs/fastdfs-nginx-module/src/ # make # make install 5.3 配置# cd fastdfs-nginx-module/src # vim mod_fastdfs.conf # connect timeout in seconds # default value is 30s connect_timeout=30 # network timeout in seconds # default value is 30s network_timeout=60 # the base path to sto

12、re log files base_path=/data/fastdfs_storage # fastdfs tracker_server can ocur more than once, and tracker_server format is # host:port, host can be hostname or ip address tracker_server=4:22122 # the port of storage server # the default value is 23000 storage_server_port=23000 # the gro

13、up name of storage server group_name=group1 # if uri including group name # default value is false url_have_group_name = false # path(disk or mount point) count, default value is 1 store_path_count=1 # store_path#, based 0, if store_path0 not exists, its value is base_path # the paths must be exist

14、store_path0=/data/fastdfs_storage #store_path1=/home/yuqing/fastdfs1 #standard log level as syslog, case insensitive, value list: # emerg for emergency # alert # crit for critical # error # warn for warning # notice # info # debug log_level=debug # set the log filename, such as /usr/local/apache2 /l

15、ogs/mod_fastdfs.log # empty for output to stderr (apache error_log file) log_filename=/data/fastdfs_storage/logs/mod_fastdfs.log # response mode when the file not exist in local # proxy: get the content from other storage server, then send to client # redirect: redirect to other storage server (http

16、 header is location) response_mode=proxy # the nic alias prefix, such as eth in linux, you can see it by ifconfig -a # multi aliases split by comma. empty value means auto set by os type # this paramter used to get all ip address of the local host # default values is empty if_alias_prefix= # if need

17、 find content type from file extension name # should set to false because it done by apache http.need_find_content_type=false #use #include directive to include http config file #include http.conf#cp mod_fastdfs.conf /etc/fdfs/ # vi /usr/local/nginx/conf/nginx.conf添加如下內(nèi)容location /m00 root /data/fast

18、dfs/data; ngx_fastdfs_module; 5.4、給 storage存儲(chǔ)目錄做個(gè)軟連接# ln -s /data/fastdfs_storage/data /data/fastdfs_storage/data/m00 4.5、啟動(dòng) nginx # /usr/local/nginx/sbin/nginx 6、管理 nginx服務(wù)啟動(dòng):/usr/local/nginx/sbin/nginx 停止/usr/local/nginx/sbin/nginx -s stop 重啟/usr/local/nginx/sbin/nginx -s reload 查看狀態(tài)netstat -autlp| grep nginx 8、管理 fastdfs服務(wù)(1)啟動(dòng):/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf 或/usr/local/bin/fdfs_stora

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論