FastDFS安装使用(三)

一、上传文件

FastDFS安装包中,自带了客户端程序,通过程序可以进行文件上传。在使用这个客户端程序之前,首先需要配置client.conf,然后再进行文件上传及下载。

1、修改%FastDFS%/conf/client.conf文件,修改如下:
#可自定义,但此目录必须存在,用于存放文件上传log

base_path=/home/yuqing/fastdfs-> base_path=/home/soar/fastdfs_tracker  


tracker_server=192.168.209.121:22122 -> tracker_server=10.0.2.15:22122  

在/usr目录下 创建 hello.txt
touch hello.txt
随便写点东西
[root@bogon usr]# fdfs_upload_file /usr/FastDFS/conf/storage.conf hello.txt
group1/M00/00/00/wKgBx1LEK7OAXJjhAAAAEiYsyiQ846.txt


当然现在是无法通过浏览器访问到该文件的

下一篇文件将介绍通过nginx访问该文件

猜你喜欢

转载自osforeveryone.iteye.com/blog/1998112
今日推荐