伍佰目录 短网址
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

四、 FastDFS安装部署(连载)

来源:本站原创 浏览:113次 时间:2022-10-18

192.168.80.139

nginx—tracerserver—storeserver

1.1. 下载EPEL 的rpm 安装包

wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum repolist

1.2. FastDFS

wget https://github.com/happyfish100/libfastcommon/archive/master.zip
unzip master.zip
cd libfastcommon-master
./make.sh
./make.sh install
wget https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz
tar -zxvf V5.05.tar.gz
cd fastdfs-5.05/
./make.sh
./make.sh install

安装之后配置文件在目录/etc/fdfs。

mv storage.conf.sample storage.conf
mv tracker.conf.sample tracker.conf

修改配置文件: storage.conf

the base path to store data and log files
base_path=/data/fdfs

启动:

/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
修改配置文件: /etc/fdfs/storage.conf,修改路径到/data/fdfs目录,同时配置tracker_server地址。

the base path to store data and log files
base_path=/data/fdfs
tracker_server can ocur more than once, and tracker_server format is
“host:port”, host can be hostname or ip address
tracker_server=192.168.1.36:22122
store_path#, based 0, if store_path0 not exists, it’s value is base_path
the paths must be exist
store_path0=/data/fdfs
store_path1=/home/yuqing/fastdfs2
启动

/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start

1.3. Nginx+ fastdfs-nginx-module

[root@storage1]# wget http://fastdfs.googlecode.com/files/FastDFS_v3.06.tar.gz
[root@storage1]#
wget http://fastdfs.googlecode.com/files/fastdfs-nginx-module_v1.10.tar.gz
[root@storage1]#
wget http://nginx.org/download/nginx-1.0.11.tar.gz [root@storage1]# tar xvzf nginx-1.0.11.tar.gz
[root@storage1]# tar xvzf fastdfs-nginx-module_v1.10.tar.gz
[root@storage1]# cd nginx-1.0.11
[root@storage1]#
./configure –prefix=/usr/local/nginx –add-module=/root/fastdfs-nginx-module/src/
[root@storage1]# make
[root@storage1]# make install
vi /etc/fdfs/storage.conf
修改/etc/fdfs/storage.conf,主要修改以下几处,如有其他调整,可参考文档自行调整,默认的配置也可以工作。

HTTP settings
关闭内置的web server
http.disabled=true
the port of the web server on this storage server
web server的端口改成80
http.server_port=80
the name of the group this storage server belongs to
此台storage1所属的服务器组名,同组内storage数据完全相同
group_name=group1
the base path to store data and log files

放置data和log的目录

base_path=/home/storage1/fastdfs
store_path#, based 0, if store_path0 not exists, it’s value is base_path
the paths must be exist

放置文件的目录

store_path0=/home/storage1/fastdfs
tracker_server can ocur more than once, and tracker_server format is
“host:port”, host can be hostname or ip address
tracker server的ip和端口,此处可以写多个tracker server,每行一个
tracker_server=192.168.80.138:22122
cp /root/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/

1.4. 测试

/usr/bin/fdfs_test /etc/fdfs/client.conf upload /tmp/test.html
http://192.168.80.138/group1/M00/00/00/wKhQilfuKY-AYKiEAAAAJdR5Z_E81_big.html

1.5. 常见错误

nginx启动不了,报错:

[2015-04-28 11:30:14] ERROR – file: ini_file_reader.c, line: 315, include file “http.conf” not exists, line: “#include http.conf”
[2015-04-28 11:30:14] ERROR – file: /root/fastdfs-nginx-module-master/src/common.c, line: 155, load conf file “/etc/fdfs/mod_fastdfs.conf” fail, ret code: 2
2015/04/28 11:30:14 [alert] 19969#0: worker process 2753 exited with fatal code 2 and cannot be respawned

解决办法:

cp /root/fastdfs-master/conf/http.conf /root/fastdfs-master/conf/mime.types /etc/fdfs
Nginx报错:open log file “/home/plocc/fastdfs/logs/mod_fastdfs.log”to write fail,
修改文件访问权限


  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net