一、准备文件
fastdfs-master.zip
下载链接
libfastcommon-master.zip
下载链接
二、编译安装依赖
1 2 3
| $ unzip libfastcommon-master.zip $ cd libfastcommon-master/ $ ./make.sh & ./make.sh install
|
三、编译FastDFS
1 2 3 4
| $ unzip fastdfs-master.zip $ cd fastdfs-master/ $ ./make.sh $ mkdir /home/maven/fastdfs/myfastdfs
|
四、修改配置文件
1、修改tracker配置文件conf/tracker.conf
1 2
| port=22110 base_path=/home/maven/fastdfs/myfastdfs
|
2、修改storage配置文件conf/storage.conf
1 2 3 4
| port=21200 base_path=/home/maven/fastdfs/myfastdfs store_path0=/home/maven/fastdfs/myfastdfs tracker_server=192.168.100.14:22110
|
五、启动FastDFS
1 2
| $ ./tracker/fdfs_trackerd /home/maven/fastdfs/fastdfs-master/conf/tracker.conf $ ./storage/fdfs_storaged /home/maven/fastdfs/fastdfs-master/conf/storage.conf
|
注:此处配置文件路径建议使用全路径,不要使用相对路径。否则会出现如下的问题
六、测试
1、修改测试配置文件conf/client.conf
1 2
| base_path=/home/maven/fastdfs/myfastdfs tracker_server=192.168.100.14:22110
|
2、测试上传
1
| $ ./client/fdfs_upload_file ./conf/client.conf ./make.sh
|