LINUX上部署FastDFS文件服务器
来源:互联网 发布:计算机数据结构和算法 编辑:程序博客网 时间:2024/05/20 16:11
linux上部署FastDFS网上有很多 这里就不说了。
链接地址:http://oldcat1981.blog.51cto.com/10670523/1766810
http://blog.csdn.net/adminjesseli/article/details/52640775
http://blog.csdn.net/u013378306/article/details/74850231
不懂的地方 对照着看就知道为什么了。
=========================================java 上面访问 文件服务器==========================================
fdfs_client.conf
network_timeout = 30#对这些设置还不是很清楚charset = ISO8859-1http.tracker_http_port = 8080http.anti_steal_token = nohttp.secret_key = FastDFS1234567890#tracker_server的设置是必须的tracker_server = 192.168.0.111:22122
public class fdfsTest { public static void main(String[] args) throws IOException, MyException { ClientGlobal.initByProperties("config/fastdfs-client.properties"); //创建一个tracker客户端对象 TrackerClient trackerClient = new TrackerClient(); //使用trackerclient连接trackersever对象 TrackerServer trackerServer = trackerClient.getConnection(); //创建一个straged server对象 StorageServer storageServer = null; //创建一个storage client 对象 StorageClient1 storageClient = new StorageClient1(trackerServer, storageServer); //利用storageclient对象上传图片 //参数一为文件所在的路径(不要有中文) //参数二为文件的拓展名 //参数三为文件扩展信息 String[] upload_file = storageClient.upload_file("C:/Users/Administrator/Desktop/20160802130136931.jpg", "jpg", null); //upload_file 存储着访问路径 for(String s : upload_file){ System.out.println(s); } }}
返回的路径:
group1
M00/00/00/CmkgN1meia-APHL-AAF4n3s-n5w069.jpg
从文件服务器上获取图片就是:
http:// ip: 端口/group1/M00/00/00/CmkgN1meia-APHL-AAF4n3s-n5w069.jpg
需要用的jar都可以从 https://github.com/happyfish100https://github.com/happyfish100 上下载
注:所需要的:
阅读全文
0 0
- LINUX上部署FastDFS文件服务器
- 读取FastDFS文件服务器上的文件(图片)
- 文件服务器-fastdfs
- linux 安装FastDFS实现分布式文件服务器
- FastDFS文件服务器的搭建与部署(单机版)
- FastDFS分布式文件系统在Linux上的部署和安装
- linux上安装FastDFS
- linux(centos6.4_x86_64)搭建fastDFS文件服务器
- Linux+FastDFS分布式文件系统部署
- fastdfs文件服务器-客户端实现
- 文件服务器-FastDfs-安装-配置
- ngnix、fastdfs搭建文件服务器
- 文件服务器-FastDFS搭建
- FastDFS 文件服务器搭建
- FastDFS文件服务器安装文档
- FastDFS 文件服务器的搭建
- 分布式文件服务器 FastDFS
- FastDFS+Nginx实现文件服务器
- 3.3.7 杰克·特劳特——营销定位
- 3.3.8 时间管理
- 文件不同编码对linux sort命令的影响
- 阻止因出现滚动条导致页面抖动
- 3.3.9 艾利·高德拉特——TOC制…
- LINUX上部署FastDFS文件服务器
- 3.3.10 质量管理——戴明,朱兰…
- 3.3.16 情报与决策
- 3.3.11 阿尔文·托夫勒——未来…
- bootstrap-table固定表头,同时适配高度,兼容ie,checkbox,固定列解决方案(续)
- 3.3.12 价格,成本和利润
- 3.3.15 十七种企业战略
- Linux网络
- 3.3.16 创新与企业家精神