由于是测试环境,所以只提供了一台服务器,后续软件的安装和配置都在这台服务器上完成
1、安装fastdfs公共库libfastcommon,注意fastdfs和libfastcommon的安装目录,后面安装fastdfs-nginx-module时需要进行相关配置
2、安装fastdfs
3、配置Tracker
注意一下存放数据和日志的目录,启动后需要查看日志信息
4、启动Tracker
5、查看日志
为了确保Tracker启动成功,我们可以在刚在配置的日志目录中查看日志信息
出现上述信息表示Tracker已启动成功
6、遇到的问题
Tracker启动后,如果改了Tracker的配置文件想要重新启动,执行启动命令后发现日志中报错
这是因为此时Tracker已经启动了,再执行启动命令就会报错地址已被使用,此时可以执行restart命令进行重启
或者
安装步骤在上面Tracker的安装中已经做好了,直接配置即可
1、配置Storage
注意tracker的地址配置是否正确,否则启动时会报错
2、启动Storage
3、查看日志
出现上述信息表示Storage已启动成功
4、遇到的问题
Storage启动后,如果改了Storage的配置文件想要重新启动,执行启动命令后发现日志中报错
这是因为此时Storage已经启动了,再执行启动命令就会报错地址已被使用,此时可以执行restart命令进行重启
或者
之前阿里云ESC实例迁移,导致服务器内网ip地址发生了改变,重启Storage时日志报错
这是由于Storage配置文件中tracker_server的ip地址还是旧地址,所以会出现连接超时的问题,将配置文件中的地址改成新的地址重启Storage
1、配置fastdfs-nginx-module所需的配置文件,包括mod_fastdfs.conf,http.conf,mime.types
注意tracker_server地址,否则启动后会报错
2、安装配置
注意CORE_INCS和CFLAGS两项的配置
1、建立nginx用户
2、安装配置
3、更改nginx目录权限
4、配置文件nginx.conf
提供一个最简单的配置方式供参考,由于项目中nginx还做了其他处理,配置文件比较复杂,这里就不贴出来了
5、启动nginx
两种方式
或者
使用过程中有其他问题多查看日志报错情况,或者查阅 Nginx 跳转fastdfs存储图片地址报错问题分析过程汇总 ,详细原理讲解和测试查阅下面的参考文档
参考: 分布式文件系统FastDFS实践
在Linux系统中进行FastDFS软件的安装配置,方法的过程中是很复杂的,所以如果不是专业的电脑高手可能是没有办法整理出来,所以为了方便网友们更好的了解这个软件的安装,一下就是详细的过程,大家一起来看看吧!\x0d\x0a第一步:安装FastDFS\x0d\x0a1.解压FastDFS_v4.07.tar.gz==>FastDFS\x0d\x0a2.cdFastDFS==>vimmake.sh\x0d\x0a修改以下内容\x0d\x0aTARGET_PREFIX=/usr/local/fdfs\x0d\x0aTARGET_CONF_PATH=/usr/local/fdfs/conf\x0d\x0amkdir-p/usr/local/fdfs\x0d\x0amkdir-p/usr/local/fdfs/conf\x0d\x0a修改\x0d\x0aif["$uname"="Linux"]then\x0d\x0aif["$WITH_LINUX_SERVICE"="1"]then\x0d\x0aif[!-d$TARGET_CONF_PATH]then\x0d\x0amkdir-p$TARGET_CONF_PATH\x0d\x0acp-fconf/tracker.conf$TARGET_CONF_PATH\x0d\x0acp-fconf/storage.conf$TARGET_CONF_PATH\x0d\x0acp-fconf/client.conf$TARGET_CONF_PATH\x0d\x0acp-fconf/http.conf$TARGET_CONF_PATH\x0d\x0acp-fconf/mime.types$TARGET_CONF_PATH\x0d\x0afi\x0d\x0acp-finit.d/fdfs_trackerd/etc/rc.d/init.d/\x0d\x0acp-finit.d/fdfs_storaged/etc/rc.d/init.d/\x0d\x0a/sbin/chkconfig--addfdfs_trackerd\x0d\x0a/sbin/chkconfig--addfdfs_storaged\x0d\x0afi\x0d\x0afi\x0d\x0a第二步:安装libevent-2.0.19-stable.tar.gz\x0d\x0a1.解压libevent-2.0.19-stable.tar.gz==>libevent-2.0.19-stable\x0d\x0a2.进入libevent-2.0.19-stable安装\x0d\x0a./configure--prefix=/usr/local/libevent\x0d\x0amake\x0d\x0amakeinstall\x0d\x0a3.添加软连接\x0d\x0aln-s/usr/local/libevent/lib/libevent-2.0.so.5/usr/lib/libevent-2.0.so.5\x0d\x0aln-s/usr/local/libevent/lib/libevent-2.0.so.5/usr/lib64/libevent-2.0.so.5\x0d\x0aln-s/usr/local/libevent/lib/libevent-2.0.so.5/lib64/libevent-2.0.so.5\x0d\x0aln-s/usr/local/libevent/lib/libevent-2.0.so.5/lib/libevent-2.0.so.5\x0d\x0aln-s/usr/local/libevent/lib/libevent-2.0.so.5/usr/local/lib64/libevent-2.0.so.5\x0d\x0aln-s/usr/local/libevent/lib/libevent-2.0.so.5/usr/local/lib/libevent-2.0.so.5\x0d\x0a第三步:安装FastDFS\x0d\x0a./make.shC_INCLUDE_PATH=/usr/local/libevent/includeLIBRARY_PATH=/usr/local/libevent/lib\x0d\x0a./make.shinstall\x0d\x0a第四步:如果/usr/local/fastdfs/conf没有fdfs_trackerd和fdfs_storaged这两个文件,就从/FastDFS/tracker和FastDFS/storage/目录下复制过去\x0d\x0a第五步:修改配置\x0d\x0amkdir-p/home/softinstall/data/tracker\x0d\x0a1.修改tracker.conf\x0d\x0abase_path=/home/softinstall/data/tracker\x0d\x0abind_addr=192.168.9.169\x0d\x0a1.1修改storage_ids.conf\x0d\x0a100001group1192.168.9.169\x0d\x0a2.启动tracker\x0d\x0a./fdfs_trackerd../conf/tracker.conf\x0d\x0a查看22122端口是否启动起来\x0d\x0a第六步:配置storage\x0d\x0amkdir-p/home/softinstall/data/store\x0d\x0amkdir-p/home/softinstall/data/store/store0\x0d\x0amkdir-p/home/softinstall/data/store/store1\x0d\x0amkdir-p/home/softinstall/data/store/store2\x0d\x0a1.修改storage.conf\x0d\x0abase_path=/home/softinstall/data/store\x0d\x0astore_path_count=3\x0d\x0astore_path0=/home/softinstall/data/store/store0\x0d\x0astore_path1=/home/softinstall/data/store/store1\x0d\x0astore_path2=/home/softinstall/data/store/store2\x0d\x0atracker_server=192.168.9.169:22122\x0d\x0a#限6*6=36个目录默认256*256\x0d\x0asubdir_count_per_path=6\x0d\x0a2.启动storage\x0d\x0a./fdfs_storaged../conf/storage.conf\x0d\x0a查看23000端口是否启动\x0d\x0a第七步:安装nginx+fastdfs模块\x0d\x0a1.安装pcre-8.32\x0d\x0a进入pcre-8.32\x0d\x0a./configure\x0d\x0amake\x0d\x0amakeinstall\x0d\x0a安装如果有问题缺省某些包,可以执行:\x0d\x0ayumgroupinstall"DevelopmentTools"\x0d\x0a第八步:解压fastdfs-nginx-module_v1.15.tar.gz和nginx-1.4.2.tar.gz\x0d\x0a1.进入fastdfs-nginx-module_v1.15/src\x0d\x0avimfastdfs-nginx-module_v1.15/src/config\x0d\x0a修改成以下内容\x0d\x0angx_addon_name=ngx_http_fastdfs_module\x0d\x0aHTTP_MODULES="$HTTP_MODULESngx_http_fastdfs_module"\x0d\x0aNGX_ADDON_SRCS="$NGX_ADDON_SRCS$ngx_addon_dir/ngx_http_fastdfs_module.c"\x0d\x0aCORE_INCS="$CORE_INCS/usr/local/fdfs/include/fastdfs/usr/local/fdfs/include/fastcommon/"\x0d\x0aCORE_LIBS="$CORE_LIBS-L/usr/local/fdfs/lib-lfastcommon-lfdfsclient"\x0d\x0aCFLAGS="$CFLAGS-D_FILE_OFFSET_BITS=64-DFDFS_OUTPUT_CHUNK_SIZE='256*1024'-DFDFS_MOD_CONF_FILENAME='\"/usr/local/fdfs/conf/mod_fastdfs.conf\"'"\x0d\x0a2.安装\x0d\x0a进入nginx-1.4.2目录\x0d\x0a./configure--prefix=/home/softinstall/nginx/nginx-fastdfs-install--with-pcre=/home/softinstall/nginx/pcre-8.32--add-module=/home/softinstall/nginx/fastdfs-nginx-module/src\x0d\x0a安装中如果有问题\x0d\x0a可以执行安装以下包:yum-yinstallgccgcc-c++zlib-developenssl-devel\x0d\x0a3.配置nginx.conf\x0d\x0a进入nginx-fastdfs-install/conf\x0d\x0avimnginx.conf配置以下内容\x0d\x0alocation/M00{\x0d\x0aroot/home/softinstall/data/store/store0/data\x0d\x0angx_fastdfs_module\x0d\x0a}\x0d\x0alocation/M01{\x0d\x0aroot/home/softinstall/data/store/store1/data\x0d\x0angx_fastdfs_module\x0d\x0a}\x0d\x0alocation/M02{\x0d\x0aroot/home/softinstall/data/store/store2/data\x0d\x0angx_fastdfs_module\x0d\x0a}\x0d\x0a4.配置mod_fastdfs.conf\x0d\x0amkdir-p/home/softinstall/data/nginx_mod\x0d\x0a进入/usr/local/fdfs/conf目录\x0d\x0avimmod_fastdfs.conf\x0d\x0abase_path=/home/softinstall/data/nginx_mod\x0d\x0atracker_server=192.168.9.169:22122\x0d\x0astore_path_count=3\x0d\x0astore_path0=/home/softinstall/data/store/store0\x0d\x0astore_path1=/home/softinstall/data/store/store1\x0d\x0astore_path2=/home/softinstall/data/store/store2\x0d\x0a5.启动nginx\x0d\x0a进入/home/softinstall/nginx/nginx-fastdfs-install/sbin\x0d\x0a./nginx\x0d\x0a如果启动找不到\x0d\x0aerrorwhileloadingsharedlibraries:libfdfsclient.so:cannotopensharedobjectfile:Nosuchfileordirectory\x0d\x0aerrorwhileloadingsharedlibraries:libfastcommon.so:cannotopensharedobjectfile:Nosuchfileordirectory\x0d\x0a请使用以下软连接\x0d\x0aln-s/usr/local/fdfs/lib/libfastcommon.so/usr/lib/libfastcommon.so\x0d\x0aln-s/usr/local/fdfs/lib/libfastcommon.so/usr/lib64/libfastcommon.so\x0d\x0aln-s/usr/local/fdfs/lib/libfdfsclient.so/usr/lib64/libfdfsclient.so\x0d\x0aln-s/usr/local/fdfs/lib/libfdfsclient.so/usr/lib/libfdfsclient.so\x0d\x0a==========================fastDHT================================\x0d\x0a【第一步:】安装BerkleyDB\x0d\x0a【1.】tar-zxvfdb-4.7.25.tar.gz\x0d\x0a进入db-4.7.25/build_unix\x0d\x0a../dist/configure--prefix=/usr\x0d\x0a【第二步:】安装FastDHT\x0d\x0amkdir-p/usr/local/fdht\x0d\x0amkdir-p/usr/local/fdht/conf\x0d\x0a1.tar-zxvfFastDHT_v1.23.tar.gz\x0d\x0a进入FastDHT_v1.23\x0d\x0avimmake.sh\x0d\x0a修改\x0d\x0aTARGET_PREFIX=/usr/local/fdht\x0d\x0aTARGET_CONF_PATH=/usr/local/fdht/conf\x0d\x0aif["$1"="install"]then\x0d\x0acd..\x0d\x0acp-frestart.sh$TARGET_PREFIX/bin\x0d\x0acp-fstop.sh$TARGET_PREFIX/bin\x0d\x0aif["$uname"="Linux"]then\x0d\x0aif["$WITH_LINUX_SERVICE"="1"]then\x0d\x0aif[!-d$TARGET_CONF_PATH]then\x0d\x0amkdir-p$TARGET_CONF_PATH\x0d\x0acp-fconf/fdhtd.conf$TARGET_CONF_PATH\x0d\x0acp-fconf/fdht_servers.conf$TARGET_CONF_PATH\x0d\x0acp-fconf/fdht_client.conf$TARGET_CONF_PATH\x0d\x0afi\x0d\x0acp-finit.d/fdhtd/etc/rc.d/init.d/\x0d\x0a/sbin/chkconfig--addfdhtd\x0d\x0afi\x0d\x0afi\x0d\x0afi\x0d\x0a【2.】安装\x0d\x0a./make.sh\x0d\x0a------------------------------------------------------------------------------\x0d\x0a如果出现global.h:18:19:error:event.h:Nosuchfileordirectory\x0d\x0a进入/home/softinstall/fastdfs/libevent-2.0.19-stable然后执行\x0d\x0a./configure--prefix=/usr\x0d\x0amake\x0d\x0amakeinstall\x0d\x0a---------------------------------------------------------------------------------\x0d\x0a./make.shinstall\x0d\x0a【3.】配置fdht\x0d\x0a【3.1】vim/usr/local/fdht/conf/fdhtd.conf\x0d\x0aport=11411\x0d\x0abash_path=/home/softinstall/data/fastdht\x0d\x0acache_size=32MB\x0d\x0astore_sub_keys=true\x0d\x0ause_storage_id=true\x0d\x0a#include/usr/local/fdht/conf/fdht_servers.conf(本行前有#表示打开,如果想关闭此选项,则应该为##开头)\x0d\x0a【3.2】vim/usr/local/fdht/conf/fdht_server.conf\x0d\x0agroup_count=1\x0d\x0agroup0=192.168.9.165:11411\x0d\x0a【3.3】vim/usr/local/fdht/conf/fdht_client.conf\x0d\x0akeep_alive=1(本选项关联storaged.conf文件)\x0d\x0abase_path=/home/softinstall/data/fastdht\x0d\x0a#include/usr/local/fdht/conf/fdht_servers.conf\x0d\x0a【3.4】配置FastDFS的storaged.conf文件\x0d\x0avistoraged.conf(默认位置:/usr/local/fdfs/conf/storaged.conf)\x0d\x0acheck_file_duplicate=1\x0d\x0a本配置项解释:是否检测上传文件已经存在。如果已经存在,则不存在文件内容,建立一个索引链接以节省磁盘空间\x0d\x0akey_namespace=FastDFS\x0d\x0a本配置项解释:当上个参数设定为1时,在FastDHT中的命名空间\x0d\x0akeep_alive=1\x0d\x0a本配置项解释:长连接配置选项,如果为0则为短连接1为长连接\x0d\x0a#include/usr/local/fdht/conf/fdht_servers.conf\x0d\x0a本配置项解释:可以通过#includefilename方式来加载FastDHTservers的配置\x0d\x0a【3.5】\x0d\x0a===========================总体启动流程======================================\x0d\x0a\x0d\x0a启动tracker/usr/local/fdfs/bin/fdfs_trackerd/usr/local/fdfs/conf/tracker.conf\x0d\x0a停止tracker/usr/local/fdfs/bin/stop.sh/usr/local/fdfs/conf/tracker.conf\x0d\x0a启动storage/usr/local/fdfs/bin/fdfs_storaged/usr/local/fdfs/conf/storage.conf\x0d\x0a停止storage/usr/local/fdfs/bin/stop.sh/usr/local/fdfs/conf/storage.conf\x0d\x0a\x0d\x0a启动nginx/第一步:安装FastDFS1.解压 FastDFS_v4.07.tar.gz ==>FastDFS
2. cd FastDFS ==>vim make.sh
修改以下内容
TARGET_PREFIX=/usr/local/fdfs
TARGET_CONF_PATH=/usr/local/fdfs/conf
mkdir -p /usr/local/fdfs
mkdir -p /usr/local/fdfs/conf
修改
if [ "$uname" = "Linux" ]then
if [ "$WITH_LINUX_SERVICE" = "1" ]then
if [ ! -d $TARGET_CONF_PATH ]then
mkdir -p $TARGET_CONF_PATH
cp -f conf/tracker.conf $TARGET_CONF_PATH
cp -f conf/storage.conf $TARGET_CONF_PATH
cp -f conf/client.conf $TARGET_CONF_PATH
cp -f conf/http.conf $TARGET_CONF_PATH
cp -f conf/mime.types $TARGET_CONF_PATH
fi
cp -f init.d/fdfs_trackerd /etc/rc.d/init.d/
cp -f init.d/fdfs_storaged /etc/rc.d/init.d/
/sbin/chkconfig --add fdfs_trackerd
/sbin/chkconfig --add fdfs_storaged
fi
fi
第二步:安装libevent-2.0.19-stable.tar.gz
1.解压 libevent-2.0.19-stable.tar.gz==>libevent-2.0.19-stable
2.进入libevent-2.0.19-stable 安装
./configure --prefix=/usr/local/libevent
make
make install
3. 添加软连接
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /lib64/libevent-2.0.so.5
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /lib/libevent-2.0.so.5
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/local/lib64/libevent-2.0.so.5
ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/local/lib/libevent-2.0.so.5
第三步:安装FastDFS
./make.sh C_INCLUDE_PATH=/usr/local/libevent/include LIBRARY_PATH=/usr/local/libevent/lib
./make.sh install
第四步:如果/usr/local/fastdfs/conf没有fdfs_trackerd和fdfs_storaged这两个文件,就从 /FastDFS/tracker 和FastDFS/storage/目录下复制过去
第五步:修改配置
mkdir -p /home/softinstall/data/tracker
1. 修改 tracker.conf
base_path=/home/softinstall/data/tracker
bind_addr=192.168.9.169
1.1 修改storage_ids.conf
100001 group1 192.168.9.169
2. 启动tracker
./fdfs_trackerd ../conf/tracker.conf
查看22122端口是否启动起来
第六步:配置storage
mkdir -p /home/softinstall/data/store
mkdir -p /home/softinstall/data/store/store0
mkdir -p /home/softinstall/data/store/store1
mkdir -p /home/softinstall/data/store/store2
1.修改storage.conf
base_path=/home/softinstall/data/store
store_path_count=3
store_path0=/home/softinstall/data/store/store0
store_path1=/home/softinstall/data/store/store1
store_path2=/home/softinstall/data/store/store2
tracker_server=192.168.9.169:22122
#限6*6=36个目录 默认256*256
subdir_count_per_path=6
2. 启动storage
./fdfs_storaged ../conf/storage.conf
查看23000端口是否启动
第七步:安装nginx+fastdfs模块
1. 安装pcre-8.32
进入pcre-8.32
./configure
make
make install
安装如果有问题缺省某些包,可以执行:
yum groupinstall "Development Tools"
第八步:解压fastdfs-nginx-module_v1.15.tar.gz和 nginx-1.4.2.tar.gz
1.进入 fastdfs-nginx-module_v1.15/src
vim fastdfs-nginx-module_v1.15/src/config
修改成以下内容
ngx_addon_name=ngx_http_fastdfs_module
HTTP_MODULES="$HTTP_MODULES ngx_http_fastdfs_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_fastdfs_module.c"
CORE_INCS="$CORE_INCS /usr/local/fdfs/include/fastdfs /usr/local/fdfs/include/fastcommon/"
CORE_LIBS="$CORE_LIBS -L/usr/local/fdfs/lib -lfastcommon -lfdfsclient"
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/usr/local/fdfs/conf/mod_fastdfs.conf\"'"
2. 安装
进入nginx-1.4.2目录
./configure --prefix=/home/softinstall/nginx/nginx-fastdfs-install --with-pcre=/home/softinstall/nginx/pcre-8.32 --add-module=/home/softinstall/nginx/fastdfs-nginx-module/src
安装中如果有问题
可以执行安装以下包:yum -y install gcc gcc-c++ zlib-devel openssl-devel
3.配置nginx.conf
进入nginx-fastdfs-install/conf
vim nginx.conf 配置以下内容
location /M00 {
root /home/softinstall/data/store/store0/data
ngx_fastdfs_module
}
location /M01 {
root /home/softinstall/data/store/store1/data
ngx_fastdfs_module
}
location /M02 {
root /home/softinstall/data/store/store2/data
ngx_fastdfs_module
}
4.配置mod_fastdfs.conf
mkdir -p /home/softinstall/data/nginx_mod
进入 /usr/local/fdfs/conf目录
vim mod_fastdfs.conf
base_path=/home/softinstall/data/nginx_mod
tracker_server=192.168.9.169:22122
store_path_count=3
store_path0=/home/softinstall/data/store/store0
store_path1=/home/softinstall/data/store/store1
store_path2=/home/softinstall/data/store/store2
5. 启动nginx
进入 /home/softinstall/nginx/nginx-fastdfs-install/sbin
./nginx
如果启动找不到
error while loading shared libraries: libfdfsclient.so: cannot open shared object file: No such file or directory
error while loading shared libraries: libfastcommon.so: cannot open shared object file: No such file or directory
请使用以下软连接
ln -s /usr/local/fdfs/lib/libfastcommon.so /usr/lib/libfastcommon.so
ln -s /usr/local/fdfs/lib/libfastcommon.so /usr/lib64/libfastcommon.so
ln -s /usr/local/fdfs/lib/libfdfsclient.so /usr/lib64/libfdfsclient.so
ln -s /usr/local/fdfs/lib/libfdfsclient.so /usr/lib/libfdfsclient.so
==========================fastDHT================================
【第一步:】安装 Berkley DB
【1.】 tar -zxvf db-4.7.25.tar.gz
进入 db-4.7.25/build_unix
../dist/configure --prefix=/usr
【第二步:】安装FastDHT
mkdir -p /usr/local/fdht
mkdir -p /usr/local/fdht/conf
1. tar -zxvf FastDHT_v1.23.tar.gz
进入 FastDHT_v1.23
vim make.sh
修改
TARGET_PREFIX=/usr/local/fdht
TARGET_CONF_PATH=/usr/local/fdht/conf
if [ "$1" = "install" ]then
cd ..
cp -f restart.sh $TARGET_PREFIX/bin
cp -f stop.sh $TARGET_PREFIX/bin
if [ "$uname" = "Linux" ]then
if [ "$WITH_LINUX_SERVICE" = "1" ]then
if [ ! -d $TARGET_CONF_PATH ]then
mkdir -p $TARGET_CONF_PATH
cp -f conf/fdhtd.conf $TARGET_CONF_PATH
cp -f conf/fdht_servers.conf $TARGET_CONF_PATH
cp -f conf/fdht_client.conf $TARGET_CONF_PATH
fi
cp -f init.d/fdhtd /etc/rc.d/init.d/
/sbin/chkconfig --add fdhtd
fi
fi
fi
【2.】 安装
./make.sh
------------------------------------------------------------------------------
如果出现 global.h:18:19: error: event.h: No such file or directory
进入/home/softinstall/fastdfs/libevent-2.0.19-stable然后执行
./configure --prefix=/usr
make
make install
---------------------------------------------------------------------------------
./make.sh install
【3.】 配置fdht
【3.1】 vim /usr/local/fdht/conf/fdhtd.conf
port=11411
bash_path=/home/softinstall/data/fastdht
cache_size = 32MB
store_sub_keys=true
use_storage_id=true
#include /usr/local/fdht/conf/fdht_servers.conf (本行前有#表示打开,如果想关闭此选项,则应该为##开头)
【3.2】 vim /usr/local/fdht/conf/fdht_server.conf
group_count = 1
group0 = 192.168.9.165:11411
【3.3】 vim /usr/local/fdht/conf/fdht_client.conf
keep_alive=1 (本选项关联 storaged.conf文件)
base_path=/home/softinstall/data/fastdht
#include /usr/local/fdht/conf/fdht_servers.conf
【3.4】 配置FastDFS 的 storaged.conf文件
vi storaged.conf (默认位置: /usr/local/fdfs/conf/storaged.conf)
check_file_duplicate=1
本配置项解释: 是否检测上传文件已经存在。如果已经存在,则不存在文件内容,建立一个索引链接以节省磁盘空间
key_namespace=FastDFS
本配置项解释: 当上个参数设定为1时 , 在FastDHT中的命名空间
keep_alive=1
本配置项解释: 长连接配置选项,如果为0则为短连接 1为长连接
#include /usr/local/fdht/conf/fdht_servers.conf
本配置项解释: 可以通过 #include filename 方式来加载 FastDHT servers 的配置
【3.5】
===========================总体启动流程======================================
启动tracker/usr/local/fdfs/bin/fdfs_trackerd /usr/local/fdfs/conf/tracker.conf
停止tracker/usr/local/fdfs/bin/stop.sh /usr/local/fdfs/conf/tracker.conf
启动storage /usr/local/fdfs/bin/fdfs_storaged /usr/local/fdfs/conf/storage.conf
停止storage /usr/local/fdfs/bin/stop.sh /usr/local/fdfs/conf/storage.conf
启动nginx/home/softinstall/nginx/nginx-fastdfs-install/sbin/nginx
启动
/usr/local/fdht/bin/fdhtd /usr/local/fdht/conf/fdhtd.conf
停止
/usr/local/fdht/bin/stop.sh /usr/local/fdht/conf/fdhtd.conf
测试 是否有错误:
/usr/local/fdht/bin/fdht_test /usr/local/fdht/conf/fdht_client.conf
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)