New answers tagged

2

You can group several privileges into one Role. It is simpler to grant roles rather than dealing with a bunch of privileges. In a multi-tier architecture this might be no so important. You may have a user admin, backup, http - that's it. However, when your database is used by many (human) users distributed over several departments with different ...


0

TLS (Transport Layer Security) is the successor to the now deprecated SSL (Secure Sockets Layer). Early versions of TLS included some backward compatibility with SSL, but modern security protocols are now fully TLS. Older versions of SSL (and TLS) have known weaknesses and are not recommended (and often no longer supported). The mongod and mongos ...


2

Arbiter nodes don't "replicate" data... The problem with your setup is that, that you can "lose" two of your three data-bearing nodes and your setup has still "majority" in votes. Meaning that replica set still keeps "serving" clients, but all data is only at the one node without replication. Then comes that "majority RC", with that setup, even you lose ...


0

In general arbiters are only useful with an even number of host in a ReplicaSet, so you can remove them. Regarding your question see Add an Arbiter to Replica Set Warning In general, avoid deploying more than one arbiter per replica set. For 3-Member Primary-Secondary-Arbiter Architecture If you have a three-member replica set with a ...


1

Index creation will be show in the mongo error logs. You can monitor the progress of the index creation. 52 hours is very slow. Can you post the masked error log here?


-1

If you add a new replica node, Mongodb will itself copy the data across to the new node. Unless if your data size is huge and do not want your network to be flooded in transferring the data you can follow the backup method.


0

stop mongod sh -c "sync; echo 3 > /proc/sys/vm/drop_caches" start mongod stop mongod: Stops the database service. sh -c "sync; echo 3 > /proc/sys/vm/drop_caches": write any data stored in memory to disk. start mongod: Start the database again.


0

I could finally get it to work by executing following command : sudo mongod --fork --auth --port 27017 --dbpath /var/lib/mongodb --logpath /var/lib/mongodb/mongod.log


0

Why it always 1 or more than 2? Obvious answer is split brain problem. Any instance or programs that falls under replication would face this issue. Read more this


1

In MongoDB 3.6 and newer, shards must be deployed as a replica set. Replication provides data redundancy and high availability for each shard; sharding enables a collection to be distributed across multiple shards. For more information see Sharded Cluster Components and the Deploy a Sharded Cluster tutorial in the MongoDB documentation.


1

Seems like the point of checkpoints was to move fast, but at the risk of losing a minute of data at a time. Whereas the journal is all about accounting for everything. So why have both? Seems like having the Journal kind of overrides any gains that Checkpoints were supposed to give. Although journal and checkpoint processes both write data to disk, they ...


0

The solution to my problem is mentioned in another stackoverflow answer to a different question. If I modify the projection as a value of "fields" as below then findOne() works as I expect. const data = await collection .findOne( { _id: someId }, { fields: {...


1

I think you need to use project(). See the example here - Projections


0

Looks like somebody deleted the log file while it was used by the mongodb process. Deleting log files is such a manner is not a good idea as the process will keep it locked and that means the file will keep occupying space on the disk. Such deleted files entry in the lsof will disappear once the process that is locking it is restarted. The best way to ...


0

Linux systems limit the number of file descriptors that any one process may open to 1024 per process. (This condition is not a problem on Solaris machines, x86, x64, or SPARC). Learn more. Type in the command below to change it: ulimit -n 1000000 Or go inside /etc/security/limits.conf to change it permanantly.


0

Same question was asked in here. Starting in 4.2 version of MongoDB, they announced wildcard indexes. Here is an example: db.myCollection.createIndex( { "subdocument.$**": 1 } );


0

From comments: mongoS doesn't need much memory/CPU (or even its own machine) and can be located (installed) on the config servers. config servers don't need that much memory, even when mongoS is there; 1-2GB is enough. – JJussi


1

Reference on how shard chunks work: https://docs.mongodb.com/v4.0/core/sharding-data-partitioning/ MongoDB uses the shard key associated to the collection to partition the data into chunks. A chunk consists of a subset of sharded data. Each chunk has a inclusive lower and exclusive upper range based on the shard key. The mongos routes writes to ...


1

Aggregation sorts the documents based on the inputs INPUT_EXPRESSION and SORT_ORDER. The input expression is matched with the customFieldArray's custom_field_id value and the documents are sorted based on the corresponding field_value. var INPUT_EXPRESSION = "fname"; // values can be "fname", "city" or "lname" var SORT_ORDER = 1; // values can be 1 (...


0

It looks like the assertion you are encountering is SERVER-9053: TTL index asserts on 2.4 secondary, which was fixed in 2.4.2. This appears to be a race condition where the TTL monitor thread would incorrectly try to apply TTL deletes on a secondary. The assertion does not appear to be fatal; if it was there should be a "Fatal assertion" logged followed by ...


Top 50 recent answers are included