Code Monkey home page Code Monkey logo

learn-mongodb's People

Contributors

justmeandopensource avatar max201920 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-mongodb's Issues

rs.initiate() giving error

When I issue rs.initiate(
{
_id: "cfgrs",
configsvr: true,
members: [
{ _id : 0, host : "localhost:40001" },
{ _id : 1, host : "localhost:40002" },
{ _id : 2, host : "localhost:40003" }
]
}
)

I am getting the following error
{
"ok" : 0,
"errmsg" : "No host described in new configuration with {version: 1, term: 0} for replica set cfgrs maps to this node",
"code" : 93,
"codeName" : "InvalidReplicaSetConfig",
"$gleStats" : {
"lastOpTime" : Timestamp(0, 0),
"electionId" : ObjectId("000000000000000000000000")
},
"lastCommittedOpTime" : Timestamp(0, 0)
}
It will be great if you can help.

cannot connect to mongo instance commnad is not working

hello i tried for 3 days but your command is missing somtheing
mongo mongodb IP address/:40001
it does not work
to me this syntax is wrong
soince i have dome replica sets and sharding w/out docker containers and it works

plz advise but its not working in your docker mongo shard vids

thxz anyway and thxz

Lisa

How much DigitalOcean droplets for Mongo Sharding?

The first, thanks for your tutorial.
I would like to try Mongo Sharding on DigitalOcean droplets.

  • How many Droplets, we need for 2 Shardings?
  • How Droplets size: Ram, CPU...?
  • How many database that we could created: one, two, three..

Could we config `rs.initiate()` with docker hostname?

I checked many doc and youtube, they use docker hostname to config rs.initiate() like this

// docker-compose
version: "3"

services:
  mongors1:
    hostname: mongors1
    container_name: mongors1
    image: mongo:4.0.6
    command: mongod --replSet mongors --port 27017 --dbpath /data/db
    ports:
      - 20001:27017
    volumes:
      - mongors1:/data/db

  mongors2:
    hostname: mongors2
    container_name: mongors2
    image: mongo:4.0.6
    command: mongod --replSet mongors --port 27017 --dbpath /data/db
    ports:
      - 20002:27017
    volumes:
      - mongors2:/data/db

  mongors3:
    hostname: mongors3
    container_name: mongors3
    image: mongo:4.0.6
    command: mongod --replSet mongors --port 27017 --dbpath /data/db
    ports:
      - 20003:27017
    volumes:
      - mongors3:/data/db

volumes:
  mongors1: {}
  mongors2: {}
  mongors3: {}

Config replicaSet

config = {
  _id: "mongors",
  members: [
    { _id : 0, host : "mongors1:27017" },
    { _id : 1, host : "mongors2:27017" },
    { _id : 2, host : "mongors3:27017" }
  ]
}

rs.initiate(config)

But I have problem on replicaSet connection (don't work)

mongo 'mongodb;//localhost:20001,localhost:20002,localhsot:20003/?replicaSet=mongors'
mongo 'mongodb;//192.168.1.100:20001,192.168.1.100:20002,192.168.1.100:20003/?replicaSet=mongors'
....

Don't understand????????

Could example how to use `Mongos Router` with 2 or 3 nodes?

Could example how to use Mongos Router with 2 or 3 nodes?

version: "3"

services:
  mongos:
    container_name: mongos
    image: mongo:4.0.6
    command: mongos --configdb cfgrs/192.168.0.102:40001,192.168.0.102:40002,192.168.0.102:40003 --bind_ip 0.0.0.0 --port 27017
    ports:
      - 60000:27017
...............

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.