莫问 发表于 2018-10-26 14:00:27

Linux系统mongodb主从模式配置

# /usr/local/mongodb/bin/mongo --host 192.168.137.148  
MongoDB shell version: 2.6.4
  
connecting to: 192.168.0.23:27017/test
  
Welcome to the MongoDB shell.
  
For interactive help, type "help".
  
For more comprehensive documentation, see
  http://docs.mongodb.org/
  
Questions? Try the support group
  http://groups.google.com/group/mongodb-user
  
Server has startup warnings:
  
2014-09-24T14:16:58.169+0800
  
2014-09-24T14:16:58.169+0800 ** WARNING: You are running on a NUMA machine.
  
2014-09-24T14:16:58.169+0800 **          We suggest launching mongod like this to avoid performance problems:
  
2014-09-24T14:16:58.169+0800 **            numactl --interleave=all mongod
  
2014-09-24T14:16:58.169+0800
  
> show dbs;                            #查看数据库
  
local1.203125GB
  
test0.203125GB
  
> use test1;                            #新建库
  
switched to db test1
  
> db.foo.save({"id":123456,"name":'zhangsan'})       #插入数据
  
> db.foo.find({"id":123456})            #查询数据
  
{ "_id" : ObjectId("542277078091089e1cbfecbc"), "id" : 123456, "name" : "zhangsan" }
  
> show dbs;
  
local1.203125GB
  
test0.203125GB
  
test10.203125GB


页: [1]
查看完整版本: Linux系统mongodb主从模式配置