¸ù¸¸ ¸óÆ® ¸¶½ºÅÍMongoDBÀÇ ´ÙÁß ¸¶½ºÅÍ º¹Á¦ | |
Áö±Ý ´Ù¿î·Îµå |
¸ù¸¸ ¸óÆ® ¸¶½ºÅÍ ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- The Apache License 2.0
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Rick Copeland
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://pyatl.consultracker.com/
¸ù¸¸ ¸óÆ® ¸¶½ºÅÍ Å±×
¸ù¸¸ ¸óÆ® ¸¶½ºÅÍ ¼³¸í
MongoMultimaster´Â MongoDB·Î ¸ÖƼ ¸¶½ºÅÍ º¹Á¦¸¦ ¼³Á¤ÇÒ ¼öÀÖ´Â Python µµ±¸ÀÔ´Ï´Ù. MongoDBÀÇ Á¦Á¶»çµéÀÌ ÇϳªÀÇ º¹Á¦º» ¼¼Æ®¿¡¼ OPLOG¸¦ Äõ¸®ÇÏ°í ´Ù¸¥ º¹Á¦ ¼¼Æ®¿¡ ÇØ´ç ÀÛ¾÷À» Àû¿ëÇÔÀ¸·Î½á ÀÛµ¿ÇÏÁö ¾Ê´Â 10GEN¿¡¼´Â 10GENÀÌ Áö¿øÇÏÁö ¾Ê½À´Ï´Ù. °¢ ¹®¼¸¦ Source.InstallingTo ¼³Ä¡·Î º¹Á¦ ÇÑ °¢ ¹®¼¸¦ űëÇÏ¿© ¾ç¹æÇâ º¹Á¦¸¦ Áö¿øÇÕ´Ï´Ù. PIP ¼³Ä¡ MongOmultimasterMongoDB Setupmmm °¢ ¸¶½ºÅÍ¿¡ ´ëÇÑ º¹Á¦º» ÁýÇÕ Oplog¿¡ ´ëÇÑ ¾×¼¼½º°¡ ÇÊ¿äÇÕ´Ï´Ù. Áï, µ¶¸³ ½ÇÇà Çü ¼¹ö·Î ±¸¼ºµÈ ¼¹ö¿¡¼ ÀÛµ¿ÇÏÁö ¾Ê½À´Ï´Ù. µ¶¸³ ½ÇÇà Çü ¼¹ö¸¦ Singleton º¹Á¦º» ¼¼Æ®·Î º¯È¯ÇÏ·Á¸é ¸ÕÀú ½ÃÀÛ ½Ã°£¿¡ ¼³Á¤µÈ ¼¼Æ®¿¡ ´ëÇØ ¾Ë·Á Á®¾ßÇÕ´Ï´Ù. Mongod --replset Foothen, º¹Á¦º» ¼¼Æ®¸¦ ½ÃÀÛÇÏ·Á¸é ¸ù°í ½©¿¡¼ ´ÙÀ½À» ½ÇÇàÇؾßÇÕ´Ï´Ù.> Rs.initiate () MongOmultimaster Replication SetupOnce º¹Á¦º» ¼¼Æ® ¸¶½ºÅ͸¦ ÀÛ¼ºÇÑ °æ¿ì ¼¹ö°¡ÀÖ´Â °÷¿¡¼ MMMÀ» ¾Ë·ÁÁÖ´Â µ¥ ÇÊ¿äÇÕ´Ï´Ù. ÀÌ°ÍÀº YAML ±¸¼º ÆÄÀÏÀ» ÅëÇØ ¼öÇàµË´Ï´Ù. µÎ ¼¹ö°¡ÀÖ´Â »ùÇà ±¸¼º ÆÄÀÏÀº ´ÙÀ½°ú °°½À´Ï´Ù. server_a : id : '2C88AE84-7CB9-40F7-84-7CB9-40F7-84-7CB9-40F7-835D-C05E981F564D'URI : 'mongodb : // localhost : 27019'server_b : ID :'0d9c284b-b47c-40b5-932c- 547B8685EDD0 'URI :'MongoDB : // localhost : 27017'First, ±¸¼ºÀ̾ø°í ±¸¼º ÆÄÀÏÀÇ ¸ðµç ¼¹ö¿¡ ¿¬°áÇÒ ¼ö ÀÖ´ÂÁö È®ÀÎÇÏ°í clear-configabout¿¡¼ config-configabout¿¡¼ ¼¹ö¿¡¼ config-configaboutÀ» ¼±ÅÃÇϽʽÿÀ. , È®½ÇÇմϱî? (yn) server_b mmm -c test.yml ´ýÇÁ - config === server config === server_a (2C88AE84-7CB9-40F7-835D-C05E981F7-835D-C05E981F564D) => mongodb : // localhost : 27019Server_B (0D9C284B -B47C-40B5-932C-547B5-9EDD0) => mongodb : // localhost : 27017 === server_a replication config === server_b º¹Á¦ confignext, µÎ °³ÀÇ º¹Á¦ µÈ Ä÷º¼ÇÀ» ¼³Á¤ÇÕ´Ï´Ù : mmm -c test.yml º¹Á¦ --src = server_a / test.foo --dst = server_b / test.foo mmm -c test.yml replicate --src = server_a / test.bar --dst = server_b / test.barand°¡ ¿Ã¹Ù¸£°Ô ±¸¼ºµÇ¾ú´ÂÁö È®ÀÎ : mmm -c test.yml dump-config === server config === server_a (2c88ae84-7cb9-40f7-84-7cb9-40f7-84-7cb9-40f7-835d-c05e981f564d) => mongodb : // localhost : 27019Server_B (0D9C284B-B47C-40B5-932C-547B8685EDD0) => mongodb : // localhost : 27017 === Server_A Replication Config === Server_B º¹Á¦ config - test.foo <= server_a testfoo-testbar <= server_a testbarnow º¹Á¦ ¾ç¹æÇâ : mmm-c test mll replicate--src = server_b testfoo-dst = server_a test foo mmm-c testyml replicate--src = server_b testbar--dst = server_a testbarand ¿Ã¹Ù¸¥Áö È®ÀÎÇϽʽÿÀ mmm-c testyml dump-config === server config === server_a (2c88ae84-7cb9-40f7-835d-c05e981f564d) =/> mongodb : // localhost : 27019Server_B (0D9C284B-B47C-40B5-932C-547C-40B5-932C-547B8685EDD0) => mongodb : // localhost : 27017 == Server_A º¹Á¦ ±¸¼º - Å×½ºÆ®. foo <= server_b / test.foo - test.bar <= server_b / test.bar === server_b º¹Á¦ config - test.foo <= server_a / test.foo - test.bar <= server_a / test.barnow ¿ì¸®°¡ ½ÇÇàÇÒ ¼ö ÀÖ½À´Ï´Ù Replicator : MMM -C Test.yml Runthings°¡ ¸¹ÀÌ ¾²´Â °æ¿ì, º¹Á¦¸¦ °í·ÁÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ°ÍÀº ÀüÇô 󸮵ÇÁö ¾Ê½À´Ï´Ù .- º¹Á¦´Â MMM RunÀÌ Ã³À½ È£Ãâ µÈ ½ÃÁ¡¿¡¼ ½ÃÀ۵˴ϴÙ. MMMÀ» ÁßÁö / ½ÃÀÛÇÏ°í Áß´Ü ÇÑ °÷¿¡¼ ÇȾ÷ ÇÒ ¼ö ÀÖ¾î¾ßÇÕ´Ï´Ù .- ÁÖÀÎ °£ÀÇ Ãæµ¹Àº 󸮵ÇÁö ¾Ê½À´Ï´Ù. µÎ Çìµå¿¡¼ µ¿ÀÏÇÑ ¹®¼¿¡ ÀÚÁÖ µ¿ÀÏÇÑ ¹®¼¿¡ ¾²·Á¸é µ¿±âÈ ¹Û¿¡ ¾ø½À´Ï´Ù .- º¹Á¦´Â °¢ ¹®¼¿¡ ºÎ±â¸¦ »ðÀÔÇÏ¿© ¸¶Áö¸·À¸·Î ¹®¼¸¦ ÀÛ¼ºÇÑ ¼¹ö UUID¸¦ ³ªÅ¸³À´Ï´Ù. ÀÌ´Â °¢ ¹®¼ÀÇ Å©±â¸¦ ¾à°£ È®ÀåÇÕ´Ï´Ù. ¾Æ¸¶µµ ³¯Ä«·Î¿î °¡ÀåÀÚ¸®, ´Ù¸¥ ¹ö±×°¡ ÀÖ°í öÀúÇÑ Å×½ºÆ®¾øÀÌ »ý»ê ½Ã½ºÅÛ¿¡¼ MMMÀ» »ç¿ëÇÏ¸é ³¯Ä«·Î¿î °¡ÀåÀÚ¸®, ´Ù¸¥ ´©¶ô µÈ ¹ö±× ¹× ´Ù¾çÇÑ ºÒÄèÇÑ °ÍµéÀÌ ÀÖ½À´Ï´Ù. ±×·¯³ª °¡À§·Î ´Þ¸®°í ±×·¸Áö ¾ÊÀ¸¸é À§ÇèÇÏ°Ô »ì¾Æ°¡´Â °ÍÀ» ÁÁ¾ÆÇÑ´Ù¸é, ±×°ÍÀ» ½ÃµµÇغ¸½Ê½Ã¿À. Á¦Ç°ÀÇ È¨ÆäÀÌÁö
¸ù¸¸ ¸óÆ® ¸¶½ºÅÍ °ü·Ã ¼ÒÇÁÆ®¿þ¾î