zoukankan      html  css  js  c++  java
  • 关闭mongodb 集群

    [root@hadoop1 ~]# ps -aux | grep mongodb;
    root     15365  0.4  0.2 310040 42984 ?        Sl   17:46   0:05 /usr/local/mongodb/bin/mongod -f /usr/local/mongodb/conf/mongod.conf
    root     15500  0.0  0.1  90872 18204 pts/0    Sl+  18:01   0:00 /usr/local/mongodb/bin/mongo --host hadoop1
    root     15512  0.0  0.0 112668   976 pts/1    S+   18:04   0:00 grep --color=auto mongodb
    [root@hadoop1 ~]# kill 15365;
    [root@hadoop1 ~]# kill 15500;
    [root@hadoop1 ~]# /usr/local/mongodb/bin/mongod -f /usr/local/mongodb/conf/mongod.conf 
    about to fork child process, waiting until server is ready for connections.
    forked process: 17129
    child process started successfully, parent exiting
    [root@hadoop1 ~]# /usr/local/mongodb/bin/mongo
    MongoDB shell version v3.4.0
    connecting to: mongodb://127.0.0.1:27017
    MongoDB server version: 3.4.0
    > cfg={_id:'replSet1',members:[{_id:1,host:'hadoop1:27017'},{_id:2,host:'hadoop2:27017'},{_id:3,host:'hadoop1:27017'}]}
    {
    	"_id" : "replSet1",
    	"members" : [
    		{
    			"_id" : 1,
    			"host" : "hadoop1:27017"
    		},
    		{
    			"_id" : 2,
    			"host" : "hadoop2:27017"
    		},
    		{
    			"_id" : 3,
    			"host" : "hadoop1:27017"
    		}
    	]
    }
    > rs.initiate(cfg);
    {
    	"ok" : 0,
    	"errmsg" : "Attempting to initiate a replica set with name replSet1, but command line reports repl_test; rejecting",
    	"code" : 93,
    	"codeName" : "InvalidReplicaSetConfig"
    }
    

    https://docs.mongodb.com/manual/reference/glossary/#term-master  

    mongoThe MongoDB shell. The mongo process starts the MongoDB shell as a daemon connected to either amongod or mongos instance. The shell has a JavaScript interface. See mongo and mongo Shell Methods.mongodThe MongoDB database server. The mongod process starts the MongoDB server as a daemon. The MongoDB server manages data requests and formats and manages background operations. See mongod.

    https://docs.mongodb.com/manual/replication/

    【a group of MongoDB database server that maintain the same data set.】

    replica set in MongoDB is a group of mongod processes that maintain the same data set. Replica sets provide redundancy and high availability, and are the basis for all production deployments. This section introduces replication in MongoDB as well as the components and architecture of replica sets. The section also provides tutorials for common tasks related to replica sets.

  • 相关阅读:
    《软件需求分析》阅读笔记
    03软件需求阅读笔记之一
    02软件需求阅读笔记之一
    01软件需求阅读笔记之一
    评价一下大家手头正在使用输入法或者搜索类的软件产品。
    05构建之法阅读笔记之一
    06构建之法阅读笔记之一
    03构建之法阅读笔记之一
    【秋招必备】Java中间件面试题(2021最新版)
    快手3面:说说傅里叶变换、拉普拉斯变换为什么要变换,它们之间的联系是什么!
  • 原文地址:https://www.cnblogs.com/rsapaper/p/7871858.html
Copyright © 2011-2022 走看看