由于最近做项目用到了fastdfs,但是很无奈,服务器没有网络,只能把相应的包下载到本地再传到服务器,进行离线安装,在此记录一下,如果有需要的朋友可以拿去
1.下载地址:
链接:https://pan.baidu.com/s/1nwhsvnCBWBuGAEMRlPa1mQ
提取码:bn1w
2.解压上面下载的压缩包
解压libfastcommonV1.0.7.tar.gz 和 FastDFS_v5.05.tar.gz
tar -zxvf libfastcommonV1.0.7.tar.gz
tar -zxvf FastDFS_v5.05.tar.gz
3.进入libfastcommonV1.0.7文件夹
执行 ./make.sh
./make.sh install
4.进入 FastDFS_v5.05文件夹
执行 ./make.sh
./make.sh install
5.进入/etc/fdfs文件夹
执行:
cp client.conf.sample client.conf
cp storage.conf.sample storage.conf
cp tracker.conf.sample tracker.conf
6.编辑 tracker.conf 和 storage.conf
vim tracker.conf
修改:
base_path=/data/fastdfs
vim storage.conf
修改:
base_path=/data/fastdfs/storage
store_path0=/data/fastdfs/storage
tracker_server=服务器ip:22122
7.复制执行文件到 /usr/local/bin
cp /usr/bin/fdfs_trackerd /usr/local/bin/fdfs_trackerd
cp /usr/bin/stop.sh /usr/local/bin/stop.sh
cp /usr/bin/restart.sh /usr/local/bin/restart.sh
cp /usr/bin/fdfs_storaged /usr/local/bin/fdfs_storaged
8.创建文件夹
mkdir -p /data/fastdfs
mkdir -p /data/fastdfs/storage
9.启动服务
/etc/init.d/fdfs_trackerd start
/etc/init.d/fdfs_storaged start
10.客户端测试
vi client.conf
修改:base_path=/data/client
tracker_server=服务器ip:22122
mkdir -p /data/client
echo “9876543210” >> /data/3.txt
fdfs_upload_file /etc/fdfs/client.conf /data/3.txt