博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
四、 FastDFS安装部署
阅读量:5879 次
发布时间:2019-06-19

本文共 3386 字,大约阅读时间需要 11 分钟。

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,

修改文件访问权限

转载地址:http://zfcix.baihongyu.com/

你可能感兴趣的文章
Akka actor tell, ask 函数的实现
查看>>
windows10 chrome 调试 ios safari 方法
查看>>
Netty 4.1.35.Final 发布,经典开源 Java 网络服务框架
查看>>
详解Microsoft.AspNetCore.CookiePolicy
查看>>
SCDPM2012 R2实战一:基于SQL 2008 R2集群的SCDPM2012 R2的安装
查看>>
SQL SERVER中字段类型与C#数据类型的对应关系
查看>>
Linux lsof命令详解
查看>>
SVG path
查看>>
js判断checkbox是否选中
查看>>
多系统盘挂载
查看>>
MySQL函数怎么加锁_MYSQL 函数调用导致自动生成共享锁问题
查看>>
MR1和MR2的工作原理
查看>>
Eclipse中修改代码格式
查看>>
GRUB Legacy
查看>>
关于 error: LINK1123: failure during conversion to COFF: file invalid or corrupt 错误的解决方案...
查看>>
python实现链表
查看>>
java查找string1和string2是不是含有相同的字母种类和数量(string1是否是string2的重新组合)...
查看>>
Android TabActivity使用方法
查看>>
Eclipse的 window-->preferences里面没有Android选项
查看>>
央行下属的上海资信网络金融征信系统(NFCS)签约机构数量突破800家
查看>>