原创 MongoDB學習九--MongoDB的主從複製

sql server能夠做到讀寫分離,雙機熱備份和集羣部署,當然mongodb也能做到,實際應用中我們不希望數據庫採用單點部署,如果碰到數據庫宕機或者被毀滅性破壞那是多麼的糟糕。 注意新的3.0.5的說明 Master/slave opt

原创 MongoDB學習六--MongoDB刪除數據文檔

In MongoDB, the db.collection.remove() method removes documents from a collection. You can remove all documents from a

原创 MongoDB學習八--MongoDB的索引操作

Indexes support the efficient execution of queries in MongoDB. Without indexes, MongoDB must perform acollection scan,

原创 MongoDB學習十二 --MongoDB的Sharding Introduction

Sharding is a method for storing data across multiple machines. MongoDB uses sharding to support deployments with very

原创 MongoDB學習十--MongoDB的Replication Introduction

Replication provides redundancy and increases data availability. With multiple copies of data on different database se

原创 MongoDB學習七--MongoDB的Map-Reduce示例

In the mongo shell, the db.collection.mapReduce() method is a wrapper around the mapReducecommand. The following ex

原创 Linux下Rsync+sersync實現數據實時同步

一、爲什麼要用Rsync+sersync架構? 1、sersync是基於Inotify開發的,類似於Inotify-tools的工具 2、sersync可以記錄下被監聽目錄中發生變化的(包括增加、刪除、修改)具體某一個文件或某一個目

原创 MongoDB學習十四 --MongoDB的分片

本來想一口氣寫完的,無賴前段時間報名學車,駕校臨時安排一兩個星期練車,時間又不停的改、改、改!搞的我這博客文章都好久沒加上了,今天打算寫上一篇MongoDB的分片技術,算是這一系列的操作使用的一段的結尾。 在mongodb裏面存在另一種集

原创 MongoDB學習五--MongoDB修改數據文檔

MongoDB provides the update() method to update the documents of a collection. The method accepts as its parameters:

原创 Start Developing iOS Apps Today(中文OC)

簡介 創造 iOS 應用既有樂趣又有回報,如果你正在初學開發,可能會爲從何着手而感到困惑。這份路線圖爲 iOS 應用開發入門提供了一個完美的開端。在你的 Mac 電腦上便可以創造出 iOS 應用,並在 iPad、iPhone 和

原创 Linux下Rsync+sersync實現數據雙向實時同步

   剛好前面用rsync+sersync做了主從數據同步,現在有新的需求了,P2P系統兩臺服務器做負載均衡,但是由於P2P會生成N多的合同,N多的數字證書,會上傳文件,所以根據現實情況需要兩臺相互同步。    感覺sersync應該能夠

原创 MongoDB學習十一 --MongoDB的Replication實踐

很牛X的主從集羣,不過跟上面的主從複製還是有兩點區別的。 <1>:  該集羣沒有特定的主數據庫。<2>:  如果哪個主數據庫宕機了,集羣中就會推選出

原创 MongoDB學習七--MongoDB高級操作

今天學習了mongodb中比較好玩的知識,主要包括:聚合,遊標。 聚合 常見的聚合操作跟sql server一樣,有:count,distinct,group,mapReduce。 1,count是最簡單,最容易,也是最常用的聚合工具,跟

原创 按時間查找並移動文件

這幾天服務器的日誌文件增長相當厲害,一天跑了接近20G,其結果是要從日誌裏查找某個交易的信息就難上加難了,下面是用到的幾個命令。 查找文件夾 linux查看目錄的四種方法(ls只顯示目錄 ) 1, ls -d * 2, fi

原创 @RequestMapping 用法詳解

RequestMapping是一個用來處理請求地址映射的註解,可用於類或方法上。用於類上,表示類中的所有響應請求的方法都是以該地址作爲父路徑。 @RequestMapping is one of the most widely use