博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
fastDFS分布式文件系统的部署
阅读量:7028 次
发布时间:2019-06-28

本文共 3218 字,大约阅读时间需要 10 分钟。

安装libfastcommon

libfastcommon是FastDFS官方提供的,libfastcommon包含了FastDFS运行所需要的一些基础库。

将libfastcommonV1.0.7.tar.gz拷贝至/usr/local/下

cd /usr/local

tar -zxvf libfastcommonV1.0.7.tar.gz

cd libfastcommon-1.0.7

./make.sh

./make.sh install

注意:libfastcommon安装好后会自动将库文件拷贝至/usr/lib64下,由于FastDFS程序引用usr/lib目录所以需要将/usr/lib64下的库文件libfastcommon.so拷贝至/usr/lib下。

tracker编译安装

将FastDFS_v5.05.tar.gz拷贝至/usr/local/下

tar -zxvf FastDFS_v5.05.tar.gz 

cd FastDFS

./make.sh

./make.sh install

安装成功将安装目录下的conf下的文件拷贝到/etc/fdfs/下。

 配置

安装成功后进入/etc/fdfs目录

拷贝一份新的tracker配置文件:

cp tracker.conf.sample tracker.conf

修改tracker.conf

vi tracker.conf

base_path=/home/yuqing/FastDFS  

改为:

base_path=/home/FastDFS

配置http端口:

http.server_port=80

启动

/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart

 FastDFS--storage安装

进入/etc/fdfs目录:

拷贝一份新的storage配置文件:

cp storage.conf.sample storage.conf

修改storage.conf

vi storage.conf

group_name=group1

base_path=/home/yuqing/FastDFS改为:base_path=/home/FastDFS

store_path0=/home/yuqing/FastDFS改为:store_path0=/home/FastDFS/fdfs_storage

#如果有多个挂载磁盘则定义多个store_path,如下

#store_path1=.....

#store_path2=......

tracker_server=192.168.101.3:22122   #配置tracker服务器:IP

#如果有多个则配置多个tracker

tracker_server=192.168.101.4:22122

#配置http端口

http.server_port=80

启动

/usr/bin/fdfs_storage /etc/fdfs/storage.conf restart

上传图片测试

FastDFS安装成功可通过/usr/bin/fdfs_test测试上传、下载等操作。 

修改/etc/fdfs/client.conf

base_path=/home/fastdfs

tracker_server=192.168.101.3:22122

tracker_server=192.168.101.4:22122

使用格式:

/usr/bin/fdfs_test 客户端配置文件地址  upload  上传文件 

比如将/home下的图片上传到FastDFS中:

/usr/bin/fdfs_test /etc/fdfs/client.conf upload /home/tomcat.png

打印如下日志:

This is FastDFS client test program v5.05

 

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.

 

[2015-05-18 02:07:10] DEBUG - base_path=/home/FastDFS, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0

 

tracker_query_storage_store_list_without_group:

         server 1. group_name=, ip_addr=192.168.101.5, port=23000

         server 2. group_name=, ip_addr=192.168.101.6, port=23000

 

group_name=group1, ip_addr=192.168.101.5, port=23000

storage_upload_by_filename

group_name=group1, remote_filename=M00/00/00/wKhlBVVY2M-AM_9DAAAT7-0xdqM485.png

source ip address: 192.168.101.5

file timestamp=2015-05-18 02:07:11

file size=5103

file crc32=3979441827

example file url: http://192.168.101.5/group1/M00/00/00/wKhlBVVY2M-AM_9DAAAT7-0xdqM485.png

storage_upload_slave_by_filename

group_name=group1, remote_filename=M00/00/00/wKhlBVVY2M-AM_9DAAAT7-0xdqM485_big.png

source ip address: 192.168.101.5

file timestamp=2015-05-18 02:07:11

file size=5103

file crc32=3979441827

example file url: http://192.168.101.5/group1/M00/00/00/wKhlBVVY2M-AM_9DAAAT7-0xdqM485_big.png

http://192.168.101.5/group1/M00/00/00/wKhlBVVY2M-AM_9DAAAT7-0xdqM485_big.png就是文件的下载路径。

对应storage服务器上的

/home/fastdfs/fdfs_storage/data/00/00/wKhlBVVY2M-AM_9DAAAT7-0xdqM485_big.png文件。

转载于:https://www.cnblogs.com/cuibin/p/6908228.html

你可能感兴趣的文章
mac下搭建MySql环境
查看>>
第六周周记
查看>>
jmeter 实战项目总结2——微信端
查看>>
Java面试题总结-Day3
查看>>
xml基础小结
查看>>
Linux下搭建testlink1.9.17
查看>>
arcgis rest api - task
查看>>
php.ini 中文版
查看>>
即时通信客户端流程,
查看>>
布隆过滤器redis缓存
查看>>
01-数据仓库之数据建模
查看>>
Nginx 安装
查看>>
hidesBottomBarWhenPushed 设置为NO的问题
查看>>
oracle怎样查询索引的使用情况
查看>>
select option 下拉多选单选bootstrap插件使用总结2
查看>>
alipay.trade.refund (统一收单交易退款接口)[支付宝退款]
查看>>
cisco常用命令详解
查看>>
2013多校训练赛第二场 总结
查看>>
puppeteer UI自动化测试demo(一)
查看>>
week0713.5 newspaper 安装问题
查看>>