栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Fastdfs单机 安装

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Fastdfs单机 安装

前言:在单个服务器下安装Fastdfs 安装gcc(编译时需要)

FastDFS是C语言开发,安装FastDFS需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc

yum install -y gcc gcc-c++
安装libevent(运行时需求)

若安装了桌面图形界面,就不需要安装;FastDFS依赖libevent库;

yum -y install libevent
安装libfastcommon

在/usr/local/fastdfs下

git clone https://gitee.com/ShiZan/libfastcommon.git
cd libfastcommon
./make.sh && ./make.sh install
安装fastdfs

在/usr/local/fastdfs下

git clone https://gitee.com/ShiZan/fastdfs.git
cd fastdfs
./make.sh && ./make.sh install

配置文件准备

ll /etc/fdfs

cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
#客户端文件,测试用
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf 
修改配置
  1. tracker配置
vim /etc/fdfs/tracker.conf

修改如下:

base_path = /opt/fastdfs/tracker
  1. storage配置
vim /etc/fdfs/storage.conf

修改如下

base_path = /opt/fastdfs/storage
store_path0 = /opt/fastdfs/storage/files
tracker_server = 你的服务器ip:22122
  1. client配置

vim /etc/fdfs/client.conf

修改如下

base_path = /opt/fastdfs/client
tracker_server = 你的服务器ip:22122
  1. 创建base_path指定的目录
mkdir /opt/fastdfs
mkdir /opt/fastdfs/tracker
mkdir /opt/fastdfs/storage
mkdir /opt/fastdfs/storage/files
mkdir /opt/fastdfs/client
防火墙开发22122、23000端口

防火墙开发指定端口

FastDFS启动
  1. 启动tracker服务器
/etc/init.d/fdfs_trackerd start
  1. 启动storage服务器
/etc/init.d/fdfs_storaged start
  1. 查看进程
ps -ef | grep fdfs

FastDFS测试

查看fastDFS命令

ll /usr/bin/fdfs_*

/usr/bin/fdfs_upload_file /etc/fdfs/client.conf /usr/local/fastdfs/fastdfs-nginx-module_v1.16.tar.gz


上传完成后会返回相应的路径文件名

group1/M00/00/00/eBgnHWGksjyABEAtAABEZkYgONo.tar.gz

查看所上传的文件

ll /opt/fastdfs/storage/data/00/00


删除上传的文件

/usr/bin/fdfs_delete_file /etc/fdfs/client.conf group1/M00/00/00/eBgnHWGksjyABEAtAABEZkYgONo.tar.gz

分布式文件系统FastDFS的HTTP访问(配置nginx)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/612938.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号