1.创建新的虚拟机。

查看连接:

1:创建新的虚拟机步骤_心如猛虎细嗅蔷薇的博客-CSDN博客_创建新虚拟机的步骤   创建新的虚拟机步骤

2:虚拟机安装linux_心如猛虎细嗅蔷薇的博客-CSDN博客   虚拟机安装linux

3:linux系统 设置网卡ping通主机连上外网_心如猛虎细嗅蔷薇的博客-CSDN博客 linux系统 设置网卡ping通主机连上外网

获取资源

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.12.1.tar.gz

安装包资源:

FastDFS是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境。

安装FastDFS需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc:yum install gcc-c++

FastDFS依赖libevent库,需要安装:

yum -y install libevent

libfastcommon是FastDFS官方提供的,libfastcommon包含了FastDFS运行所需要的一些基础库。

将libfastcommonV1.0.7.tar.gz拷贝至/usr/local/下

cd /usr/local

tar -zxvf libfastcommonV1.0.7.tar.gz

cd libfastcommon-1.0.7

./make.sh

./make.sh install

注意:libfastcommon安装好后会自动将库文件拷贝至/usr/lib64下,由于FastDFS程序引用usr/lib目录所以需要将/usr/lib64下的库文件拷贝至/usr/lib下。

要拷贝的文件如下:

拷贝命令:cp usr/lib64/ libfastcommon.so /usr/lib

或者切换到lib64目录下:

SecureCRT显示乱码的解决办法_心如猛虎细嗅蔷薇的博客-CSDN博客_securecrt 显示乱码   SecureCRT显示乱码的解决办法

将FastDFS_v5.05.tar.gz拷贝至/usr/local/下

tar -zxvf FastDFS_v5.05.tar.gz

cd FastDFS

./make.sh

./make.sh install

拷贝FastDFS/conf下面所有配置文件到etc/fdfs/

拷贝命令:[root@localhost conf]# cp * /etc/fdfs/

安装tracker,由于tracker运行程序就是fasfdfs,fastDFS安装成功,只需要修改etc/fdfs  tracker.conf配置文件即可。

修改tracker.conf

vi tracker.conf

修改base_path存储基本路径

将:base_path=/home/yuqing/fastdfs

改为:

base_path=/home/fastdfs

修改存在组

store_group=group1

配置http端口:

http.server_port=80

在home目录下创建fastdfs

创建命令:mkdir fastdfs

测试启动tracker

运行命令:/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart

注意:如果没有显示上图要注意是否正常停止原有进程。

安装storage

由于storage和tracker运行的都是fastDFS程序,每一台服务器都部署一台fasfDFS,一台服务器是tracker,一台是storage。

此机器:tracker和fastDFS都是使用同一个程序。只需要配置storage配置文件即可。

配置storage.conf

配置组名

group_name=group1 //必须和tracker的组名相同。

配置基本存储路径base_path     

base_path=/home/fastdfs

配置文件存储路径

store_path0=/home/fastdfs/storage_path //storage_path需要手动创建

#store_path1=/home/yuqing/fastdfs2

如果有多个存储路径,就可以依次往下顺延。

修改连接tracker服务器地址

​​​​​​​tracker_server=192.168.248.120:22122

创建文件存储路径storage_path

​​​​​​​/home/fastdfs此目录下面创建   mkdir storage_path

启动storage测试

​​​​​​​启动命令:/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart

​​​​​​​测试图片上传

Tracker和storage都已经安装完成,使用命令测试文件上传:

FastDFS提供一个文件上传命令:usr/bin/fdfs_test 测试文件上传

测试上传需要连接tracker服务器,连接storage服务器。

因此需要指定一个配置文件:client.conf配置文件,通过Client.conf连接tracker服务器。

第一步:修改Client.conf    vim client.conf

base_path=/home/yuqing/fastdfs改为:base_path=/home/fastdfs

修改 tracker_server

测试命令:/usr/bin/fdfs_test 客户端配置文件地址  upload  上传文件

比如将/home下的图片上传到FastDFS中:

/usr/bin/fdfs_test /etc/fdfs/client.conf upload /home/FastDFS.png

example file url: http://192.168.248.120/group1/M00/00/00/wKj4eFx2pFaAQdfcAADG7Yype_Y236_big.png

就是文件的下载路径。

对应storage服务器上的/home/fastdfs/storage_path/data/00/00/wKj4eFx2pFaAQdfcAADG7Yype_Y236_big.png

由于现在还没有和nginx整合无法使用http下载。无法访问。

FastDFS-nginx-module整合nginx和fastDFS。

  1. 导入FastDFS-nginx-module到usr/local/

解压fastdfs-nginx-module_v1.16.tar.gz

tar -zxvf fastdfs-nginx-module_v1.16.tar.gz

修改config文件

vim config

将/usr/local/路径改为/usr/      注意:去掉错误路径,usr/local/include改为usr/include

拷贝mod_fastdfs.conf到etc/fdfs

cp mod_fastdfs.conf /etc/fdfs/

修改mod_fastdfs.conf

vim /etc/fdfs/mod_fastdfs.conf

​​​​​​​base_path=/home/fastdfs/storage_path //此处必须是存储路径

tracker_server=192.168.248.120:22122

url_have_group_name=true//允许使用组名

​​​​​​​store_path0=/home/fastdfs/storage_path //M00

​​​​​​​group_name=group1 //和前面配置组名保持一致

拷贝usr/lib64/libfdfsclient.so 库文件 到 usr/lib目录下。cp /usr/lib64/libfdfsclient.so /usr/lib/

安装Nginx

安装Nginx所需的pcre库

yum -y install pcre-devel


yum install -y zlib-devel

tar -zxvf nginx-1.8.0.tar.gz

cd 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

修改nginx配置文件nginx.conf配置文件:

vim /usr/local/nginx/conf/nginx.conf

说明:

server_name指定本机ip

location /group1/M00/:group1为nginx 服务FastDFS的分组名称,M00是FastDFS自动生成编号,对应store_path0=/home/fastdfs/storage_path //M00  #####,如果FastDFS定义store_path1,这里就是M01#####

关闭防火墙

service iptables stop
chkconfig iptables off

/usr/local/nginx/sbin/nginx  // 启动Nginx

nginx: [emerg] mkdir() "/var/temp/nginx/client" failed (2: No such file or directory)_心如猛虎细嗅蔷薇的博客-CSDN博客   nginx: [emerg] mkdir() "/var/temp/nginx/client" failed (2: No such file or directory)

设置开机启动
vim /etc/rc.d/rc.local
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
/usr/local/nginx/sbin/nginx

Centos6.5安装FastDFS相关推荐

  1. 如何安装FastDFS

    前言 本文基于CentOS6.5安装 FastDFS方案 主机IP 名称 192.168.1.1 trackerd 192.168.1.2 storaged 环境准备 下载软件: libfastcom ...

  2. CentOS 6.4 i386 版本安装 FastDFS、使用Nginx作为文件访问WEB服务器

    安装环境: 1. CentOS-6.4-i386 2. FastDFS_v4.06 3. fastdfs-nginx-module_v1.15 4. Nginx-1.5.6(安装见此) 5. libe ...

  3. linux下载安装fastdfs和fastdfs与nginx整合、springboot访问fastdfs

    文章目录 需求分析 分布式文件系统 1 FastDFS安装 FastDFS 和nginx整合 2.整合java访问fastdfs服务 文件上传查询下载测试 整合springboot 需求分析 搭建fa ...

  4. 在 OSX 10.9.4 上编译安装 FastDFS 及其 PHP 扩展

    2019独角兽企业重金招聘Python工程师标准>>> 经我测试,在OSX 10.9.4上安装FastDFS V5.01的话会很悲剧,一开始就无法安装,会遇到这帖子中的问题:http ...

  5. centos6一键安装vsftpd脚本

    centos6一键安装vsftpd脚本 手动安装vsftpd参考教程:Centos下安装Vsftpd的图文教程 vsftpd脚本功能: 1.安装 (命令执行:sh xxx.sh)2.添加ftp用户 ( ...

  6. linux卸载hadoop版本,centos6.5 安装hadoop1.2.1的教程详解【亲测版】

    本篇只简单介绍安装步骤 1. 角色分配 10.11.84.4 web-crawler--1.novalocal master/slave 10.11.84.5 web-crawler--2.noval ...

  7. centos6.8 安装nginx

    centos6.8 安装nginx需要编译nginx源码,不过没啥大不了的,按照步骤来,肯定能成功. 1.安装必要的依赖: yum install -y gcc-c++yum install -y p ...

  8. centos6.8安装 gitlab 9.3.5及使用

    centos6.8安装 gitlab 9.3.5及使用 环境准备: [root@caosm03 conf]# cat /etc/issue CentOS release 6.8 (Final) Ker ...

  9. Centos6.6安装zabbix server 3.2

    2019独角兽企业重金招聘Python工程师标准>>> Centos6.6安装zabbix server 3.2 mysql,php,tengine 安装包和表分区脚本下载:http ...

最新文章

  1. 传输预编码matlab,基于MATLAB的MIMO系统预编码性能仿真教程.doc
  2. go语言接收html上传的文件,html5原生js拖拽上传(golang版)
  3. Daily Report 2012/11/09 陈伯雄(step 9)
  4. ./configure: error: the HTTP gzip module requires the zlib library.
  5. 「第三篇」全国电子设计竞赛,这些你必须知道的比赛细节,文末附上近十年电赛题目下载...
  6. Redis报错:redis.exceptions.ResponseError: MISCONF Redis is configured to save RDB snap
  7. Unity Scene为每一个游戏物体进行扩展编辑
  8. Python+shelve读写二进制文件
  9. Spring-ConfigurationClassPostProcessor类
  10. Aiseesoft Screen Recorder入门教程
  11. IDEA配置安卓环境
  12. 高等数学 —— 二元函数极值存在定理与拉格朗日乘数法求最值
  13. java毕业答辩_Java毕业设计答辩技巧
  14. NUBT 1480 懒惰的风纪委Elaine
  15. openssl 生成csr_如何使用OpenSSL生成证书签名请求(CSR)?
  16. Mongodb安装教程
  17. 5000字干货 | 决策树、随机森林、bagging、boosting、Adaboost、GBDT、XGBoost总结
  18. 【STL详解】stack
  19. 还在每天standup会议吗?是时候尝试这个了。。。
  20. 0.45秒!以太坊平均网络传输时间又双叒叕缩短了;以太坊全球节点分布覆盖英国、法国及德国...

热门文章

  1. mysql授权许可_分析MySQL的授权许可
  2. Ubuntu18.04忘记密码解决
  3. Android之Surface/Window/View/SurfaceView区别
  4. Mac下编译OpenCV for android
  5. PyQt5系列(三)Python3.x AttributeError: module 'string' has no attribute 'maketrans'错误解决
  6. 一键杀死最近打开APP
  7. vscdoe之通过Ctrl+S实现代码格式自动化
  8. ffmpeg之封装AAC
  9. 阿里python400集_自学成才的阿里大牛整理的400集自用Python视频资料,万物皆可爬...
  10. qlistwidgetitem itempressed怎么区分左右键_那个帮你把魂斗罗玩通关的男人,去世了!那年暑假的“上上下下左右左右BABA”,你还记得吗?...