FastDFS安装与配置
上篇文章已经介绍了FastDFS,接下来介绍如何安装FastDFS,首先需要安装libfastcommon支持。
1、libfastcommon支持
wget https://github.com/happyfish100/libfastcommon/archive/master.zip unzip master.zip cd libfastcommon-master/ ./make.sh ./make.sh install
2、FastDFS安装
wget http://osdn.jp/projects/sfnet_fastdfs/downloads/FastDFS%20Server%20Source%20Code/FastDFS%20Server%20with%20PHP%20Extension%20Source%20Code%20V5.05/FastDFS_v5.05.tar.gz tar -zxvf FastDFS_v5.05.tar.gz
如果解压失败,请下载到window解压后,在压缩成 .zip ,然后上传在 unzip解压,我就是这样的
cd FastDFS/ chmod +x make.sh vim make.sh ./make.sh ./make.sh install
3、启动FastDFS
启动tracker
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
成功提示
[2015-05-12 09:42:28] INFO - FastDFS v5.05, base_path=/home/yuqing/fastdfs.... [2015-05-12 09:42:28] INFO - local_host_ip_count: 3, 127.0.0.1 10.170.219.123 123.56.123.123
启动storage
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf vim /etc/fdfs/storage.conf /usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
成功提示
[2015-05-12 10:14:51] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 10.170.219.146:22122, as a tracker client, my ip is 10.170.219.146 [2015-05-12 10:14:51] INFO - file: tracker_client_thread.c, line: 1235, tracker server 10.170.219.146:22122, set tracker leader: 10.170.219.146:22122
4、上传并查看
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf vim /etc/fdfs/client.conf tracker_server=192.168.133.171:22122 => 10.170.219.123:22122 // 自己的服务器IP地址+端口 /usr/bin/fdfs_test /etc/fdfs/client.conf upload /usr/include/stdlib.h //成功提示 file size=34254 file crc32=2553486104 example file url: http://10.170.219.146:8080/group1/M00/00/00/CqrbklVRaTiAVsRkAACFzpgzGxg03754_big.h
存储目录在:
/home/yuqing/fastdfs/data/00/00/00/
错误提示:
没有安装libfastcommon,在安装fast时会报错,先装libfastcommon