New answers tagged

0

This is a reasonable question for the user case of 2 physical servers. One can run 1 storage member and 1 arbiter on each node for the replica set. Advantage? Well, in case of 2 replica set members you can not restart one of the storage nodes (meaning the member, not the physical server), since the other one will lose quorum and go into secondary role. But ...


1

Your primary is trying to auto-configure itself as ee3c41ef76b2:27017 and that then resolves to the loopback (127.0.0.1) which is then not responding on the container as it expects. Depending on what the second container does to resolve ee3c41ef76b2, and especially it it does not resolve to 172.17.0.2, it will probably not be able to talk to the primary ...


0

Here's what I did in a similar process for Elasticsearch on a Mac using Brew: Note: as new daemons are started, switch to new terminals ElasticSearch (after 'brew install elasticsearch'): $ elasticsearch #start es daemon on port 9200 MongoDB just outside the 'data' folder [or other database location] (and after 'brew install mongodb' and 'pip install ...


0

It depends how far behind it fell and what status you have it in your config file at the time of resync. Basically if you've been down so long that it can't catch up with the OpsLog or the OpsLog no longer has the transactions it needs due to it being removed over time you'll want to resync yourself. Check out the docs for your version: Restart the ...


0

The shell does not actually return just 20 records, what you get returned when you run a find like the one you list in the shell is a cursor, the shell then by default iterates over and displays the first 20 documents returned by that cursor (for convenience). For example: > db.foo.find({}, {_id : 1}) { "_id" : ObjectId("573c4afbaa6cd35206c16a8d") } { ...


5

I have been in the noSQL field since last 3 years. Being a MongoDB DBA you need to work closely with Development and Ops team. Following are the things you need to do as day to day task as MongoDB DBA: The role can be broadly classified into three parts: Administration: New deployments (manual/automated) Deployment design of you database systems ...


5

DBA is a small acronym but a large role. At various times I have seen a DBA look after storage network VMs compute nodes installation and configuration of the above backups, and testing restores DR strategy enterprise data integrity ETL data security data modelling, normalisation and database design data tier programing performance tuning operational ...


2

You'll need to find a different approach as there are a few major assumptions that won't work. The solution I am going to implement for my client is that I will set up a Raspberry Pi that will run the same web application locally at their shop Raspberry Pi 1/2 (with 32-bit ARM CPU) is not an officially supported platform for MongoDB, nor is it likely ...


0

You can replicate data from one server to others using Replication feature in MongoDB. The replica set ensures high availability and redundancy of you mongodb data in case if node failure. In your case, you can create a replica set of 3 nodes (PRIMARY, SECONDARY, ARBITER). When one of the server goes down, Secondary would be promoted as PRIMARY which ...


0

in cited article: the way to force a specific subdocument to match is to use “$elemMatch”: db.generic.findOne({"props": { $elemMatch: {n: "prop1", v: 0} }}) remove "_" from field_2 - looks like a typo


0

Collection can be visualized as a table in RDBMS. document can be visualized as a row in RDBMS. Biggest difference is collection needs not have all the fields/columns. There is no joining of two columns. It is achieved by nested document.


-3

creat three replica set with different port number and then try


0

unknown opcode 2011 You are trying to use an older version of mongosniff to inspect traffic for a MongoDB server that uses a newer version of the MongoDB wire protocol. Specifically, it looks like you are using a version of mongosniff older than 3.2 to inspect traffic from MongoDB 3.2 (which added the 2011 opcode for dbCommandReply). To fix this you ...


0

The error message in your screenshot indicates you are trying to add identical members to your replica set under different names: "The hosts x:27017 and y:27017 all map to this node in new configuration". If you want to configure multiple replica set members on a single machine for testing purposes, all members need to use different ports and/or IP ...


0

Update based on MongoEngine usage in comments: MongoEngine defers to pymongo for the connection pool setting. Hence, based on the pymongo FAQ: In versions before 2.6, the default max_pool_size was 10, and it did not actually bound the number of open connections; it only determined the number of connections that would be kept open when no longer in ...


0

The problem is that you make several wrong assumptions. Below you will find some corrections MongoDB is not optimized for small resources MongoDB was specifically designed to take a lot of data (recording clickstreams were the first application, iirc). As far as I can read, you have your django app on the same server as MongoDB. The problem here is that a ...


1

MongoDB does not return the results of field-level updates like an $addToSet operator; the overall document update either succeeds or fails. However, assuming you are using MongoDB 2.6 or newer, you can infer whether the update was a no-op by inspecting the WriteResult returned on update/upsert. Example below using MongoDB 3.2. Test data: ...


0

To monitor your MongoDB server and display the output of the commands like mongostat, mongotop etc you can use this simple tool called SeaLion. The UI is quite simple and lets you view raw outputs across your servers. You can go back in time and debug the issues. The latest version is shipped with NGINX, Apache, MySQL, MongoDB and Redis metrics and command ...


1

Document in MongoDB is analogous to row in relational database. As opposed to relational database,MongoDB supports dynamic schema i.e documents can consist of varying fields. Collection is set of documents belonging to same entity similar to tables in relational database.


0

Answer from user1472187 will work, but unfortunately these settings won’t last a reboot. You need to add some init scripts: http://frank2.net/cgroups-ubuntu-14-04/ Shell script is available for Ubuntu 14.04: http://brainsuckerna.blogspot.com.by/2016/05/limiting-mongodb-memory-usage-with.html


2

It is possible using cgroups. Some tutorials are available as well as shell script for Ubuntu 14.04. See also Is there any option to limit mongodb memory usage? on Stack Overflow.


2

In the context of MongoDB, a document means any piece of valid BSON* (binary JSON). The word does not have the everyday meaning of, say, an MS Word file or PDF. A collection is a container for zero or more documents. There is no requirement for all documents in a collection to have the same structure. Indeed, that is one of the drivers behind the NoSQL ...


2

I want to monitor accessNotInMemory of mongodb The database-level recordStats information was specific to the older MMAP storage engine and removed during the MongoDB 3.0 development cycle as part of the work toward collection-level locking and the new storage engine API. A more general performance indicator you can monitor is ...


1

If you know start _id and end _id then you can retrieve the bulk you inserted using query like this: db.yourCollection.find({_id:{$gt:ObjectId("56e13d5aed63a8477a7e2e78"), $lt: ObjectId("570f5a27b2d1a50996d3a0f0")}}) Replace the default mongodb ObjectIds with your _id fields. Also, if the _id you are using is default mongodb ObjectId then you can easily ...


2

Launch Shell as User: If all else fails, on Ubuntu 14.04 LTS running on AWS, try this... me@local $ ssh -i aws.pem ubuntu@foo ubuntu@foo $ sudo -u mongodb bash # OR whatever shell (zsh) mongodb@foo $ mongod --dbpath /data/db --fork OF COURSE, you'll add a much larger set of flags to the command. Note also that this assumes you're authenticated as ...


1

You can execute mongodump from the remote server as mentioned below: mongodump --host <ip-of-mongodb-server> --port <port-number-of-mongod> --out <some-directory> This is required mongo server to be accessible from the remote server. This dump file can be then compressed and archived on remote host or s3. If the mongo server is not ...


1

Typically, you don't. Thinking of your nodes in terms of primary or secondary is the wrong way to approach it. Since standard data bearing nodes should have the same dimensions, it is better to think of them as replica set members, one of which gets elected to primary. Since the drivers are replica set aware and know which the current primary is and you are ...


0

I faced the same issue then looked into Mongos log file and it was saying can't authenticate to hostname as internal user, error: Authentication failed. Please see here: internal user authentication and happens with SecKey file and auth- Enabled. Resolution I opened mongod.conf file and security: authorization: enabled keyFile: ...



Top 50 recent answers are included