Cov txheej txheem:

Dab tsi yog replica hauv MongoDB?
Dab tsi yog replica hauv MongoDB?

Video: Dab tsi yog replica hauv MongoDB?

Video: Dab tsi yog replica hauv MongoDB?
Video: Hmong - LUB NEEJ LI CAS? - lus nug txog ntuj ceeb tsheej 2024, Hlis ntuj nqeg
Anonim

A luam tawm teem rau hauv MongoDB yog ib pab pawg mongod txheej txheem uas tswj cov ntaub ntawv tib yam. Rov ua dua cov txheej txheem muab redundancy thiab muaj siab, thiab yog lub hauv paus rau tag nrho cov ntau lawm deployments. Ntu no qhia txog replication hauv MongoDB as well as lub Cheebtsam thiab architecture ntawm luam tawm teeb.

Raws li txoj cai, kuv yuav pib qhov kev hloov pauv li cas hauv MongoDB?

Txhawm rau teeb tsa Replica Teeb ntawm ib lub tshuab nrog ntau qhov xwm txheej mongod, hauv qab no yog ib kauj ruam los ntawm kev qhia:

  1. Pib ib qho piv txwv mongod.
  2. Pib lwm qhov piv txwv mongod.
  3. Pib Replication.
  4. Ntxiv ib qho piv txwv MongoDB rau Replica Set.
  5. Xyuas qhov xwm txheej.
  6. Xyuas Replication.

Ib tug kuj yuav nug, dab tsi yog replica database? Database replication yog qhov kev luam tawm hluav taws xob ntau zaus cov ntaub ntawv los ntawm a database hauv ib lub computer lossis server rau ib database nyob rau hauv lwm yam kom txhua tus neeg siv qhia tib theem ntawm cov ntaub ntawv. Ntau lub ntsiab lus pab txhawb rau tag nrho cov txheej txheem ntawm kev tsim thiab tswj database replication.

Ntawm no, MongoDB replication ua haujlwm li cas?

MongoDB ua tiav rov ua dua los ntawm kev siv luam tawm teeb. A luam tawm set yog ib pawg ntawm mongod piv txwv uas host tib cov ntaub ntawv teev. Hauv ib luam tawm , ib lub node yog thawj node uas tau txais tag nrho cov kev sau ntawv. Tag nrho lwm qhov xwm txheej, xws li cov tsev kawm theem nrab, siv cov haujlwm los ntawm cov thawj coj kom lawv muaj cov ntaub ntawv tib yam.

Lub hom phiaj ntawm tus arbiter nyob rau hauv ib tug replica yog dab tsi?

Arbiters yog mongod piv txwv uas yog ib feem ntawm a replica teev tab sis tsis tuav cov ntaub ntawv. Arbiters koom nrog kev xaiv tsa txhawm rau txhawm rau kev sib raug zoo. Yog ib replica teev muaj tus naj npawb ntawm cov tswv cuab, ntxiv ib qho arbiter . Tsis txhob khiav ib arbiter ntawm cov kab ke uas tseem tuav cov thawj lossis cov tswv cuab thib ob ntawm cov replica teev.

Pom zoo: