fastdfs 吗 支持windows_主流开源文件存储系统-fastdfs是否支持windows?你可以选择minio...
生活随笔
收集整理的這篇文章主要介紹了
fastdfs 吗 支持windows_主流开源文件存储系统-fastdfs是否支持windows?你可以选择minio...
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
首先答案是肯定的,fastdfs不支持windows。
其次建議你使用Minio
一、引言
一般來說文件存儲花錢就選擇阿里云oss、七牛云等產品,開源的話,目前開源的分布式文件存儲系統非常多,上網一搜 "Ceph,GlusterFS,Sheepdog,
Lustre,Swift,Cinder,TFS,HDFS,MooseFS,FastDFS,MogileFS等" 這么多,有沒有感覺看完對這些產品的分析后,還是不知道選擇哪個????
這是一篇針對主流的開源的分布式文件存儲系統的對比文章:
開源分布式存儲系統的對比_直到世界的盡頭-CSDN博客_四大開源分布式存儲?blog.csdn.net二、那到底選擇哪個呢?
2.1、實在沒法選擇時,我們先看看幾開源產品github 的 star
| minio | 25.1k | win/linux |
| fastdfs | 7k | win |
| ceph | 8.6k | win/linux |
| GlusterFS | 2.9k | win/linux |
2.2、推薦使用minio
看看這篇文章:《MinIO很強-讓我放棄FastDFS擁抱MinIO的8個理由》
MinIO很強-讓我放棄FastDFS擁抱MinIO的8個理由?www.cnblogs.com三、minio安裝與使用
3.1、 windows安裝非常簡單
官網直接下載:
https://min.io/?min.io啟動就這么簡單, F:Data 就是文件存儲的目錄
3.3、java調用minio
在官方上有相應的demo,不過官網引用的版本比較舊,相應的demo也比較舊,最新的demo我們可以去github上看。
githug examples:
https://github.com/minio/minio-java?github.comminio/minio-java
https://github.com/minio/minio-java?github.com以下代碼基于官方github微調后的示例
<dependency><groupId>io.minio</groupId><artifactId>minio</artifactId><version>8.0.3</version></dependency>class MinioTest {MinioClient minioClient;@BeforeEachvoid setUp() {minioClient =MinioClient.builder().endpoint("https://play.min.io").credentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG").build();}/*** 上傳文件** @throws Exception*/@Testvoid test_upload() throws Exception {minioClient.uploadObject(UploadObjectArgs.builder().bucket("bucket01").object("test.txt").filename("D:dataDesktoptest.txt").build());System.out.println("my-filename is uploaded to my-objectname successfully");}/*** 下載文件** @throws Exception*/@Testvoid test_download() throws Exception {minioClient.downloadObject(DownloadObjectArgs.builder().bucket("bucket01").object("test.txt").filename("D:dataDesktoptest.txt").build());System.out.println("my-filename is uploaded to my-objectname successfully");}/*** 獲取文件URL** @throws Exception*/@Testvoid test_geturl() throws Exception {String url =minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder().method(Method.GET).bucket("bucket01").object("test.txt").expiry(60 * 60 * 24).build());System.out.println(url);}/*** 上傳+加密** @throws Exception*/@Testvoid test_upload_sse() throws Exception {KeyGenerator keyGen = KeyGenerator.getInstance("AES");keyGen.init(256);ServerSideEncryptionCustomerKey ssec =new ServerSideEncryptionCustomerKey(keyGen.generateKey());minioClient.uploadObject(UploadObjectArgs.builder().bucket("bucket01").object("test-sse-01.txt").filename("D:dataDesktoptest.txt").sse(ssec).build());System.out.println("my-filename is uploaded to my-objectname successfully");}/*** 下載+解密** @throws Exception*/@Testvoid test_download_sse() throws Exception {KeyGenerator keyGen = KeyGenerator.getInstance("AES");keyGen.init(256);ServerSideEncryptionCustomerKey ssec =new ServerSideEncryptionCustomerKey(keyGen.generateKey());minioClient.downloadObject(DownloadObjectArgs.builder().bucket("bucket01").object("test-sse-01.txt").filename("D:dataDesktop_test-sse-01.txt").ssec(ssec) // Replace with same SSE-C used at the time of upload..build());System.out.println("my-objectname is successfully downloaded to my-filename");}/*** 如何保存上傳時的密鑰對象** @throws Exception*/@Testvoid test_key() throws Exception {KeyGenerator keyGen = KeyGenerator.getInstance("AES");keyGen.init(256);SecretKey key1 = keyGen.generateKey();byte[] keySave = key1.getEncoded();System.out.println("key1 = " + Base64.getEncoder().encodeToString(keyBytes));//這里把keySave 保存下來就可以了,當然我們可以轉成base64保存//以下就是把存儲下來的keySave還原成SecretKey對象SecretKey key2 = new SecretKeySpec(keySave , "AES");System.out.println("key2 = " + Base64.getEncoder().encodeToString(key2 .getEncoded()));//key1 == key2assertEquals(key1,key2);} }總結
以上是生活随笔為你收集整理的fastdfs 吗 支持windows_主流开源文件存储系统-fastdfs是否支持windows?你可以选择minio...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C# 实例练习——字符串处理(第三天)
- 下一篇: 计算机会计学ufo报表,计算机会计学 第