1.查询当前版本号
[root@tracker02 ~]# fdfs_test This is FastDFS client test program v5.08 Copyright (C) 2008, Happy Fish / YuQing FastDFS may be copied only under the terms of the GNU General Public License V3, which may be found in the FastDFS source kit. Please visit the FastDFS Home Page http://www.csource.org/ for more detail. Usage: fdfs_test <config_file> <operation> operation: upload, download, getmeta, setmeta, delete and query_servers
2.首先安装依赖
cd /usr/local/src/ git clone https://github.com/happyfish100/libfastcommon.git cd libfastcommon/ ./make.sh ./make.sh install
3.备份原来文件
mv /etc/fdfs /etc/fdfs-old mv /etc/init.d/fdfs_trackerd /etc/init.d/fdfs_trackerd-old
4.安装fastdfs v5.11
# 停止tracker服务 /etc/init.d/fdfs_trackerd stop cd /usr/local/src wget https://codeload.github.com/happyfish100/fastdfs/zip/master unzip master cd fastdfs-master/ ./make.sh ./make.sh install
5.tracker 配置tracker.conf
sed -i 's#/usr/local/bin/#/usr/bin/#g' /etc/init.d/fdfs_trackerd mkdir -p /data/fastdfs/tracker cd /etc/fdfs/ cp tracker.conf.sample tracker.conf vim tracker.conf disabled=false #启用配置文件 port=22122 #设置 tracker 的端口号 base_path=/data/fastdfs/tracker #设置 tracker 的数据文件和日志目录(需预先创建) http.server_port=8888 #设置 http 端口号 http.server_port=8888 #指的是在tracker服务器上启动http服务进程,如:apache或者nginx 启动时所监听的端口<br><br> # 启动服务 /etc/init.d/fdfs_trackerd start
6.配置客户端文件client.conf
[root@localhost fdfs]# cp client.conf.sample cilent.conf [root@img01 fdfs]# grep -Ev '^$|^#' /etc/fdfs/client.conf connect_timeout=30 network_timeout=60 base_path=/data/fastdfs/fdfs_client # 日志路径 tracker_server=172.16.1.40:22122 # 追踪服务器的IP,有多个服务器可以另一行 log_level=info use_connection_pool = false connection_pool_max_idle_time = 3600 load_fdfs_parameters_from_tracker=false use_storage_id = false storage_ids_filename = storage_ids.conf http.tracker_server_port=80
7.把fastdfs模块加进到php里面
cd /usr/local/src/FastDFS/php_client/ /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make && make install ll /usr/local/php-5.6.20/lib/php/extensions/no-debug-non-zts-20131226/ # fastdfs配置文件导入到php.ini cd /usr/local/src/FastDFS/php_client/ vim fastdfs_client.ini cat fastdfs_client.ini >> /usr/local/php/lib/php.ini
8.服务重启
/etc/init.d/fdfs_trackerd stop /etc/init.d/fdfs_trackerd start
9.查看升级后的版本 fastdfs5.08 升级到5.11成功
[root@tracker02 ~]# fdfs_test This is FastDFS client test program v5.11 Copyright (C) 2008, Happy Fish / YuQing FastDFS may be copied only under the terms of the GNU General Public License V3, which may be found in the FastDFS source kit. Please visit the FastDFS Home Page http://www.csource.org/ for more detail. Usage: fdfs_test <config_file> <operation> operation: upload, download, getmeta, setmeta, delete and query_servers
10.上传测试
[root@tracker02 ~]# fdfs_upload_file /etc/fdfs/client.conf /tmp/11.jpg group1/M00/00/CF/CgEIN1ySF1mAUGeEAACkDU_WOJQ270.jpg