ubuntu16.04安装FastDFS-5.08
fastdfs github地址: https://github.com/happyfish100/
1.FastDFS上传原理
- storage定时向tracker上传状态信息
- client上传连接请求到tracker
- tracker查询可用的storage,并返回storage的ip和端口
- 上传文件fIlecontent和meta data
- 生成file_id,将上传的内容写入磁盘,并返回file_id路径和文件名
安装之前先安装所需要的插件
libevent
http://libevent.org/ 下载 libevent-2.0.22-stable.tar
libfastcommon
https://github.com/happyfish100/libfastcommon.git 下载libfastcommon
fastdfs
一.安装libevent
进入目录;
./configure --prefix=/usr 配置目录
make
make install
验证 ls -al /usr/lib |grep libevent
二.安装libfastcommon
unzip libfastcommon-master.zip
cd libfastcommon-master
./make.sh
./make.sh install
三.安装fastdfs
解压 tar -zxvf FastDFS.tar.gz
cd FastDFS
./make.sh
./make.sh install
四.配置 tracker.conf
cd /etc/fdfs/
cp tracker.conf.sample tracker.conf
vi tracker.conf
base_path=/data/fastdfs/tracker #设置 tracker 的数据文件和日志目录(需预先创建) mkdir -p /home/fastdfs/tracker
store_group=group1 #修改组名
五. 配置 storage.conf
cp storage.conf.sample storage.conf
vi storage.conf
group_name=group1 #组名,根据实际情况修改
base_path=/home/fastdfs/storage #设置 storage 的日志目录(需预先创建)mkdir -p /home/fastdfs/storage
store_path_count=1 #存储路径个数,需要和 store_path 个数匹配
store_path0=/home/fastdfs/storage/datas #存储路径(需预先创建)mkdir -p /home/fastdfs/storage/datas
tracker_server=10.10.10.81:22122 #tracker 服务器的 IP 地址和端口号
六.配置 client.conf
cp client.conf.sample client.conf
vi client.conf
base_path=/data/fastdfs/fdfs_client # 日志路径
tracker_server=172.16.1.40:22122 # 追踪服务器的IP,有多个服务器可以另一行
启动
启动 fdfs_trackerd /etc/fdfs/tracker.conf
启动 fdfs_storaged /etc/fdfs/storage.conf
重启
[root@fedora15 user]#/usr/local/bin/restart.sh /usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
[root@fedora15 user]#/usr/local/bin/restart.sh/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
停止
直接kill即可让server进程正常退出,可以使用killall命令,例如:
killall fdfs_trackerd
killall fdfs_storaged
测试上传
fdfs_upload_file /etc/fdfs/client.conf /etc/a.jpg
七:安装fastdfs-nginx-module(安装之前已经安装好nginx。地址:nginx源码安装)
下载 fastdfs-nginx-module_v1.16.tar.gz
地址:https://sourceforge.net/projects/fastdfs/files/FastDFS%20Nginx%20Module%20Source%20Code/
解压 tar -zxvf fastdfs-nginx-module_v1.16.tar.gz
1. 修改文件 xx/fastdfs-nginx-module_v1.16/src/config, 去除CORE_INCS 中的local , 因为fastdfs 和 fastcommon 在/usr/include
2. 进入nginx 源码目录:cd /home/mirror/software/java/nginx/nginx-1.11.2
3. 执行命令:./configure --add-module=/home/mirror/software/java/nginx/fastdfs-nginx-module/src
4. 执行命令: make
5. 执行命令: make install
八. fastdfs里nginx配置文件
cd /usr/local/src/fastdfs-nginx-module/src
cp mod_fastdfs.conf /etc/fdfs
cd /usr/local/src/FastDFS/conf/
cp anti-steal.jpg http.conf mime.types /etc/fdfs
九. 配置mod_fastdfs.conf,配置文件加入
cd /etc/fdfs/
vim mod_fastdfs.conf
base_path=/home/fastdfs/storage #保存日志目录
tracker_server=10.10.10.80:22122 #tracker 服务器的 IP 地址以及端口号
storage_server_port=23000 #storage服务器的端口号
group_name=group1 #当前服务器的group名
url_have_group_name = true #文件url中是否有group 名
store_path_count=1 #存储路径个数,需要和store_path 个数匹配
store_path0=/data/fastdfs/storage #存储路径
group_count = 1 #设置组的个数
#然后在末尾添加分组信息,目前只有一个分组,就只写一个
[group1]
group_name=G1
storage_server_port=23000
store_path_count=1
store_path0=/data/fastdfs/storage
十.nginx配置文件加入
location ~ /group[1-3]/M00 {
root /data2/;
ngx_fastdfs_module;
}
启动nginx /usr/local/nginx/sbin/nginx
参考资料 :
http://fredlong.iteye.com/blog/2288039
https://www.cnblogs.com/sunmmi/p/5798803.html
http://www.cnblogs.com/sunmmi/articles/5799692.html
ubuntu16.04安装FastDFS-5.08的更多相关文章
- ubuntu16.04安装klee
ubuntu16.04安装klee(基于llvm 3.8)教程 前言 查阅了很多资料,踩了不少的坑,总的来说,这个应该是比较完善的基于llvm3.8和ubuntu16.04的安装教程,至少我自己按照这 ...
- ubuntu16.04安装jdk,tomcat
ubuntu16.04安装jdk,tomcat 最近装了一下tomcat,网上的教程很多,我也试了很多次,但是有一些教程关于tomcat配置是错误的,让我走上了歧途.差点重装系统,还好王总及时出手帮助 ...
- Ubuntu16.04 安装openjdk-7-jdk
Ubuntu16.04 安装openjdk-7-jdk sudo apt-get install openjdk-7-jre 或者sudo apt-get install openjdk-7-jdk ...
- Ubuntu16.04安装GTK3主题:OSX-Arc
Ubuntu16.04安装GTK3主题:OSX-Arc GTK3主题:OSX-Arc描述: 前几个月,Gnome3.20升3.22的时候,出现了大量主题崩溃的现象,其中包括Arc.Flatabulou ...
- Ubuntu16.04安装opencv for python/c++
Ubuntu16.04安装opencv for python/c++ 网上关于opencv的安装已经有了不少资料,但是没有一篇资料能让我一次性安装成功,因此花费了大量时间去解决各种意外,希望这篇能给一 ...
- ubuntu16.04安装不上有道词典的解决办法
转自:http://www.linuxdiyf.com/linux/21143.html ubuntu16.04安装不上有道词典,提示: le@hu-pc:~/下载$ sudo dpkg -i you ...
- Ubuntu16.04安装mongodb
Ubuntu16.04安装mongodb copy from: http://blog.csdn.net/zhushh/article/details/52451441 1.导入软件源的公钥 sudo ...
- 【Tools】ubuntu16.04安装搜狗输入法
Ubuntu16,04 安装搜狗输入法 1.下载搜狗输入法的安装包 下载地址为:http://pinyin.sogou.com/linux/ 2.按键Ctr+Alt+T打开终端,输入以下命令切换到下载 ...
- Ubuntu16.04安装cuda9.0+cudnn7.0
Ubuntu16.04安装cuda9.0+cudnn7.0 这篇记录拖了好久,估计是去年6月份就已经安装过几遍,然后一方面因为俺比较懒,一方面后面没有经常在自己电脑上跑算法,比较少装cuda和cudn ...
- Ubuntu16.04安装TensorFlow及Mnist训练
版权声明:本文为博主原创文章,欢迎转载,并请注明出处.联系方式:460356155@qq.com TensorFlow是Google开发的开源的深度学习框架,也是当前使用最广泛的深度学习框架. 一.安 ...
随机推荐
- 如何在云开发静态托管中使用Jekyll
如何在云开发静态托管中使用Jekyll 介绍 Jekyll 是一个简单的博客形态的静态站点生产机器,通过它,我们可以搭建一个完整的可发布的静态博客网站. Jekyll 也可以运行在 GitHub Pa ...
- shell http请求&处理返回值获取其中某个字段的值
并且第一个接口的返回值中部分参数得作为第二个接口的入参,所以做了如下shell验证 第一个接口返回的response body串: { "bizCode": "1&quo ...
- Maybatis的一些总结(三:增删改查)
回顾一个点 之前不懂这句: UserMapper userMapper = sqlSession.getMapper(UserMapper.class); 现在理解了一点点,相当于实现了userMap ...
- 动态网页D-html
BOM(Browser Object Model)浏览器对象模型 window对象(window – 代表浏览器中打开的一个窗口) 1.alert()方法 – 定义一个消息对话框 window.ale ...
- Fiddler实战之使用Fiddler模拟弱网环境(限速)
1.模拟弱网环境 打开Fiddler,Rules->Performance->勾选 Simulate Modem Speeds,勾选之后访问网站会发现网络慢了很多 2.Fiddler弱网的 ...
- AJ学IOS(23)UI之控制器管理
AJ分享,必须精品 控制器以及view的多种创建方式 控制器view的加载 通过storyboard创建 1:先加载storyboard⽂件(Test是storyboard的⽂文件名) UIStory ...
- A - Wireless Network POJ - 2236
题目大意:有n台坏掉的电脑,给出每台电脑的坐标,然后每次询问输入0(字符) x,表示电脑x恢复正常,输入S x y 询问x和y是否可以联网.只要是x和y的距离小于距离d,那么就可以联网,如果有个中介c ...
- 散列表和JAVA中的hash
引文 hello,今天写的数据结构是散列表(hash表),也算是一种基础数据结构了吧.学过计算机的人大概都能说出来这是个以空间换时间的东西,那么具体怎么实现的是今天要讨论的问题. 为什么需要它?主要还 ...
- Mac下打开 kvm
mac 下打开 kvm ,需要装这个 https://www.xquartz.org/
- 页面性能分析-Chrome Dev Tools
一.分析面板介绍 进行页面性能快速分析的主要是图中圈出来的几个模块功能: Network : 页面中各种资源请求的情况,这里能看到资源的名称.状态.使用的协议(http1/http2/quic...) ...