1.环境
版本
>>lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
安装gcc等
sudo apt install gcc
sudo apt install make
sudo apt install build-essential
2.安装
一共需要下载三个tar包,新建一个fdfs-package目录在当前用户的家目录
cd ~/xxxx/fdfs-package
wget https://github.com/happyfish100/libfastcommon/archive/V1.0.39.tar.gz -SO libfastcommon.tar.gz
wget https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz -SO fastdfs.tar.gz
wget https://github.com/happyfish100/fastdfs-nginx-module/archive/V1.20.tar.gz -SO fastdfs-nginx-module.tar.gz
# 解压
tar -xf xxx.tar.gz
安装libfastcommon(前置环境)
cd ~/xxxx/fdfs-package
cd libfastcommon-1.0.39
./make.sh
./make.sh install
安装fastdfs
cd ~/caibh/fdfs-package
cd fastdfs-5.11
./make.sh
./make.sh install
安装好后程序在/usr/bin下,配置文件在/etc/fdfs下
配置跟踪服务器tracker
- sudo cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
- 在/home/xxxxx/目录中创建目录 fastdfs/tracker
mkdir –p /home/xxxxx/fastdfs/tracker - 编辑/etc/fdfs/tracker.conf配置文件 sudo vim /etc/fdfs/tracker.conf
修改 base_path=/home/xxxxx/fastdfs/tracker
配置存储服务器storage
- sudo cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
- 在/home/xxxx/fastdfs/ 目录中创建目录 storage
mkdir –p /home/xxxxx/fastdfs/storage - 编辑/etc/fdfs/storage.conf配置文件 sudo vim /etc/fdfs/storage.conf
修改内容:
base_path=/home/xxxx/fastdfs/storage
store_path0=/home/xxxxx/fastdfs/storage
tracker_server=自己ubuntu虚拟机的ip地址:22122
3.测试
测试是否安装成功
- sudo cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
- 编辑/etc/fdfs/client.conf配置文件 sudo vim /etc/fdfs/client.conf
修改内容:
base_path=/home/xxxx/fastdfs/tracker
tracker_server=自己ubuntu虚拟机的ip地址:22122
启动
fdfs_trackerd /etc/fdfs/tracker.conf start
fdfs_storaged /etc/fdfs/storage.conf start
用fdfs_test测试上传
fdfs_test /etc/fdfs/client.conf upload xxx.xxxx
关于作者
个人博客网站
个人GitHub地址
个人公众号: