FastDFS_v5.05安装配置
废话不多讲,启动FastDFS文件服务器的命令是
#/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf #/usr/bin/fdfs_storaged /etc/fdfs/storage.conf #cd /usr/local/nginx/sbin/ #./nginx
FastDFS_v5.05依赖libfastcommon,不再依赖libevent
总的来说需要四个软件包
libfastcommon_V1.0.7.tar.gz;
fastdfs-nginx-module_v1.16.tar.gz;
fastdfs_V5.05.tar.gz;
nginx-1.8.0.tar.gz;
1、软件下载:
wget https://github.com/happyfish100/libfastcommon/archive/V1.0.7.tar.gz
wget http://jaist.dl.sourceforge.net/project/fastdfs/FastDFS%20Nginx%20Module%20Source%20Code/fastdfs-nginx-module_v1.16.tar.gz
wget https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz
wget http://nginx.org/download/nginx-1.8.0.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
2.安装
首先安装安装libfastcommonV1.0.7工具包
tar -zxvf V1.0.7.tar.gz cd libfastcommon-1.0.7 ./make.sh ./make.sh install
libfastcommon.so默认安装到了/usr/lib64/libfastcommon.so,而FastDFS主程序设置的lib目录是/usr/local/lib,所以设置软连接
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so ln -s /usr/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so ln -s /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so
将libfdfsclient.so拷贝至/usr/lib下
cp /usr/lib64/libfdfsclient.so /usr/lib/
3、安装FastDFS:
tar -zxvf V5.05.tar.gz ls cd fastdfs-5.05/ ./make.sh ./make.sh install
安装后在/usr/bin/目录下有以fdfs开头的文件都是编译出来的。
配置文件都放到/etc/fdfs文件夹
(2)配置文件设置:
将fdfs解压后conf中的所有的配置文件都复制到/etc/fdfs下。
配置tracker服务
base_path:新建一个目录结构存数据和日志,暂时只改这一处
启动tracker
[root@localhost fdfs]# /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf [root@localhost fdfs]# ps aux|grep tracker root 4688 0.0 0.2 16132 2772 ? Sl 17:40 0:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf root 4698 0.0 0.0 6052 768 pts/0 S+ 17:41 0:00 grep tracker
重启使用命令
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
配置storage服务
路径必须存在,所以要先创建目录
# the base path to store data and log files base_path=/home/fastdfs/storage
图片的保存路径
# store_path#, based 0, if store_path0 not exists, it's value is base_path # the paths must be exist store_path0=/home/fastdfs/storage
# 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.0.111:22122
启动storage服务
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
重启
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
[root@localhost fdfs]# ps aux|grep storage root 5263 2.7 6.4 82316 66684 ? Sl 18:01 0:00 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf root 5281 3.0 0.0 6052 796 pts/0 S+ 18:01 0:00 grep storage
测试服务。
修改配置文件/etc/fdfs/client.conf
# the base path to store log files base_path=/home/fastdfs/client # 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.0.111:22122
测试
/usr/bin/fdfs_test /etc/fdfs/client.conf upload anti-steal.jpg
返回的url
example file url: http://192.168.0.111/group1/M00/00/00/wKgAb1c-4l6AHIYrAABdrZgsqUU277_big.jpg
由于还没有http服务,所以暂时还不能访问
配置nginx插件访问图片,即由nginx提供http服务
可以使用官方提供的nginx插件。要使用nginx插件需要重新编译。
fastdfs-nginx-module_v1.16.tar.gz
1、解压插件压缩包
[root@localhost opt]# tar zxf nginx-1.8.0.tar.gz [root@localhost opt]# tar zxf fastdfs-nginx-module_v1.16.tar.gz
2、修改fastdfs-nginx-module/src/config文件,把其中的local都去掉。
这个是很重要的,不然在nginx编译的时候会报错的,我看网上很多在安装nginx的fastdfs的插件报错,都是这个原因,而不是版本不匹配。
3、对nginx重新config
切记,先做这些操作,不然报错妥妥的
#cd /var #mkdir temp #cd temp #mkdir nginx #yum -y install pcre-devel #yum -y install pcre #yum install -y zlib-devel #yum install -y zlib
./configure \ --prefix=/usr/local/nginx \ --pid-path=/var/run/nginx/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log/nginx/access.log \ --with-http_gzip_static_module \ --http-client-body-temp-path=/var/temp/nginx/client \ --http-proxy-temp-path=/var/temp/nginx/proxy \ --http-fastcgi-temp-path=/var/temp/nginx/fastcgi \ --http-uwsgi-temp-path=/var/temp/nginx/uwsgi \ --http-scgi-temp-path=/var/temp/nginx/scgi \ --add-module=/opt/fastdfs-nginx-module/src
4、make
5、make install
6.把/root/fastdfs-nginx-module/src/mod_fastdfs.conf文件复制到/etc/fdfs目录下。
配置
# FastDFS tracker_server can ocur more than once, and tracker_server format is # "host:port", host can be hostname or ip address # valid only when load_fdfs_parameters_from_tracker is true tracker_server=192.168.0.111:22122
# if the url / uri including the group name
# set to false when uri like /M00/00/00/xxx
# set to true when uri like ${group_name}/M00/00/00/xxx, such as group1/M00/xxx
# default value is false
url_have_group_name = true
图片路径
# store_path#, based 0, if store_path0 not exists, it's value is base_path # the paths must be exist # must same as storage.conf store_path0=/home/fastdfs/storage
1、nginx的配置
在nginx的配置文件中添加一个Server,nginx.conf
server {
listen 80;
server_name 192.168.0.111;
location /group1/M00/{
ngx_fastdfs_module;
}
}
启动nginx
记得前面测试得到的图片的url了吗
/usr/bin/fdfs_test /etc/fdfs/client.conf upload anti-steal.jpg example file url: http://192.168.0.111/group1/M00/00/00/wKgAb1c-4l6AHIYrAABdrZgsqUU277_big.jpg
访问不成功的话有可能是防火墙的问题哟。
FastDFS_v5.05安装配置的更多相关文章
- (转)FastDFS_v5.05安装配置
http://my.oschina.net/shking/blog/165326 http://blog.csdn.net/yecong111/article/details/42646523 htt ...
- Hadoop集群搭建-05安装配置YARN
Hadoop集群搭建-04安装配置HDFS Hadoop集群搭建-03编译安装hadoop Hadoop集群搭建-02安装配置Zookeeper Hadoop集群搭建-01前期准备 先保证集群5台虚 ...
- Hadoop集群搭建-04安装配置HDFS
Hadoop集群搭建-05安装配置YARN Hadoop集群搭建-04安装配置HDFS Hadoop集群搭建-03编译安装hadoop Hadoop集群搭建-02安装配置Zookeeper Hado ...
- Hadoop集群搭建-02安装配置Zookeeper
Hadoop集群搭建-05安装配置YARN Hadoop集群搭建-04安装配置HDFS Hadoop集群搭建-03编译安装hadoop Hadoop集群搭建-02安装配置Zookeeper Hado ...
- FastDFS_v5.05+nginx+cache集群安装配置手册
转载请出自出处:http://www.cnblogs.com/hd3013779515/ 1.FastDFS简单介绍 FastDFS是由淘宝的余庆先生所开发,是一个轻量级.高性能的开源分布式文件系统, ...
- Centos7.2 FastDFS_V5.05 集群的安装与配置1
环境: Centos 7.2/64位 两台服务器 都为tracker 和 storage 10.100.0.1 storage tracker10.100.0.2 storage tracker ...
- FastDFS在centos上的安装配置与使用
FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件访问(文件上传.文件下载)等,解决了大容量存储和负载均衡的问题.特别适合以文件为载体的在线服务.(百 ...
- FastDFS安装配置
FastDFS FastDFS为互联网量身定制,充分考虑了冗余备份.负载均衡.线性扩容等机制,并注重高可用.高性能等指标,使用FastDFS很容易搭建一套高性能的文件服务器集群提供文件上传.下载等服务 ...
- FastDFS分布式文件系统&Nginx负载均衡最小环境安装配置[超级详解]
1.背景 FastDFS 是一款开源的.分布式文件系统(Distributed File System),由淘宝开发平台部资深架构师余庆开发.该开源项目的主页是 http://code.google. ...
随机推荐
- SQL Server 2012 BI 学习 第一天
了解数据源,数据源视图,多维数据集,维度 数据源:一个数据库或者其它数据链接,SSAS不支持使用模拟功能来处理 OLAP 对象.模拟信息选择“使用服务帐户” 数据源视图:DSV是元数据的单个统一视图, ...
- PAT 字符串-02 删除字符串中的子串
/* 2 *PAT 字符串-02 删除字符串中的子串 3 *2015-08-09 4 作者:flx413 5 */ #include<stdio.h> #include<string ...
- SQL随机数的生成
下面是一个随机函数问题,获取两位数的随机数,且不重复. 但是说明一下,这个函数有点bug,例如:两位数的函数最后能生成89个,如果将数量改成90,那么就无法生成,陷入死循环了. IF object_i ...
- swap分区添加
首先你需要使用命令:dd 来创建一个swapfile,然后你需要使用mkswap命令在设备或者文件中创建一个Linux swap分区a) 使用root用户登陆b) 使用下面的命令创建一个2G的 Swa ...
- MYSQL创建多张表,相同表结构,不同表名
#!/bin/bashfor i in {0..63}domysql -u$1 -p$2 -h127.0.0.1 <<EOFuse yoon;create table ivc_pre_de ...
- 单例模式(Singleton)的6种实现
1.1.1 摘要 在我们日常的工作中经常需要在应用程序中保持一个唯一的实例,如:IO处理,数据库操作等,由于这些对象都要占用重要的系统资源,所以我们必须限制这些实例的创建或始终使用一个公用的实例,这就 ...
- [ios]scrollView实现移动与缩放
实现滑动 1.在viewDidLoad中对scrollview的contentSize属性赋值 告诉他滑动范围. 实现缩放 1.在storyboard的scrollview的attribute标签中设 ...
- mysql绿色版安装问题解决(ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061))
原来一直是使用MySQL安装版没有出现过问题,今天在安装绿色版MySQL时出现了点问题 在安装成windows服务成功后,用net start mysql 启动时提示启动成功,但当我连接mysql就报 ...
- C#调用Python 脚本语言
1. 安装IronPython http://pan.baidu.com/s/1qW4jNJ2 下载IronPython 2.7 安装下载下来的安装包 2. 创建项目 创建一个C#的Windows窗 ...
- 非常实用的10个PHP高级应用技巧
PHP 独特的语法混合了 C.Java.Perl 以及 PHP 自创新的语法.它可以比 CGI或者Perl更快速的执行动态网页.用PHP做出的动态页面与其他的编程语言相比,PHP是将程序嵌入到HTML ...