何小伟-向mongodb集群添加新的成员节点

上传人:mg****85 文档编号:35762089 上传时间:2018-03-20 格式:DOC 页数:12 大小:89.50KB
返回 下载 相关 举报
何小伟-向mongodb集群添加新的成员节点_第1页
第1页 / 共12页
何小伟-向mongodb集群添加新的成员节点_第2页
第2页 / 共12页
何小伟-向mongodb集群添加新的成员节点_第3页
第3页 / 共12页
何小伟-向mongodb集群添加新的成员节点_第4页
第4页 / 共12页
何小伟-向mongodb集群添加新的成员节点_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《何小伟-向mongodb集群添加新的成员节点》由会员分享,可在线阅读,更多相关《何小伟-向mongodb集群添加新的成员节点(12页珍藏版)》请在金锄头文库上搜索。

1、 向向 MongodbMongodb 集群添加新的成员节点集群添加新的成员节点向集群添加新节点有两种方法:向集群添加新节点有两种方法:方方 法法第一种方法第一种方法拷贝其他节点的数据文件到新的节点第二种方法第二种方法向已有的 replica set 添加新成员一第一种方法一第一种方法( (拷贝其他节点的数据文件到新的节点拷贝其他节点的数据文件到新的节点) )我们在启动 mongod 服务之前一定要拷贝数据文件到本机。下面是空库添加到一个 replica set 中的日志记录:第一步:第一步:# 连接连接PrimaryPrimary 库库Tue Nov 1 14:22:57 initandlis

2、ten connection accepted from 10.250.7.220:54235 #2Tue Nov 1 14:22:57 initandlisten connection accepted from 10.250.7.220:54236 #3Tue Nov 1 14:22:57 initandlisten connection accepted from 10.250.7.220:54237 #4Tue Nov 1 14:22:57 rsStart trying to contact 10.250.7.220:27018Tue Nov 1 14:22:57 rsStart tr

3、ying to contact 10.250.7.220:27019Tue Nov 1 14:22:57 rsStart trying to contact 10.250.7.220:27020第二步:第二步:#从从 primaryprimary 库复制库复制 replicareplica setset 的配置信息,并保存到本地的配置信息,并保存到本地 -dbpath-dbpath 指定的文件目录指定的文件目录#Tue Nov 1 14:22:57 rsStart replSet got config version 2 from a remote, saving locallyTue Nov

4、 1 14:22:57 rsStart replSet info saving a newer config version to local.system.replsetTue Nov 1 14:22:57 FileAllocator allocating new datafile /opt/mongodata/r1/local.ns, filling with zeroes.Tue Nov 1 14:22:57 FileAllocator creating directory /opt/mongodata/r1/_tmpTue Nov 1 14:22:57 FileAllocator do

5、ne allocating datafile /opt/mongodata/r1/local.ns, size: 16MB, took 0.118 secsTue Nov 1 14:22:57 FileAllocator allocating new datafile /opt/mongodata/r1/local.0, filling with zeroes.Tue Nov 1 14:23:01 FileAllocator done allocating datafile /opt/mongodata/r1/local.0, size: 64MB, took 3.807 secsTue No

6、v 1 14:23:01 FileAllocator allocating new datafile /opt/mongodata/r1/local.1, filling with zeroes.Tue Nov 1 14:23:02 rsStart replSet saveConfigLocally doneTue Nov 1 14:23:02 FileAllocator done allocating datafile /opt/mongodata/r1/local.1, size: 128MB, took 1.068 secsTue Nov 1 14:23:02 rsStart replS

7、et STARTUP2Tue Nov 1 14:23:02 rsMgr replSet total number of votes is even - add arbiter or give one member an extra voteTue Nov 1 14:23:02 rsSync *第三步:第三步:#创建创建 oplogoplog 日志文件日志文件#Tue Nov 1 14:23:02 rsSync creating replication oplog of size: 944MB.Tue Nov 1 14:23:02 FileAllocator allocating new dat

8、afile /opt/mongodata/r1/local.2, filling with zeroes.Tue Nov 1 14:23:04 rsHealthPoll replSet info member 10.250.7.220:27018 is upTue Nov 1 14:23:04 rsHealthPoll replSet member 10.250.7.220:27018 is now in state SECONDARYTue Nov 1 14:23:04 rsHealthPoll replSet info member 10.250.7.220:27019 is upTue

9、Nov 1 14:23:04 rsHealthPoll replSet member 10.250.7.220:27019 is now in state SECONDARYTue Nov 1 14:23:04 rsHealthPoll replSet info member 10.250.7.220:27020 is upTue Nov 1 14:23:04 rsHealthPoll replSet member 10.250.7.220:27020 is now in state PRIMARYTue Nov 1 14:23:49 FileAllocator done allocating

10、 datafile /opt/mongodata/r1/local.2, size: 1024MB, took 46.28 secsTue Nov 1 14:23:50 rsSync *第四步:第四步:#应用主库的日志,复制数据文件应用主库的日志,复制数据文件#Tue Nov 1 14:23:50 rsSync replSet initial sync pendingTue Nov 1 14:23:50 rsSync replSet syncing to: 10.250.7.220:27020Tue Nov 1 14:23:50 rsSync build index local.me _id:

11、 1 Tue Nov 1 14:23:50 rsSync build index done 0 records 0.003 secsTue Nov 1 14:23:50 rsSync replSet initial sync drop all databasesTue Nov 1 14:23:50 rsSync dropAllDatabasesExceptLocal 1Tue Nov 1 14:23:50 rsSync replSet initial sync clone all databasesTue Nov 1 14:23:50 rsSync replSet initial sync c

12、loning db: testTue Nov 1 14:23:50 FileAllocator allocating new datafile /opt/mongodata/r1/test.ns, filling with zeroes.Tue Nov 1 14:23:51 FileAllocator done allocating datafile /opt/mongodata/r1/test.ns, size: 16MB, took 0.8 secsTue Nov 1 14:23:51 FileAllocator allocating new datafile /opt/mongodata

13、/r1/test.0, filling with zeroes.Tue Nov 1 14:23:55 FileAllocator done allocating datafile /opt/mongodata/r1/test.0, size: 64MB, took 3.643 secsTue Nov 1 14:23:55 FileAllocator allocating new datafile /opt/mongodata/r1/test.1, filling with zeroes.Tue Nov 1 14:23:55 rsSync build index test.yql _id: 1

14、Tue Nov 1 14:23:56 rsSync build index done 1 records 0.006 secsTue Nov 1 14:23:56 rsSync replSet initial sync query minValidTue Nov 1 14:23:56 rsSync replSet initial oplog application from 10.250.7.220:27020 starting at Nov 1 14:14:05:1 to Nov 1 14:14:05:1Tue Nov 1 14:23:57 rsSync replSet initial sy

15、nc finishing upTue Nov 1 14:23:57 rsSync replSet set minValid=4eaf8e2d:1Tue Nov 1 14:23:57 rsSync build index local.replset.minvalid _id: 1 Tue Nov 1 14:23:57 rsSync build index done 0 records 0.023 secsTue Nov 1 14:23:57 rsSync replSet initial sync doneTue Nov 1 14:23:58 rsSync replSet syncing to: 10.250.7.220:27020Tue Nov 1 14:23:58 rsSync replSet SECONDARYTue Nov 1 14:24:02 FileAllocator done allocating datafile /opt/mongodata/r1/test.1, size: 128MB, took 7.428 secsTue Nov 1 14:24:16 clientcursormon mem (MB) res:16 virt:

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号