Contenu connexe Similaire à Training MongoDB - Monitoring and Operability (20) Training MongoDB - Monitoring and Operability8. Confidential
RESTRICTED
Page 8
Overview of MongoDB
_ Document store
• Stores JSON-style documents
• Uses BSON format for storage
_ Several binaries written in C++
• Mongod : The actual database process, owning the data
©2014AmadeusITGroupSA
High-level
9. Confidential
RESTRICTED
Page 9
Overview of MongoDB
_ Document store
• Stores JSON-style documents
• Uses BSON format for storage
_ Several binaries written in C++
• Mongod : The actual database process, owning the data
• Mongos : A connection multiplexer
©2014AmadeusITGroupSA
High-level
10. Confidential
RESTRICTED
Page 10
Overview of MongoDB
_ Document store
• Stores JSON-style documents
• Uses BSON format for storage
_ Several binaries written in C++
• Mongod : The actual database process, owning the data
• Mongos : A connection multiplexer
• Config servers : Holds cluster topology
©2014AmadeusITGroupSA
High-level
11. Confidential
RESTRICTED
Page 11
Overview of MongoDB
_ Document store
• Stores JSON-style documents
• Uses BSON format for storage
_ Several binaries written in C++
• Mongod : The actual database process, owning the data
• Mongos : A connection multiplexer
• Config servers : Holds cluster topology
• Agent : Monitoring process
©2014AmadeusITGroupSA
High-level
12. Confidential
RESTRICTED
Page 12
Overview of MongoDB
_ Document store
• Stores JSON-style documents
• Uses BSON format for storage
_ Several binaries written in C++
• Mongod : The actual database process, owning the data
• Mongos : A connection multiplexer
• Config servers : Holds cluster topology
• Agent : Monitoring process
• MMS : Monitoring UI, connected to the Agents
©2014AmadeusITGroupSA
High-level
13. Confidential
RESTRICTED
Page 13
Overview of MongoDB
_ Document store
• Stores JSON-style documents
• Uses BSON format for storage
_ Several binaries written in C++
• Mongod : The actual database process, owning the data
• Mongos : A connection multiplexer
• Config servers : Holds cluster topology
• Agent : Monitoring process
• MMS : Monitoring UI, connected to the Agents
_ Opensource and Enterprise versions
©2014AmadeusITGroupSA
High-level
21. Confidential
RESTRICTED
Page 21
Overview of MongoDB
Memcached Couchbase MongoDB Oracle
Database Model Key-Value Key-Value Document Table
Data scheme Schema-free Schema-free Schema-free Schema-full
Indexes
Persistency
Data Integrity
Transaction
©2014AmadeusITGroupSA
Comparison
22. Confidential
RESTRICTED
Page 22
Overview of MongoDB
Memcached Couchbase MongoDB Oracle
Database Model Key-Value Key-Value Document Table
Data scheme Schema-free Schema-free Schema-free Schema-full
Indexes
Persistency
Data Integrity
Transaction
©2014AmadeusITGroupSA
Comparison
23. Confidential
RESTRICTED
Page 23
Overview of MongoDB
Memcached Couchbase MongoDB Oracle
Database Model Key-Value Key-Value Document Table
Data scheme Schema-free Schema-free Schema-free Schema-full
Indexes
Persistency
Data Integrity
Transaction
©2014AmadeusITGroupSA
Comparison
24. Confidential
RESTRICTED
Page 24
Overview of MongoDB
Memcached Couchbase MongoDB Oracle
Database Model Key-Value Key-Value Document Table
Data scheme Schema-free Schema-free Schema-free Schema-full
Indexes
Persistency
Data Integrity
Transaction
©2014AmadeusITGroupSA
Comparison
25. Confidential
RESTRICTED
Page 25
Overview of MongoDB
Memcached Couchbase MongoDB Oracle
Database Model Key-Value Key-Value Document Table
Data scheme Schema-free Schema-free Schema-free Schema-full
Indexes
Persistency
Data Integrity
Transaction
©2014AmadeusITGroupSA
Comparison
26. Confidential
RESTRICTED
Page 26
Overview of MongoDB
Memcached Couchbase MongoDB Oracle
Database Model Key-Value Key-Value Document Table
Data scheme Schema-free Schema-free Schema-free Schema-full
Indexes
Persistency
Data Integrity
Transaction
©2014AmadeusITGroupSA
Comparison
27. Confidential
RESTRICTED
Page 27
Overview of MongoDB
Memcached Couchbase MongoDB Oracle
Database Model Key-Value Key-Value Document Table
Data scheme Schema-free Schema-free Schema-free Schema-full
Indexes
Persistency
Data Integrity
Transaction
©2014AmadeusITGroupSA
Comparison
31. Confidential
RESTRICTED
Page 31
Overview of MongoDB
_ Mongod is the process storing the data
_ 3 different types
• PRIMARY
• The primary is the only process that
receives write operations
©2014AmadeusITGroupSA
Mongod
32. Confidential
RESTRICTED
Page 32
Overview of MongoDB
_ Mongod is the process storing the data
_ 3 different types
• PRIMARY
• The primary is the only process that
receives write operations
• SECONDARY
©2014AmadeusITGroupSA
Mongod
33. Confidential
RESTRICTED
Page 33
Overview of MongoDB
_ Mongod is the process storing the data
_ 3 different types
• PRIMARY
• The primary is the only process that
receives write operations
• SECONDARY
• A secondary maintains a copy of the
primary’s data set
©2014AmadeusITGroupSA
Mongod
34. Confidential
RESTRICTED
Page 34
Overview of MongoDB
_ Mongod is the process storing the data
_ 3 different types
• PRIMARY
• The primary is the only process that
receives write operations
• SECONDARY
• A secondary maintains a copy of the
primary’s data set
• ARBITER
©2014AmadeusITGroupSA
Mongod
35. Confidential
RESTRICTED
Page 35
Overview of MongoDB
_ Mongod is the process storing the data
_ 3 different types
• PRIMARY
• The primary is the only process that
receives write operations
• SECONDARY
• A secondary maintains a copy of the
primary’s data set
• ARBITER
• An arbiter does not have a copy of
data set and cannot become a primary
©2014AmadeusITGroupSA
Mongod
36. Confidential
RESTRICTED
Page 36
Overview of MongoDB
_ Mongod is the process storing the data
_ 3 different types
• PRIMARY
• The primary is the only process that
receives write operations
• SECONDARY
• A secondary maintains a copy of the
primary’s data set
• ARBITER
• An arbiter does not have a copy of
data set and cannot become a primary
©2014AmadeusITGroupSA
Mongod
37. Confidential
RESTRICTED
Page 37
Overview of MongoDB
_ Mongod is the process storing the data
_ 3 different types
• PRIMARY
• The primary is the only process that
receives write operations
• SECONDARY
• A secondary maintains a copy of the
primary’s data set
• ARBITER
• An arbiter does not have a copy of
data set and cannot become a primary
_ Heartbeats are sent every 10s
between mongods
©2014AmadeusITGroupSA
Mongod
Heartbeat
39. Confidential
RESTRICTED
Page 39
Overview of MongoDB
_ Config servers are special mongod instances that store
the metadata for a cluster (like topology)
_ A production cluster has exactly three config servers
©2014AmadeusITGroupSA
Config Server
40. Confidential
RESTRICTED
Page 40
Overview of MongoDB
_ Mongos is a
connection
multiplexer
_ Heartbeat are
sent every 10s
_ Map/Reduce
queries
©2014AmadeusITGroupSA
Mongos
Hundredsofclients
A single connection/server
Clients are not aware of the
topology
Mongos hides all the
complexity and standardizes
the configuration
Mongos
Mongod
Mongod
Mongod
Config
Heartbeat
44. Confidential
RESTRICTED
Page 44
Overview of MongoDB
_ Mongos is a
connection
multiplexer
©2014AmadeusITGroupSA
Mongos
Hundredsofclients
A single connection/server
Clients are not aware of the
topology
Mongos
Mongod
Mongod
Mongod
Config
45. Confidential
RESTRICTED
Page 45
Overview of MongoDB
_ Mongos is a
connection
multiplexer
©2014AmadeusITGroupSA
Mongos
Hundredsofclients
A single connection/server
Clients are not aware of the
topology
Mongos hides all the
complexity and standardizes
the configuration
Mongos
Mongod
Mongod
Mongod
Config
46. Confidential
RESTRICTED
Page 46
Overview of MongoDB
_ Mongos is a
connection
multiplexer
_ Heartbeat are
sent every 10s
©2014AmadeusITGroupSA
Mongos
Hundredsofclients
A single connection/server
Clients are not aware of the
topology
Mongos hides all the
complexity and standardizes
the configuration
Mongos
Mongod
Mongod
Mongod
Config
Heartbeat
47. Confidential
RESTRICTED
Page 47
Overview of MongoDB
_ Mongos is a
connection
multiplexer
_ Heartbeat are
sent every 10s
_ Map/Reduce
queries
©2014AmadeusITGroupSA
Mongos
Hundredsofclients
A single connection/server
Clients are not aware of the
topology
Mongos hides all the
complexity and standardizes
the configuration
Mongos
Mongod
Mongod
Mongod
Config
Heartbeat
51. Confidential
RESTRICTED
Page 51
Overview of MongoDB
_ Monitoring process
_ 1 active/1 passive
per cluster
_ Retrieves the
config servers from
MMS
_ Retrieves the list of
processes from a
config server
©2014AmadeusITGroupSA
Agent
Config
Agent
52. Confidential
RESTRICTED
Page 52
Overview of MongoDB
_ Monitoring process
_ 1 active/1 passive
per cluster
_ Retrieves the
config servers from
MMS
_ Retrieves the list of
processes from a
config server
_ Connects to all
processes
©2014AmadeusITGroupSA
Agent
Mongod
Mongod
Mongod
Mongos
Config
Agent
MMS
53. Confidential
RESTRICTED
Page 53
_ Datastore
• Pros
• Structured data
• Flexible (Schema-less)
• Indexes
• Scaling is “easy”
• Easy to deploy
• Cons
• Transactions are not yet supported
• Each command is atomic but locking is at database level in 2.6 (moving to
document level in 2.8)
_ Analytical search
• MSX
Use Cases
©2014AmadeusITGroupSA
Overview of MongoDB
61. Confidential
RESTRICTED
Page 61
Mongos
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
(GOS, DZB)
_ Mongos ?
_ Deployed on each AS
_ BEs are connected via the
standard Mongo C++
client
_ Mongos is connected to all
the MongoDB servers
_ Duwrapped process
monitored by the local
Agent
_ Equivalent of ProxyD for
Memcached and
Couchbase
SI Agent
BE BE BEBE
mongos
dwi
Amadeus Architecture Around NoSQL
62. Confidential
RESTRICTED
Page 62
Mongos
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
(GOS, DZB)
_ Mongos ?
_ Deployed on each AS
_ BEs are connected via the
standard Mongo C++
client
_ Mongos is connected to all
the MongoDB servers
_ Duwrapped process
monitored by the local
Agent
_ Equivalent of ProxyD for
Memcached and
Couchbase
_ Also running on NoSQL
Tier for administration
tasks
SI Agent
BE BE BEBE
mongos
dwi
mongos
Amadeus Architecture Around NoSQL
75. Confidential
RESTRICTED
Page 75
Amadeus Architecture Around NoSQL
Configuration
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
Agent
BE BE BEBE
mongos
MongoS port
retrieved from
the MAG
dwi
Duwrapper Conf
(listen port)
+
Configuration files
Keyfile_xxx
Mongos_xxx.yml
xxx.pem
_ BE Configuration
_ Mongos
Configuration
_ MongoDB
Configuration
82. Confidential
RESTRICTED
Page 82
MongoDB Concepts
_ Shard Map
• MongoDB partitions data in
“chunks”, chunks are associated
to a replica set
• When a chunk grows over the
chunk size (64 MB), MongoDB
splits the chunk in smaller
chunks. The (arbitrary) limit has
been chosen to avoid moving too
much data during a balancing.
MongoDB
©2014AmadeusITGroupSA
Shard Map
Shard 1 Shard 2 Shard 3
83. Confidential
RESTRICTED
Page 83
MongoDB Concepts
_ Shard Map
• MongoDB partitions data in
“chunks”, chunks are associated
to a replica set
• When a chunk grows over the
chunk size (64 MB), MongoDB
splits the chunk in smaller
chunks. The (arbitrary) limit has
been chosen to avoid moving too
much data during a balancing.
• The config server provides a
shard map with at least one
mongod process per shard
MongoDB
©2014AmadeusITGroupSA
Shard Map
Shard 1 Shard 2 Shard 3
87. Confidential
RESTRICTED
Page 87
MongoDB Concepts
_ MongoDB functional architecture
• A MongoDB cluster contains several databases
• Each database contains several collections (equivalent of Oracle schemas)
• A collection contains a set of JSON documents (equivalent of Oracle tables)
MongoDB
©2014AmadeusITGroupSA
88. Confidential
RESTRICTED
Page 88
MongoDB Concepts
_ MongoDB functional architecture
• A MongoDB cluster contains several databases
• Each database contains several collections (equivalent of Oracle schemas)
• A collection contains a set of JSON documents (equivalent of Oracle tables)
• Documents are distributed across all the shards
• Each sharded collection need a value to shard on (=shard key)
MongoDB
©2014AmadeusITGroupSA
97. Confidential
RESTRICTED
Page 97
_ Example
MongoDB Concepts
MongoDB
©2014AmadeusITGroupSA
{
“name”: “Winky”
}
mongos
INSERT in my_collection
SHARDSHARD SHARD SHARD
_ Remember, a shard is a
replica set, it is spread
over different machinesChunk = HASH(doc.name)
100. Confidential
RESTRICTED
Page 100
MongoDB Concepts
_ Data Replication
• A write goes first to the primary of a shard
• The primary writes the operation in a special collection called oplog
MongoDB
©2014AmadeusITGroupSA
NODE 1
Mongod
(primary)
Replica Set/Shard
oplog
write
NODE 2
Mongod
(secondary)
101. Confidential
RESTRICTED
Page 101
MongoDB Concepts
_ Data Replication
• A write goes first to the primary of a shard
• The primary writes the operation in a special collection called oplog
• Secondaries periodically poll the oplog to get the latest updates
MongoDB
©2014AmadeusITGroupSA
NODE 1
Mongod
(primary)
Replica Set/Shard
oplog
write
NODE 2
Mongod
(secondary)
102. Confidential
RESTRICTED
Page 102
MongoDB Concepts
_ Data Replication
• Oplog window
• Time difference between the first and the last entry in the oplog collection
• Replication Lag
• Time between the latest entry on the primary and the latest entry on a secondary
• Replication headroom
• Difference between Oplog Window and Replication Lag
MongoDB
©2014AmadeusITGroupSA
103. Confidential
RESTRICTED
Page 103
MongoDB Concepts
_ Journaling
• When running with journaling, MongoDB stores and applies write
operations in memory and in the on-disk journal before the changes are
present in the data files on disk
• MongoDB journals operations by batch (called group commits), the size is
configurable
• A group commit must block all writers during the commit
• In case of a crash, mongod uses the journal to warm-up
MongoDB
©2014AmadeusITGroupSA
104. Confidential
RESTRICTED
Page 104
MongoDB Concepts
_ Chunk splitting
• Each mongos knows how much it writes to each chunk
• When a mongos thinks a chunk needs to be split (=reached the max chunk
size), it queries the related mongod and check the chunk size. If needed, it
will start the balancer (if enabled)
MongoDB
©2014AmadeusITGroupSA
109. Confidential
RESTRICTED
Page 109
MongoDB Concepts
_ When do we move a chunk ?
• A shards holds too many chunks
• A new shard is added
MongoDB
©2014AmadeusITGroupSA
mongos
SHARD
2
SHARD
1config
mongos
1 1 1 1 2 21 1 1 1 2 2
“I want to move
this chunk”
110. Confidential
RESTRICTED
Page 110
MongoDB Concepts
_ When do we move a chunk ?
• A shards holds too many chunks
• A new shard is added
MongoDB
©2014AmadeusITGroupSA
mongos
SHARD
2
SHARD
1config
mongos
1 1 1 1 2 21 1 1 1 2 2
Global lock, no other
chunk can be moved
111. Confidential
RESTRICTED
Page 111
MongoDB Concepts
_ When do we move a chunk ?
• A shards holds too many chunks
• A new shard is added
MongoDB
©2014AmadeusITGroupSA
mongos
SHARD
2
SHARD
1config
mongos
1 1 1 1 2 21 1 1 1 2 2
“Please move chunk
4 to shard 2”
112. Confidential
RESTRICTED
Page 112
MongoDB Concepts
_ When do we move a chunk ?
• A shards holds too many chunks
• A new shard is added
MongoDB
©2014AmadeusITGroupSA
mongos
SHARD
2
SHARD
1config
mongos
1 1 1 1 2 21 1 1 1 2 2
Please poll this list
of documents {..}
115. Confidential
RESTRICTED
Page 115
MongoDB Concepts
_ When do we move a chunk ?
• A shards holds too many chunks
• A new shard is added
MongoDB
©2014AmadeusITGroupSA
mongos
SHARD
2
SHARD
1config
mongos
1 1 1 1 2 21 1 1 1 2 2
Block read/writes
Update chunk map
119. Confidential
RESTRICTED
Page 119
MongoDB Concepts
_ Scalability
• If we need more nodes, we add more shards (done through one of the
mongos running on NoSQL tier)
• When you add a shard to a sharded cluster, you affect the balance of
chunks among the shards. The balancer will begin migrating chunks so
that the cluster will achieve balance
• The balancer has an impact on performance
• It moves one chunk at a time
MongoDB
©2014AmadeusITGroupSA
122. Confidential
RESTRICTED
Page 122
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
PrimarySecondary
mongos
123. Confidential
RESTRICTED
Page 123
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
PrimarySecondary
mongos
124. Confidential
RESTRICTED
Page 124
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
PrimarySecondary
mongos
Write outage
(read depends on configuration)
125. Confidential
RESTRICTED
Page 125
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
PrimarySecondary
mongos
Write outage
(read depends on configuration)
Election
126. Confidential
RESTRICTED
Page 126
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
PrimarySecondary
mongos
Write outage
(read depends on configuration)
Primary
127. Confidential
RESTRICTED
Page 127
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
PrimarySecondary
mongos
Primary
128. Confidential
RESTRICTED
Page 128
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
Recoverymongos
129. Confidential
RESTRICTED
Page 129
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
Recovery
Secondary
mongos 1. Read from journal
Primary
130. Confidential
RESTRICTED
Page 130
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
Recovery
Secondary
mongos
Primary
Secondary
131. Confidential
RESTRICTED
Page 131
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
PrimarySecondary
mongos Sends its priority in
the heartbeat. In
case it is the
highest…
Secondary
Primary
132. Confidential
RESTRICTED
Page 132
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
Recovery
Primary
mongos
…self stepdown
Secondary
133. Confidential
RESTRICTED
Page 133
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
RecoveryPrimary
Secondary
mongos
134. Confidential
RESTRICTED
Page 134
MongoDB Concepts
_ Automatic Recovery
• Mongod-mongod
heartbeat checks if the
processes are up and
contains the priority of
the mongod
• Mongos-mongod
heartbeat checks the role
of the processes
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
RecoveryPrimary
Secondary
mongos
isMaster()
135. Confidential
RESTRICTED
Page 135
MongoDB Concepts
_ Rollback files
• A rollback reverts write operations on a former primary when the member
rejoins its replica set after a failover. A rollback is necessary only if the
primary had accepted write operations that the secondaries had
not successfully replicated before the primary stepped down
• When a rollback does occur, administrators must decide whether to apply
or ignore the rollback data.
• Note: Rollback files can be avoided if the application uses replica
acknowledged write concern (=write successful only when written on
replica)
MongoDB
©2014AmadeusITGroupSA
137. Confidential
RESTRICTED
Page 137
MongoDB Concepts
_ Full resync
• In case the down time
is higher than the
oplog window, a full
resync is needed
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
Recoverymongos 1. Read from journal
138. Confidential
RESTRICTED
Page 138
MongoDB Concepts
_ Full resync
• In case the down time
is higher than the
oplog window, a full
resync is needed
• 1. Stop process
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
Recoverymongos 1. Read from journal
139. Confidential
RESTRICTED
Page 139
MongoDB Concepts
_ Full resync
• In case the down time
is higher than the
oplog window, a full
resync is needed
• 1. Stop process
• 2. wipe-out data
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
Recoverymongos 1. Read from journal
140. Confidential
RESTRICTED
Page 140
MongoDB Concepts
_ Full resync
• In case the down time
is higher than the
oplog window, a full
resync is needed
• 1. Stop process
• 2. wipe-out data
• 3. start process
MongoDB
©2014AmadeusITGroupSA
Primary
Secondary Arbiter
Heartbeat
Primary
Recoverymongos 1. Read from journal
141. Confidential
RESTRICTED
Page 141
Training MongoDB
_ MongoDB processes
• mongod (primary/secondary/arbiter), mongos, conf, agent, MMS
_ Replica Set / Shard, Shard Key, Shard Map
_ Database, Collection, Document
_ Replication (oplog)
_ Journaling
_ Capture/Restore
_ Chunk Move
_ Automatic Recovery / Election
Recap – What you should know by now
©2014AmadeusITGroupSA
144. Confidential
RESTRICTED
Page 144
Workflows – discover topology
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
_ Mongos starts
_ Reads Mongos.yml file
and connects to the
config server
Agent
BE BE BEBE
mongos
145. Confidential
RESTRICTED
Page 145
Workflows – discover topology
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
_ Mongos starts
_ Reads Mongos.yml file
and connects to the
config server
_ Retrieves the shard map
Agent
BE BE BEBE
mongos
146. Confidential
RESTRICTED
Page 146
Workflows – discover topology
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
_ Mongos starts
_ Reads Mongos.yml file
and connects to the
config server
_ Retrieves the shard map
_ Connects to all the
mongods
Agent
BE BE BEBE
mongos
147. Confidential
RESTRICTED
Page 147
Workflows – discover topology
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
_ Mongos starts
_ Reads Mongos.yml file
and connects to the
config server
_ Retrieves the shard map
_ Connects to all the
mongods
_ Retrieves the complete
list of processes for
each shard from the
mongods
Agent
BE BE BEBE
mongos
148. Confidential
RESTRICTED
Page 148
Workflows – discover topology
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
_ Mongos starts
_ Reads Mongos.yml file
and connects to the
config server
_ Retrieves the shard map
_ Connects to all the
mongods
_ Retrieves the complete
list of processes for
each shard from the
mongods
_ Retrieves the role of
each process is the
command isMaster()
Agent
BE BE BEBE
mongos
150. Confidential
RESTRICTED
Page 150
Workflows - write
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
Agent
BE BE BEBE
mongos
_ The BE wants to store a
document
_ The document is routed
according to the shard key{..}
151. Confidential
RESTRICTED
Page 151
Workflows - write
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
Agent
BE BE BEBE
mongos
_ The BE wants to store a
document
_ The document is routed
according to the shard key
_ Written only on primary
primary
{..}
152. Confidential
RESTRICTED
Page 152
Workflows - write
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
Agent
BE BE BEBE
mongos
_ The BE wants to store a
document
_ The document is routed
according to the shard key
_ Written only on primary
_ And replicated to the
secondary asynchronously
primary secondary
{..}{..}
153. Confidential
RESTRICTED
Page 153
Workflows - write
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
Agent
BE BE BEBE
mongos
_ The BE wants to store a
document
_ The document is routed
according to the shard key
_ Written only on primary
_ And replicated to the
secondary asynchronously
_ The client can decide to
wait for a successful write
in memory, on disk or on
the secondaries
primary secondary
{..}{..}
155. Confidential
RESTRICTED
Page 155
Workflows – read
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
Agent
BE BE BEBE
mongos
_ The BE wants to read
documents
_ The query is routed
according to the shard key{..}
primary
156. Confidential
RESTRICTED
Page 156
Workflows – read
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
Agent
BE BE BEBE
mongos
_ The BE wants to read
documents
_ The query is routed
according to the shard key
_ Depending on the query,
several mongods can be
targeted
primary primary
{..}{..}
157. Confidential
RESTRICTED
Page 157
Workflows – read
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
Agent
BE BE BEBE
mongos
_ The BE wants to read
documents
_ The query is routed
according to the shard key
_ Depending on the query,
several mongods can be
targeted
_ Depending on the
configuration, mongos
could read on a primary or
a secondary
primary primary secondary
{..}{..} {..}
158. Confidential
RESTRICTED
Page 158
Workflows – read
MongoDB
©2014AmadeusITGroupSA
AS
OBE
(GOS, App Support)
App
Tier
NoSQL
Tier
MongoDB
Agent
BE BE BEBE
mongos
_ The BE wants to read
documents
_ The query is routed
according to the shard key
_ Depending on the query,
several mongods can be
targeted
_ Depending on the
configuration, mongos
could read on a primary or
a secondary
_ Mongos will process the
documents returned and
reply to the BE
primary primary secondary
{..}
160. Confidential
RESTRICTED
Page 160
Operability & Monitoring
_ Let’s check the new stuffs in the life cycle of a software in ADP
• Deployment
• ACO
• Logs
• Monitoring
• Automatic Alerts
• Operations
MongoDB
©2014AmadeusITGroupSA
162. Confidential
RESTRICTED
Page 162
Operability & Monitoring
_ ULAM: mongos is deployed as a component of the OBE using it.
_ Later, MongoDB upgrades will be done by ULAM too (not initial
installation)
Deployment
©2014AmadeusITGroupSA
164. Confidential
RESTRICTED
Page 164
Operability & Monitoring
_ Current design (might evolve)
• Mongos sends its logs a binary using Tracer, this binary sends all the logs
(Error + Info) to the application logserver in “mongos_link”
Logs
©2014AmadeusITGroupSA
167. Confidential
RESTRICTED
Page 167
Operability & Monitoring
_ Uniping
• New pinger for mongo (check the status of mongod, mongos and config
processes on database side)
_ Scheck
• Nothing new, it checks nodes via ssh
_ Topx
• Nothing new, it monitors memory
_ YALB
• Monitors logs and raises specialized IRs for mongos on application side
MongoDB
©2014AmadeusITGroupSA
170. Confidential
RESTRICTED
Page 170
Operability & Monitoring
_ OSAG
• Operators and System Administrators Guide
• It contains OPROCs, POCs, escalation procedures, Impact & Recovery of
configuration changes, Setup procedures and much more!
MongoDB
©2014AmadeusITGroupSA
171. Confidential
RESTRICTED
Page 171
Operability & Monitoring
_ For GOS
• Escalation Procedure
• The link will be in each IR
• We don’t expect any action from GOS on MongoDB side, recovery
procedures are fully automated. The actions available in Workbench can be
used for test purposes
MongoDB
©2014AmadeusITGroupSA
Notes de l'éditeur Cover example with photo
Insert new photo: Delete photo on slide, click on Insert photo-icon on slide and Insert new photo. Use Crop Tool under Picture Tools to pan and zoom
To update the text, just click on the text
The divider slides can be in blue, light blue, cherry and gray. All colours are available in this template. For co-branding in dividers, insert the other company’s logo in the same size as the Amadeus logo, with no background and in reverse colour when using dark backgrounds
The divider slides can be in blue, light blue, cherry and gray. All colours are available in this template.