windows下MongoDB4.0的副本集搭建

复制三个MongoDB Server,一个为主节点Primary ,一个为辅节点Secondary,另一个为仲裁节点Arbiter

以无认证方式启动三个Server节点

server1> mongod --noauth --config mongod.cfg   
server2> mongod --noauth --config mongod.cfg
server3> mongod --noauth --config mongod.cfg

//server1 mongod.cfg
net: port: 27017 bindIp: 0.0.0.0
replication: oplogSizeMB: 200 replSetName: replset

//server2 mongod.cfg net: port: 27018 bindIp: 0.0.0.0
replication: oplogSizeMB: 200 replSetName: replset

//server3 mongod.cfg net: port: 27019 bindIp: 0.0.0.0
replication: oplogSizeMB: 200 replSetName: replset

连接server1

> mongo
> rs.initiate(); //初始化副本集设置
> rs.add('mg.imily.net:27018'); //添加server2
> rs.addArb('mg.imily.net:27019'); //添加server3
> cfg = rs.conf();
> cfg.members[0].priority = 100; //设置server1优先级
> cfg.members[1].priority = 50; //设置server2优先级
> rs.reconfig(cfg); //重新配置副本集信息

按照上一篇方式创建帐号密码后,接着需要创建节点之间的认证keyfile,用来在各节点之间的认证。

> openssl.exe rand 128 -base64 -out ./keyfile
//附下载: openssl.zip

//创建后复制到server1,server2,server3的bin目录中,并在三个mongod.cfg中添加 security: authorization: enabled keyFile: keyfile

最后添加server1,server2,server3作为系统服务,启动即可

显示更多

423 thoughts on “windows下MongoDB4.0的副本集搭建

  1. Pingback: ItWiseLink
  2. Pingback: สล็อต
  3. Pingback: canadian cialis
  4. Pingback: kevasw.webgarden.com
  5. Pingback: site128620615.fo.team
  6. Pingback: buy tadalafil
  7. Pingback: buy tadalafil pills
  8. Pingback: buy viagra now
  9. Pingback: northwestpharmacy
  10. Pingback: canadian drugs
  11. Pingback: canadian drugs
  12. Pingback: canada viagra
  13. Pingback: site656670376.fo.team
  14. Pingback: site561571227.fo.team
  15. Pingback: hekluy.ucraft.site
  16. Pingback: canada medication
  17. Pingback: canadianpharmacy
  18. Pingback: canada viagra
  19. Pingback: swenqw.company.site
  20. Pingback: canada pharmacies
  21. Pingback: pharmacy canada
  22. Pingback: canadian viagra
  23. Pingback: kwersv.proweb.cz
  24. Pingback: sdtyli.zombeek.cz
  25. Pingback: site955305180.fo.team
  26. Pingback: pharmacy
  27. Pingback: canada drug
  28. Pingback: buy viagra usa
  29. Pingback: canada drugs online
  30. Pingback: online drug store
  31. Pingback: Canadian Pharmacy USA
  32. Pingback: kaswes.proweb.cz
  33. Pingback: canadian rx
  34. Pingback: canadian drug
  35. Pingback: canada drug
  36. Pingback: fermser.flazio.com
  37. Pingback: viagra canada
  38. Pingback: buy viagra 25mg
  39. Pingback: alewrt.flazio.com
  40. Pingback: laswert.wordpress.com
  41. Pingback: buy tadalafil
  42. Pingback: buy cialis usa
  43. Pingback: kswbnh.nethouse.ru
  44. Pingback: kwenzx.nethouse.ru
  45. Pingback: online pharmacies
  46. Pingback: buy viagra medication
  47. Pingback: buy viagra uk
  48. Pingback: trust pharmacy canada
  49. Pingback: canadian cialis
  50. Pingback: canada rx
  51. Pingback: canadianpharmacy
  52. Pingback: stromectol espana
  53. Pingback: stromectol pill
  54. Pingback: canada rx
  55. Pingback: canada drugs
  56. Pingback: trust pharmacy canada
  57. Pingback: ivermectin for humans
  58. Pingback: dsdgbvda.zombeek.cz
  59. Pingback: inflavnena.zombeek.cz
  60. Pingback: Northwest Pharmacy
  61. Pingback: northwestpharmacy
  62. Pingback: buy stromectol uk
  63. Pingback: logarkomx
  64. Pingback: purchase stromectol
  65. Pingback: Bahiscom
  66. Pingback: Betmatik
  67. Pingback: Betist
  68. Pingback: Cratosslot
  69. Pingback: Betlike
  70. Pingback: Betebet
  71. Pingback: Mariobet
  72. Pingback: stromectol brasilien
  73. Pingback: Tempobet
  74. Pingback: Tipobet
  75. Pingback: Klasbahis
  76. Pingback: Vdcasino
  77. Pingback: Casinoeuro
  78. Pingback: imajbet
  79. Pingback: imajbet giris
  80. Pingback: Sahabet
  81. Pingback: stromectol prioderm
  82. Pingback: 1xbet
  83. Pingback: Bahigo
  84. Pingback: Bahis siteleri
  85. Pingback: En iyi bahis siteleri
  86. Pingback: Onwin
  87. Pingback: Kralbet
  88. Pingback: Tipobet Giriş
  89. Pingback: Betkolik
  90. Pingback: Casino Siteleri
  91. Pingback: Bettilt
  92. Pingback: Betasus
  93. Pingback: Dinamobet
  94. Pingback: Jojobet
  95. Pingback: Jojobet giriş
  96. Pingback: Hepsibahis
  97. Pingback: Marsbahis
  98. Pingback: medicament stromectol
  99. Pingback: generic stromectol
  100. Pingback: canada rx
  101. Pingback: canadian drugstore
  102. Pingback: canada rx
  103. Pingback: cialis from canada
  104. Pingback: canada drugs
  105. Pingback: buy viagra online usa
  106. Pingback: spytostyle.com

发表评论