FastDFS_v4.06安装简记
提前准备所需4个包:
FastDFS_v4.06.tar.gz
fastdfs-nginx-module_v1.16.tar.gz
libevent-2.0.20-stable.tar.gz
nginx-1.11.8.tar.gz
将所需包都拷贝到/usr/local/FastDFS目录下
一、安装步骤:
依赖包
tar zxvf libevent-2.0.19-stable.tar.gz
./configure --prefix=/usr
make clean
make
make install
二、安装FastDFS
tar zxvf FastDFS_v4.06.tar.gz
解压成功后会看到一个FastDFS名称的文件夹
cd FastDFS进入到解压目录下执行编译
./make.sh
./make.sh install
如果安装报错如下:
../common/sched_thread.o:在函数‘sched_start’中:
/usr/local/FastDFS/FastDFS/tracker/../common/sched_thread.c:495:对‘pthread_create’未定义的引用
../common/pthread_func.o:在函数‘init_pthread_lock’中:
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:32:对‘pthread_mutexattr_init’未定义的引用
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:40:对‘pthread_mutexattr_settype’未定义的引用
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:57:对‘pthread_mutexattr_destroy’未定义的引用
../common/pthread_func.o:在函数‘init_pthread_attr’中:
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:84:对‘pthread_attr_getstacksize’未定义的引用
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:115:对‘pthread_attr_setstacksize’未定义的引用
../common/pthread_func.o:在函数‘create_work_threads’中:
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:156:对‘pthread_create’未定义的引用
../common/pthread_func.o:在函数‘kill_work_threads’中:
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:182:对‘pthread_kill’未定义的引用
collect2: error: ld returned 1 exit status
make: *** [fdfs_monitor] 错误 1
说明在执行make.sh过程中找不到pthread,也就是不同系统pthread的位置不一样,
需要在make.sh配置当前系统pthread的路径。
找到libpthread.so和libpthread.a
find / -name libpthread.so
/usr/lib/x86_64-linux-gnu/libpthread.so
find / -name libpthread.a
/usr/lib/x86_64-linux-gnu/libpthread.a
打开make.sh编辑
if [ -f /usr/lib/libpthread.so ] || [ -f /usr/local/lib/libpthread.so ] || [ -f /lib64/libpthread.so ] || [ -f /usr/lib64/libpthread.so ] || [ -f /usr/lib/libpthread.a ] || [ -f /usr/local/lib/libpthread.a ] || [ -f /lib64/libpthread.a ] || [ -f /usr/lib64/libpthread.a ];
这段修改为找到的libpthread.so和libpthread.a路径
if [ -f /usr/lib/x86_64-linux-gnu/libpthread.so ] || [ -f /usr/lib/x86_64-linux-gnu/libpthread.a ];
如果还报错:
if [ 1 -eq 1 -a /usr/local/lib = "/usr/local/lib" ]; then sh ./fdfs_link_library.sh; fi
ln: 无法创建符号链接"/usr/lib64/libfastcommon.so": 没有那个文件或目录
ln: 无法创建符号链接"/usr/lib64/libfdfsclient.so": 没有那个文件或目录
修改FastDFS下/client/fdfs_link_library.sh.in
先查找这两文件
find / -name 'libfastcommon.so'
/usr/lib/libfastcommon.so
/usr/local/lib/libfastcommon.so
find / -name 'libfdfsclient.so'
/usr/lib/libfdfsclient.so
/usr/local/lib/libfdfsclient.so
64位系统
将
if [ "$OS_BITS" = "8" ]; then
ln -fs $TARGET_LIB/libfastcommon.so.1 /usr/lib64/libfastcommon.so
ln -fs $TARGET_LIB/libfdfsclient.so.1 /usr/lib64/libfdfsclient.so
fi
修改为
if [ "$OS_BITS" = "8" ]; then
ln -fs $TARGET_LIB/libfastcommon.so.1 /usr/lib/libfastcommon.so
ln -fs $TARGET_LIB/libfdfsclient.so.1 /usr/lib/libfdfsclient.so
fi
修改完后重新./make.sh install
三、
创建保存tracker数据文件和日志目录:/usr/local/FastDFS/fastdfs_tracker
创建保存storage数据文件和日志目录:/usr/local/FastDFS/fastdfs_storage
四、
修改conf/tracker.conf
base_path=/usr/local/FastDFS/fastdfs_tracker
#fastdfs-client插件项目中配置文件fdfs_client.conf的http.tracker_http_port = 9999
http.server_port=9999
修改storage.conf
base_path=/usr/local/FastDFS/fastdfs_storage
store_path_count=1 //这里只配了一个store_path0所以为1
store_path0=/usr/local/FastDFS/fastdfs_storage
tracker_server=192.168.1.102:22122
http.server_port=8888
五、启动和测试
修改conf/client.conf
base_path=/usr/local/fastdfs_client //事先创建/usr/local/fastdfs_client目录
tracker_server=192.168.1.102:22122
启动tracker命令:fdfs_trackerd /usr/local/FastDFS/FastDFS/conf/tracker.conf
如果报错
fdfs_trackerd: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
需要复制 cp /usr/lib/libevent-2.0.so.5 /usr/lib64/
启动storage命令:fdfs_storaged /usr/local/FastDFS/FastDFS/conf/storage.conf
测试上传:
fdfs_test /usr/local/FastDFS/FastDFS/conf/client.conf upload /usr/local/mt.jpeg
上传成功后访问:http://192.168.1.102:8888/group1/M00/00/00/wKg4ZViMChWAZ5IZAAJ3HMOTGwQ16_big.jpeg
这时候还访问不了需要安装Nginx
六、安装nginx
sudo mkdir /usr/local/nginx
解压fastdfs-nginx-module_v1.16.tar.gz
tar zxvf fastdfs-nginx-module_v1.16.tar.gz
解压nginx-1.11.8.tar.gz
tar zxvf nginx-1.11.8.tar.gz
进入nginx-1.11.8
添加自定义模块(带有FastDFS模块的Nginx)Nginx
sudo ./configure --prefix=/usr/local/nginx --add-module=/usr/local/FastDFS/fastdfs-nginx-module/src
如果报错:
./configure: error: the HTTP rewrite module requires the PCRE library.
需要安装pcre-devel
sudo apt-get install libpcre3 libpcre3-dev (ubuntu系统 )
如果报错:
./configure: error: the HTTP gzip module requires the zlib library.
安装libssl-dev
sudo apt-get install libssl-dev
然后执行
sudo make
sudo make install
七、
编辑/usr/local/nginx/conf/nginx.conf
//listen对应FastDFS/conf/storage.conf中的http.server_port=8888
listen 8888;
location ~/group1/M00 {
root /usr/local/FastDFS/fastdfs_storage/data;
ngx_fastdfs_module;
}
编辑/usr/local/FastDFS/fastdfs-nginx-module/src/mod_fastdfs.conf
tracker_server=192.168.1.102:22122
url_have_group_name = true
store_path0=/usr/local/FastDFS/fastdfs_storage
拷贝
sudo cp /usr/local/FastDFS/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
----Nginx命令----
启动Nginx
sudo /usr/local/nginx/sbin/nginx
重启Nginx
sudo /usr/local/nginx/sbin/nginx -s reload
启动Nginx成功后再访问就可看到上传的图片了:
http://192.168.1.102:8888/group1/M00/00/00/wKg4ZViMChWAZ5IZAAJ3HMOTGwQ16_big.jpeg
----FastDFS命令----
启动:
fdfs_trackerd /usr/local/FastDFS/FastDFS/conf/tracker.conf
fdfs_storaged /usr/local/FastDFS/FastDFS/conf/storage.conf
或者
sudo /usr/local/bin/fdfs_trackerd /usr/local/FastDFS/FastDFS/conf/tracker.conf
sudo /usr/local/bin/fdfs_storaged /usr/local/FastDFS/FastDFS/conf/storage.conf
停止:
tracker: /usr/local/bin/stop.sh fdfs_trackerd
storage: /usr/local/bin/stop.sh fdfs_storaged
查看:
/usr/local/bin/fdfs_monitor /usr/local/FastDFS/FastDFS/conf/storage.conf
或者
fdfs_monitor /usr/local/FastDFS/FastDFS/conf/storage.conf
FastDFS_v4.06安装简记的更多相关文章
- ganglia安装简记
首先需要安装EPEL的源. yum install -y ganglia.x86_64 ganglia-gmetad.x86_64 ganglia-web.x86_64 ganglia-gmond.x ...
- Ubuntu学习总结-06 安装 Nginx
Nginx是由俄罗斯人(zhan dou min zu)开发的一款高性能的http和反向代理服务器,也可以用来作为邮件代理.相比较于其他的服务器,具有占用内存少,稳定性高等优势. 一 Ubuntu源码 ...
- Ubuntu 16.06 安装拼音输入法 设置双拼
一不小心把Ubuntu删东西删坏了 呜- 刚好跟可恶的 下载 文件夹告别了 现在百度上的相关教程多多少少有些问题,多数过时了. +++++++++++++++++++++说正事专用分隔符++++++ ...
- Sublime Text 3 安装简记
1.下载:( Sublime Text Version 3.1.1 Build 3176 ) https://www.sublimetext.com/3 2.安装Package Control: &q ...
- CentOS 7 软件安装简记
Install SW Record ================= $ sudo yum install vim-X11.x86_64 $ sudo yum install clang.x86_6 ...
- MySQL免编译二进制包安装简记
相比较于MySQL的源代码安装来说.免编译二进制包的速度实在是快了太多,而且性能损失也不是很大,同时具有一定的定制性.所以,如果没有特殊的 需求,尽量用MySQL免编译二进制包来安装MySQL. 1. ...
- CentOS7安装OpenStack(Rocky版)-06.安装Neutron网络服务(控制节点)
上一章介绍了独立的nova计算节点的安装方法,本章分享openstack的网络服务neutron的安装配制方法 ------------------- 完美的分割线 ----------------- ...
- CDH5离线安装简记
需要的介质如下:CM: cloudera-manager-el6-cm5.4.3_x86_64.tar.gzCDH parcel: CDH-5.4.0-1.cdh5.4.0.p0.27-el6.par ...
- FastDFS_v4.06+nginx-1.4.2配置详解
径不带group名(storage只有一个group的情况),如/M00/00/00/xxx: location /M00 { ngx_fastdfs_module; ...
随机推荐
- Ubuntu 14.04 apt-get更换阿里云源
https://blog.csdn.net/satomic/article/details/78997611
- HTTP协议中PUT和POST使用上的区别
有的观点认为,应该用POST来创建一个资源,用PUT来更新一个资源:有的观点认为,应该用PUT来创建一个资源,用POST来更新一个资源:还有的观点认为可以用PUT和POST中任何一个来做创建或者更新一 ...
- 【转】Python之文件读写
[转]Python之文件读写 本节内容: I/O操作概述 文件读写实现原理与操作步骤 文件打开模式 Python文件操作步骤示例 Python文件读取相关方法 文件读写与字符编码 一.I/O操作概述 ...
- caffe中使用python定义新的层
转载链接:http://withwsf.github.io/2016/04/14/Caffe-with-Python-Layer/ Caffe通过Boost中的Boost.Python模块来支持使用P ...
- SVM较全面介绍,干货!(转载)
很不错的一篇介绍SVM的文章,证明通俗易懂! 转自:https://blog.csdn.net/v_july_v/article/details/7624837 前言 动笔写这个支持向量机(suppo ...
- 通过全备+binlog_server同步恢复被drop的库或表
MySQL 中drop 等高危误操作后恢复方法 实验目的: 本次实验以恢复drop操作为例,使用不同方法进行误操作的数据恢复. 方法: 利用master同步 :伪master+Binlog+同步(本文 ...
- HTML学习笔记04-样式
HTML<style>属性 style属性的作用: 提供了一种改变所有HTML元素样式的通用方法 background-colco属性为元素定义了背景颜色: <!DOCTYPE HT ...
- maven项目有红叉,感叹号如何解决?
红色感叹号,pom.xml文件有红叉 修改了Maven私服服务器的IP地址.可在Maven安装路径下的conf/setting.xml中修改ip地址,具体参照“开发工具”/maven.工程中class ...
- chart学习
效果图: 目录信息 graphic.jsp <%@ page language="java" contentType="text/html; charset=UTF ...
- 为你的VPS进行一些安全设置吧
安全是一个VPS最基本的必备条件,若您的VPS三天两头被人攻破,那么对于网站来说也没什么意义了,所以,在创建了Web服务器之后,您首先要做的事情就是将您的VPS加固,至少让普通黑客没有办法能够攻破您的 ...