SlideShare a Scribd company logo
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
MongoDB Oplog入門
http://www.mongodb.org/display/DOCS/Replica+Sets+-+Oplog
myset:PRIMARY> db.mycoll.insert({x:1})

myset:PRIMARY> db.mycoll.update({x:1}, {$set : {y:1}})

myset:PRIMARY> db.mycoll.update({x:2}, {$set : {y:1}}, true)

myset:PRIMARY> db.mycoll.remove({x:1})

myset:PRIMARY> db.mycoll.find()

{ "_id" : ObjectId("4def8e5fb07da951204c60e0"), "x" : 1, "y" : 1 }

{ "_id" : ObjectId("4def8e5fd60f868d9ea77776"), "x" : 2, "y" : 1 }
myset:PRIMARY> use local

myset:PRIMARY> db.oplog.rs.find().sort({$natural:-1})

{ "ts" : { "t" : 1307545183000, "i" : 4 }, "h" : NumberLong("-1214445074120755058"), "op" : "d",

"ns" : "test.mycoll", "b" : true, "o" : { "_id" : ObjectId("4def8e5fb07da951204c60e0") } }



{ "ts" : { "t" : 1307545183000, "i" : 3 }, "h" : NumberLong("296197708926251535"), "op" : "i",

"ns" : "test.mycoll", "o" : { "_id" : ObjectId("4def8e5fd60f868d9ea77776"), "x" : 2, "y" : 1 } }



{ "ts" : { "t" : 1307545183000, "i" : 2 }, "h" : NumberLong("6923456793495821492"), "op" : "u",

"ns" : "test.mycoll", "o2" : { "_id" : ObjectId("4def8e5fb07da951204c60e0") }, "o" : { "$set" :

{ "y" : 1 } } }



{ "ts" : { "t" : 1307545183000, "i" : 1 }, "h" : NumberLong("-4148240362977057242"), "op" : "i",

"ns" : "test.mycoll", "o" : { "_id" : ObjectId("4def8e5fb07da951204c60e0"), "x" : 1 } }

...
Wed Jun   8 23:53:38 [conn6] getmore local.oplog.rs cid:3687673685314762755 getMore:

{ ts: { $gte: new Date(5615858237044687812) } }   bytes:20 nreturned:0 3022ms



Wed Jun   8 23:53:38 [conn8] getmore local.oplog.rs cid:9178181051262829411 getMore:

{ ts: { $gte: new Date(5615858237044687812) } }   bytes:20 nreturned:0 3046ms



Wed Jun   8 23:53:41 [conn8] getmore local.oplog.rs cid:9178181051262829411 getMore:

{ ts: { $gte: new Date(5615858237044687812) } }   bytes:20 nreturned:0 3041ms



Wed Jun   8 23:53:41 [conn6] getmore local.oplog.rs cid:3687673685314762755 getMore:

{ ts: { $gte: new Date(5615858237044687812) } }   bytes:20 nreturned:0 3043ms

...
myset:SECONDARY> db.oplog.rs.find().sort({$natural:-1})

{ "ts" : { "t" : 1307545183000, "i" : 4 }, "h" : NumberLong("-1214445074120755058"), "op" : "d",

"ns" : "test.mycoll", "b" : true, "o" : { "_id" : ObjectId("4def8e5fb07da951204c60e0") } }



{ "ts" : { "t" : 1307545183000, "i" : 3 }, "h" : NumberLong("296197708926251535"), "op" : "i",

"ns" : "test.mycoll", "o" : { "_id" : ObjectId("4def8e5fd60f868d9ea77776"), "x" : 2, "y" : 1 } }



{ "ts" : { "t" : 1307545183000, "i" : 2 }, "h" : NumberLong("6923456793495821492"), "op" : "u",

"ns" : "test.mycoll", "o2" : { "_id" : ObjectId("4def8e5fb07da951204c60e0") }, "o" : { "$set" :

{ "y" : 1 } } }



{ "ts" : { "t" : 1307545183000, "i" : 1 }, "h" : NumberLong("-4148240362977057242"), "op" : "i",

"ns" : "test.mycoll", "o" : { "_id" : ObjectId("4def8e5fb07da951204c60e0"), "x" : 1 } }

...
MongoDB Oplog入門
MongoDB Oplog入門

More Related Content

PPTX
MongoDBが遅いときの切り分け方法
PDF
アーキテクチャから理解するPostgreSQLのレプリケーション
PPTX
WiredTigerを詳しく説明
PDF
DockerとPodmanの比較
PPTX
初心者向けMongoDBのキホン!
PDF
kube-system落としてみました
PPTX
MongoDBの監視
PDF
YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)
MongoDBが遅いときの切り分け方法
アーキテクチャから理解するPostgreSQLのレプリケーション
WiredTigerを詳しく説明
DockerとPodmanの比較
初心者向けMongoDBのキホン!
kube-system落としてみました
MongoDBの監視
YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)

What's hot (20)

PDF
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
PDF
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
PDF
MongoDB〜その性質と利用場面〜
PDF
[GKE & Spanner 勉強会] Cloud Spanner の技術概要
PDF
Memoizeの仕組み(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
PDF
Docker Compose 徹底解説
PDF
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
PPTX
Mongo dbを知ろう
PPTX
サポート エンジニアが Azure Networking をじっくりたっぷり語りつくす会
PDF
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
PPTX
CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...
PDF
Python 3.9からの新定番zoneinfoを使いこなそう
PDF
pgvectorを使ってChatGPTとPostgreSQLを連携してみよう!(PostgreSQL Conference Japan 2023 発表資料)
PPTX
PostgreSQLモニタリングの基本とNTTデータが追加したモニタリング新機能(Open Source Conference 2021 Online F...
PDF
PostgreSQLアンチパターン
PDF
Inside vacuum - 第一回PostgreSQLプレ勉強会
PDF
MongoDBのアレをアレする
PDF
Dockerfile を書くためのベストプラクティス解説編
PDF
MongoDB Configパラメータ解説
PDF
BuildKitの概要と最近の機能
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
MongoDB〜その性質と利用場面〜
[GKE & Spanner 勉強会] Cloud Spanner の技術概要
Memoizeの仕組み(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)
Docker Compose 徹底解説
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
Mongo dbを知ろう
サポート エンジニアが Azure Networking をじっくりたっぷり語りつくす会
PostgreSQLのリカバリ超入門(もしくはWAL、CHECKPOINT、オンラインバックアップの仕組み)
CloudNativePGを動かしてみた! ~PostgreSQL on Kubernetes~(第34回PostgreSQLアンカンファレンス@オンライ...
Python 3.9からの新定番zoneinfoを使いこなそう
pgvectorを使ってChatGPTとPostgreSQLを連携してみよう!(PostgreSQL Conference Japan 2023 発表資料)
PostgreSQLモニタリングの基本とNTTデータが追加したモニタリング新機能(Open Source Conference 2021 Online F...
PostgreSQLアンチパターン
Inside vacuum - 第一回PostgreSQLプレ勉強会
MongoDBのアレをアレする
Dockerfile を書くためのベストプラクティス解説編
MongoDB Configパラメータ解説
BuildKitの概要と最近の機能
Ad

Viewers also liked (20)

PDF
MongoDB全機能解説1
PPTX
Mongo sharding
PDF
History_of_waterfall_append
PDF
ソーシャルゲームにおけるAWS/MongoDB利用事例
PDF
MongoDBで作るソーシャルデータ新解析基盤
PPT
ザ・ドキュメント~うまくいかないNoSQL~
KEY
Play2 translate 20120714
KEY
About playdocja
KEY
プラガブル Play20 Scala
PDF
Play framework 2.0のおすすめと1.2からのアップグレード
PPTX
継続的インテグレーション3分クッキング
KEY
Play勉強会 第3回
PDF
Gradle a new Generation Build Tool
PDF
20120706-readablecode
KEY
MongoDBを使用したモバイルゲーム開発
PDF
20110514 mongo dbチューニング
PDF
TDDBC 横浜 演習課題
PDF
TDD Boot Camp 東京 for C++ 課題
ODP
ライフゲームでプログラミング
PDF
夏サミ 2012 [B-2]エンタープライズ開発におけるコラボレーション - JIRAによる顧客と開発チームのつなぎ方
MongoDB全機能解説1
Mongo sharding
History_of_waterfall_append
ソーシャルゲームにおけるAWS/MongoDB利用事例
MongoDBで作るソーシャルデータ新解析基盤
ザ・ドキュメント~うまくいかないNoSQL~
Play2 translate 20120714
About playdocja
プラガブル Play20 Scala
Play framework 2.0のおすすめと1.2からのアップグレード
継続的インテグレーション3分クッキング
Play勉強会 第3回
Gradle a new Generation Build Tool
20120706-readablecode
MongoDBを使用したモバイルゲーム開発
20110514 mongo dbチューニング
TDDBC 横浜 演習課題
TDD Boot Camp 東京 for C++ 課題
ライフゲームでプログラミング
夏サミ 2012 [B-2]エンタープライズ開発におけるコラボレーション - JIRAによる顧客と開発チームのつなぎ方
Ad

Similar to MongoDB Oplog入門 (20)

PDF
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
PDF
MongoDB With Style
PDF
User Defined Aggregation in Apache Spark: A Love Story
PDF
User Defined Aggregation in Apache Spark: A Love Story
PDF
The Ring programming language version 1.5.2 book - Part 66 of 181
KEY
Haskellで学ぶ関数型言語
PDF
Data aggregation in R
PDF
The Ring programming language version 1.10 book - Part 81 of 212
KEY
関数潮流(Function Tendency)
PDF
C++ TUTORIAL 7
PDF
The Ring programming language version 1.5 book - Part 8 of 31
PDF
The Ring programming language version 1.7 book - Part 48 of 196
PDF
MongoDB全機能解説2
PDF
PDF
Compose Async with RxJS
PPTX
Groovy puzzlers jug-moscow-part 2
PPTX
ETL for Pros: Getting Data Into MongoDB
PDF
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
PPTX
Scala meetup
PDF
The Ring programming language version 1.8 book - Part 75 of 202
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
MongoDB With Style
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
The Ring programming language version 1.5.2 book - Part 66 of 181
Haskellで学ぶ関数型言語
Data aggregation in R
The Ring programming language version 1.10 book - Part 81 of 212
関数潮流(Function Tendency)
C++ TUTORIAL 7
The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.7 book - Part 48 of 196
MongoDB全機能解説2
Compose Async with RxJS
Groovy puzzlers jug-moscow-part 2
ETL for Pros: Getting Data Into MongoDB
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
Scala meetup
The Ring programming language version 1.8 book - Part 75 of 202

More from Takahiro Inoue (20)

PDF
Treasure Data × Wave Analytics EC Demo
PDF
トレジャーデータとtableau実現する自動レポーティング
PDF
Tableauが魅せる Data Visualization の世界
PDF
トレジャーデータのバッチクエリとアドホッククエリを理解する
PDF
20140708 オンラインゲームソリューション
PDF
トレジャーデータ流,データ分析の始め方
PDF
オンラインゲームソリューション@トレジャーデータ
PDF
事例で学ぶトレジャーデータ 20140612
PDF
トレジャーデータ株式会社について(for all Data_Enthusiast!!)
PDF
この Visualization がすごい2014 〜データ世界を彩るツール6選〜
PDF
Treasure Data Intro for Data Enthusiast!!
PDF
Hadoop and the Data Scientist
PDF
MongoDB: Intro & Application for Big Data
PDF
An Introduction to Fluent & MongoDB Plugins
PDF
An Introduction to Tinkerpop
PDF
An Introduction to Neo4j
PDF
The Definition of GraphDB
PDF
Large-Scale Graph Processing〜Introduction〜(完全版)
PDF
Large-Scale Graph Processing〜Introduction〜(LT版)
PDF
Advanced MongoDB #1
Treasure Data × Wave Analytics EC Demo
トレジャーデータとtableau実現する自動レポーティング
Tableauが魅せる Data Visualization の世界
トレジャーデータのバッチクエリとアドホッククエリを理解する
20140708 オンラインゲームソリューション
トレジャーデータ流,データ分析の始め方
オンラインゲームソリューション@トレジャーデータ
事例で学ぶトレジャーデータ 20140612
トレジャーデータ株式会社について(for all Data_Enthusiast!!)
この Visualization がすごい2014 〜データ世界を彩るツール6選〜
Treasure Data Intro for Data Enthusiast!!
Hadoop and the Data Scientist
MongoDB: Intro & Application for Big Data
An Introduction to Fluent & MongoDB Plugins
An Introduction to Tinkerpop
An Introduction to Neo4j
The Definition of GraphDB
Large-Scale Graph Processing〜Introduction〜(完全版)
Large-Scale Graph Processing〜Introduction〜(LT版)
Advanced MongoDB #1

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Electronic commerce courselecture one. Pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Modernizing your data center with Dell and AMD
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf
Chapter 3 Spatial Domain Image Processing.pdf
A Presentation on Artificial Intelligence
Mobile App Security Testing_ A Comprehensive Guide.pdf
MYSQL Presentation for SQL database connectivity
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Modernizing your data center with Dell and AMD
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation_ Review paper, used for researhc scholars
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
NewMind AI Weekly Chronicles - August'25 Week I
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Understanding_Digital_Forensics_Presentation.pptx

MongoDB Oplog入門

  • 19. myset:PRIMARY> db.mycoll.insert({x:1}) myset:PRIMARY> db.mycoll.update({x:1}, {$set : {y:1}}) myset:PRIMARY> db.mycoll.update({x:2}, {$set : {y:1}}, true) myset:PRIMARY> db.mycoll.remove({x:1}) myset:PRIMARY> db.mycoll.find() { "_id" : ObjectId("4def8e5fb07da951204c60e0"), "x" : 1, "y" : 1 } { "_id" : ObjectId("4def8e5fd60f868d9ea77776"), "x" : 2, "y" : 1 }
  • 20. myset:PRIMARY> use local myset:PRIMARY> db.oplog.rs.find().sort({$natural:-1}) { "ts" : { "t" : 1307545183000, "i" : 4 }, "h" : NumberLong("-1214445074120755058"), "op" : "d", "ns" : "test.mycoll", "b" : true, "o" : { "_id" : ObjectId("4def8e5fb07da951204c60e0") } } { "ts" : { "t" : 1307545183000, "i" : 3 }, "h" : NumberLong("296197708926251535"), "op" : "i", "ns" : "test.mycoll", "o" : { "_id" : ObjectId("4def8e5fd60f868d9ea77776"), "x" : 2, "y" : 1 } } { "ts" : { "t" : 1307545183000, "i" : 2 }, "h" : NumberLong("6923456793495821492"), "op" : "u", "ns" : "test.mycoll", "o2" : { "_id" : ObjectId("4def8e5fb07da951204c60e0") }, "o" : { "$set" : { "y" : 1 } } } { "ts" : { "t" : 1307545183000, "i" : 1 }, "h" : NumberLong("-4148240362977057242"), "op" : "i", "ns" : "test.mycoll", "o" : { "_id" : ObjectId("4def8e5fb07da951204c60e0"), "x" : 1 } } ...
  • 21. Wed Jun 8 23:53:38 [conn6] getmore local.oplog.rs cid:3687673685314762755 getMore: { ts: { $gte: new Date(5615858237044687812) } } bytes:20 nreturned:0 3022ms Wed Jun 8 23:53:38 [conn8] getmore local.oplog.rs cid:9178181051262829411 getMore: { ts: { $gte: new Date(5615858237044687812) } } bytes:20 nreturned:0 3046ms Wed Jun 8 23:53:41 [conn8] getmore local.oplog.rs cid:9178181051262829411 getMore: { ts: { $gte: new Date(5615858237044687812) } } bytes:20 nreturned:0 3041ms Wed Jun 8 23:53:41 [conn6] getmore local.oplog.rs cid:3687673685314762755 getMore: { ts: { $gte: new Date(5615858237044687812) } } bytes:20 nreturned:0 3043ms ...
  • 22. myset:SECONDARY> db.oplog.rs.find().sort({$natural:-1}) { "ts" : { "t" : 1307545183000, "i" : 4 }, "h" : NumberLong("-1214445074120755058"), "op" : "d", "ns" : "test.mycoll", "b" : true, "o" : { "_id" : ObjectId("4def8e5fb07da951204c60e0") } } { "ts" : { "t" : 1307545183000, "i" : 3 }, "h" : NumberLong("296197708926251535"), "op" : "i", "ns" : "test.mycoll", "o" : { "_id" : ObjectId("4def8e5fd60f868d9ea77776"), "x" : 2, "y" : 1 } } { "ts" : { "t" : 1307545183000, "i" : 2 }, "h" : NumberLong("6923456793495821492"), "op" : "u", "ns" : "test.mycoll", "o2" : { "_id" : ObjectId("4def8e5fb07da951204c60e0") }, "o" : { "$set" : { "y" : 1 } } } { "ts" : { "t" : 1307545183000, "i" : 1 }, "h" : NumberLong("-4148240362977057242"), "op" : "i", "ns" : "test.mycoll", "o" : { "_id" : ObjectId("4def8e5fb07da951204c60e0"), "x" : 1 } } ...