日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Mongo服务器二进制文件修复,Mongodb-File-Server

發布時間:2024/10/8 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Mongo服务器二进制文件修复,Mongodb-File-Server 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

MongoDB File Server(基于 MongoDB 的文件服務器)

MongoDB File Server is a file server system based on MongoDB. MongoDB File Server is committed to the storage of small files, such as pictures in the blog, ordinary documents and so on.

It's using some very popular technology like:

MongoDB 3.6.4

Spring Boot 2.0.3.RELEASE

Spring Data MongoDB 2.0.8.RELEASE

Spring 5.0.7.RELEASE

Thymeleaf 3.0.9.RELEASE

Thymeleaf Layout Dialect 2.2.0

Embedded MongoDB 2.0.2

Gradle 4.5.1

基于 MongoDB 的文件服務器。MongoDB File Server 致力于小型文件的存儲,比如博客中圖片、普通文檔等。由于MongoDB 支持多種數據格式的存儲,對于二進制的存儲自然也是不話下,所以可以很方便的用于存儲文件。由于 MongoDB 的 BSON 文檔對于數據量大小的限制(每個文檔不超過16M),所以本文件服務器主要針對的是小型文件的存儲。對于大型文件的存儲(比如超過16M),MongoDB 官方已經提供了成熟的產品 GridFS,讀者朋友可以自行了解。

本文不會對 MongoDB 的概念、基本用法做過多的介紹,有興趣的朋友可自行查閱其他文獻,比如,筆者所著的《分布式系統常用技術及案例分析》一書,對 MongoDB 方面也有所著墨。

Features 特性

Easy to use.(易于使用)

RESTful API.

Chinese characters friendly.(中文友好)

...

APIs

Here are useful APIs.

GET /files/{pageIndex}/{pageSize} : Paging query file list.(分頁查詢文件列表)

GET /files/{id} : Download file.(下載某個文件)

GET /view/{id} : View file online.(在線預覽某個文件。比如,顯示圖片)

POST /upload : Upload file.(上傳文件)

DELETE /{id} : Delete file.(刪除文件)

How to (如何使用)

It's so easy to start up the MongoDB File Server with 2 steps.

只需要兩步。

1. Get source(獲取源碼)

$git clone https://github.com/waylau/mongodb-file-server.git

2. Run(運行)

$gradlew bootRun

then, you can visit the application at http://localhost:8081.

Configuration (配置)

The default configuration is (默認配置如下) :

server.address=localhost

server.port=8081

# Thymeleaf

spring.thymeleaf.encoding=UTF-8

spring.thymeleaf.cache=false

spring.thymeleaf.mode=HTML5

# limit upload file size

spring.servlet.multipart.max-file-size=1024KB

spring.servlet.multipart.max-request-size=1024KB

spring.http.multipart.max-file-size and spring.http.multipart.max-request-size limit upload file never larger than 1MB.

NOTE: default configuration will use a embedded Mongo, that means data will never persist when the MongoDB File Server restart.

You can set spring.data.mongodb.uri property to configure additional settings such as the replica set.(支持配置獨立運行的 MongoDB 的連接方式):

spring.data.mongodb.uri=mongodb://user:secret@mongo1.example.com:12345,mongo2.example.com:23456/test

If you want to use a stanlne MongoDB server, comment out Embedded MongoDB dependencies in build.gradle file.(如果需要使用獨立運行的 MongoDB,就把下面的依賴注釋掉):

dependencies {

...

// compile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')

...

}

Detail (詳細設計說明)

Host(托管)

Contact 聯系作者

Donate 捐贈

Support me!

感謝您對老衛開源工作的支持!

捐贈所得所有款項將用于開源事業!

總結

以上是生活随笔為你收集整理的Mongo服务器二进制文件修复,Mongodb-File-Server的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。