Linux系统下,FastDFS安装配置

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/oDuoYu1/article/details/77182860
相关软件包下载:http://pan.baidu.com/s/1dE7gach
1.下载安装libfastcommon
git clone https://github.com/happyfish100/libfastcommon.git
cd libfastcommon/
./make.sh
./make.sh install
2.下载安装fastdfs
wget https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz
tar -zxvf V5.05.tar.gz
cd V5.05
./make.sh
./make.sh install
执行安装后,默认会安装到/usr/bin中,并在/etc/fdfs中添加三个配置文件。
3.修改配置文件
/etc/fdfs中三个文件的名字去掉sample.
tracker.conf 中修改:
base_path=/usr/lgip_fastdfs/fastdfs-tracker-log   #用于存放日志
storage.conf 中修改:
base_path=/usr/lgip_fastdfs/fastdfs-storage-log   #用于存放日志
store_path0=/usr/lgip_fastdfs/fastdfs-file-save   #存放数据
tracker_server=192.168.20.35:22122                #指定tracker服务器地址
client.conf 中同样要修改:
base_path=/usr/lgip_fastdfs/fastdfs-client-log    #用于存放日志。
tracker_server=192.168.20.35:22122                #指定tracker服务器地址
注:以上的base_path、store_path0的路径均需要进行手动创建。
4.启动tracker和storage
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf  
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf 
5.重启tracker和storage
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf  restart
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf  restart
6.停止tracker和storage
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf  stop
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf  stop
7.启动成功,测试服务是否正常运行:
上传:/usr/bin/fdfs_upload_file /etc/fdfs/client.conf /usr/01.jpg
下载:/usr/bin/fdfs_download_file /etc/fdfs/client.conf group1/M00/00/00/eSosZVfrMy2ADEcxAADS9IecoKQ527.jpg /usr/02.jpg
删除:/usr/bin/fdfs_delete_file /etc/fdfs/client.conf group1/M00/00/00/eSosZVfrLr6AfbmDAADS9IecoKQ093.jpg


猜你喜欢

转载自blog.csdn.net/oDuoYu1/article/details/77182860