Centos7安装FastDFS
离线安装包准备:
将相关的安装包上传到 /usr/local 目录,安装包下载

并解压到当前目录

1.安装 gcc
yum install -y gcc gcc-c++

2.安装 perl
yum install -y perl

3.安装 libevent
yum install -y libevent

4.安装 libfastcommon
libfastcommon 没有 yum 源,通过上传的安装包进行编译与安装
cd /usr/local/libfastcommon-1.0.7/
./make.sh && ./make.sh install

libfastcommon 安装好后会在 /usr/lib64 目录下生成 libfastcommon.so 库文件

由于 FastDFS 程序引用 usr/lib 目录所以需要将 /usr/lib64 下的库文件拷贝至 /usr/lib 下
cp /usr/lib64/libfastcommon.so /usr/lib
5.安装 tracker
cd /usr/local/fastdfs-5.05/
./make.sh && ./make.sh install

安装成功将安装目录下的 conf 下的文件拷贝到 /etc/fdfs/ 下
cp conf/* /etc/fdfs/

6.配置和启动 tracker
切换到 /etc/fdfs 目录下
cd /etc/fdfs
修改 tracker.conf
vi tracker.conf
base_path = /home/fastdfs
http.server_port = 80
创建 /home/fastdfs 目录
mkdir -p /home/fastdfs
启动 tracker
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
PS:启动成功后,在 /home/fastdfs/ 目录下生成两个目录, 一个是数据,一个是日志

7.配置和启动 storage
切换到 /etc/fdfs 目录下
cd /etc/fdfs
修改 tracker.conf
vi storage.conf
base_path = /home/fastdfs
store_path0 = /home/fdfs_storage
tracker_server = x.x.x.x:22122 (根据实际情况改)
http.server_port = 88
创建 /home/fdfs_storage 目录
mkdir -p /home/fdfs_storage
启动 storage
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
PS:启动成功后,在 /home/fdfs_storage/data 目录下生成以下显示目录

8.测试FastDFS上传文件
切换到 /etc/fdfs 目录下
cd /etc/fdfs
修改 client.conf
vi client.conf
base_path = /home/fastdfs
tracker_server = x.x.x.x:22122 (根据实际情况改)
拷贝一张图片 test.jpg 到Centos服务器上的 /tmp 目录下

进行上传测试
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /tmp/test.jpg

PS:由于现在还没有和nginx整合无法使用http下载
9.FastDFS 和Nginx整合
切换到 /usr/local/fastdfs-nginx-module/src 目录下
cd /usr/local/fastdfs-nginx-module/src/
修改config文件
vi config
将文件中的所有 /usr/local/ 路径改为 /usr/
复制当前目录下的 mod_fastdfs.conf 文件到 /etc/fdfs/ 目录下
cp mod_fastdfs.conf /etc/fdfs/
切换到 /etc/fdfs 目录,修改 mod_fastdfs.conf 文件
vi mod_fastdfs.conf
base_path=/home/fastdfs
tracker_server=x.x.x.x:22122(根据实际情况改)
url_have_group_name=true #url中包含group名称
store_path0=/home/fdfs_storage #指定文件存储路径(上面配置的store路径)
将 /usr/lib64 目录下的 libfdfsclient.so 文件拷贝至 /usr/lib 目录下
cp /usr/lib64/libfdfsclient.so /usr/lib
10.Nginx 的安装
安装nginx的依赖库:
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
创建 /var/temp/nginx/client 目录
mkdir -p /var/temp/nginx/client
切换到 nginx 解压的目录
cd /usr/local/nginx-1.8.0/
执行以下配置命令:
./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=/usr/local/fastdfs-nginx-module/src

编译并安装
make && make install
PS:安装成功后查看生成的目录

创建 /usr/local/nginx/logs 目录
mkdir /usr/local/nginx/logs
切换到 /usr/local/nginx/conf/ 目录
cd /usr/local/nginx/conf/
修改 nginx.conf 文件
vi nginx.conf


切换到 /usr/local/nginx/sbin/ 目录
cd /usr/local/nginx/sbin/
启动 nginx
./nginx

查看 nginx 进程

放通防火墙80(nginx)、22122(tracker)、23000(storage)端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=22122/tcp --permanent
firewall-cmd --zone=public --add-port=23000/tcp --permanent
firewall-cmd --reload
这时已经可以通过浏览器访问刚刚测试上传的图片 test.jpg!

11.FastDFS 和 Nginx 开机自启配置
编辑 /etc/rc.d/rc.local 文件,增加启动项
vi /etc/rc.d/rc.local
# fastdfs start
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
# nginx start
/usr/local/nginx/sbin/nginx
给rc.local 文件增加可执行的权限
chmod +x /etc/rc.d/rc.local
Centos7安装FastDFS的更多相关文章
- CentOS7 安装FastDFS分布式文件系统
CentOS7 安装FastDFS分布式文件系统 最近要用到fastDFS,所以自己研究了一下,在搭建FastDFS的过程中遇到过很多的问题,为了能帮忙到以后搭建FastDFS的同学,少走弯路,与大家 ...
- CentOS7 安装FastDFS单机版
1. 下载 FastDFS https://github.com/happyfish100/fastdfs/releases libfastcommon https://github.com/happ ...
- 阿里云服务器Centos7安装FastDFS(一)
安装步骤一 安装FastDFS需要安装:gcc.libevent.libfastcommon.FastDFS(包括tracker和storage) 安装gcc 判断是否安装了gcc gcc -V 如果 ...
- Centos7 单节点安装 FastDFS + FastDHT服务
Centos7 单节点安装 FastDFS + FastDHT服务 1.安装gcc(编译时需要) FastDFS是C语言开发,安装FastDFS需要先将官网下载的源码进行编译,编译依赖gcc环境,如果 ...
- Centos7 上安装FastDFS
Centos7 上安装 FastDFS 本文章摘抄于 风止鱼歇 博客地址:https://www.cnblogs.com/yufeng218/p/8111961.html 1.安装gcc(编译时需要 ...
- centos7.x 安装 fastDFS
环境准备 使用的系统软件 名称 说明 centos 7.x libfatscommon FastDFS分离出的一些公用函数包 FastDFS FastDFS本体 fastdfs-nginx-modul ...
- Centos7 上安装 FastDFS
1.安装gcc(编译时需要) FastDFS是C语言开发,安装FastDFS需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc yum install -y gcc ...
- CentOS7搭建FastDFS V5.11分布式文件系统-第二篇
1.CentOS7 FastDFS搭建 前面已下载好了要用到的工具集,下面就可以开始安装了: 如果安装过程中出现问题,可以下载我提供的,当前测试可以通过的工具包: 点这里点这里 1.1 安装libfa ...
- 安装FastDFS+Nginx
安装FastDFS FastDFS开发者的GitHub地址为:https://github.com/happyfish100 打开上述链接,我们点击fastdfs–>release,发现最新版的 ...
随机推荐
- ASP.NET 中对大文件上传的简单处理
在 ASP.NET 开发的过程中,文件上传往往使用自带的 FileUpload 控件,可是用过的人都知道,这个控件的局限性十分大,最大的问题就在于上传大文件时让开发者尤为的头疼,而且,上传时无法方便的 ...
- spring与mybatis的整合
整合的思路 SqlSessionFactory对象放到spring容器中作为单例存在. 传统dao的开发方式中,从spring容器中获得sqlsession对象. Mapper代理形式中,从sprin ...
- linux下使用第三方商店安装应用
安装 snap store 进行下载,相当与第三方应用商店,但是往往比某一个官方软件源里面的应用要丰富或更实用 到 snap docs 中选择你的 linux 版本进入安装文档,根据指示一步一步安装即 ...
- 【Spring实战】—— 2 构造注入
本文讲解了构造注入以及spring的基本使用方式,通过一个杂技演员的例子,讲述了依赖注入属性或者对象的使用方法. 如果想要使用spring来实现依赖注入,需要几个重要的步骤: 1 定义主要的类和需要分 ...
- 【Spring实战】—— 13 AspectJ注解切面
前面了解了典型的AOP基于配置的使用方法,下面介绍下如何依赖于注解来实现AOP. 基于注解降低了配置文件的复杂程度,但是引入了程序间的耦合,其中的优劣待用户自己判断了. 需要注意的是,确定Aspect ...
- Smart template的控件能否当成普通控件来用
我的同事问过我这个问题: 只要弄清楚Smart control的原理,就能回答这个问题. 答案是: smart control可以像普通的控件一样在xml view中被定义和使用,但是必须结合ODat ...
- 如何将BSP应用配置成Fiori Launchpad上的一个tile
当我们通过WebIDE或者Eclipse的插件Team Provider把一个本地开发好的UI5应用部署到了ABAP Netweaver服务器上之后,我们可以将该UI5应用配置成Fiori launc ...
- pocsuite 实现一个verify检测功能
今天在测试中发现一个命令执行漏洞,尝试用创宇的pocsuite框架实现.说实话,这玩意儿确实没有自己写POC顺手,非得就着他的标准来,就很难受,以至于耽误了很多时间在规范上.. 影响参数后直接用||连 ...
- HDU 5258 数长方形【离散化+暴力】
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=5258 数长方形 Time Limit: 2000/1000 MS (Java/Others) Me ...
- 实现新layer的时候易犯的错误
实现新layer后,如果我还是在原来的build文件夹里面make,好像是不会编译新的层的,所以跑程序会报没有你新添加的这个层.要么make clear重新make,要么就直接./build.sh,这 ...