Tag Info

New answers tagged

0

You have 5 servers serv1,serv2,serv3,serv4,serv5 and you want to set up 5 instanses inst1,inst2,inst3,inst4,inst5. Each instance should have at least 2 data nodes (PRIMARY and SECONDARY) and 1 ARBITER serv1: inst1_PRI, inst5_SEC, inst4_ARB serv2: inst2_PRI, inst1_SEC, inst5_ARB serv3: inst3_PRI, inst2_SEC, inst1_ARB serv4: inst4_PRI, inst3_SEC, inst2_ARB ...


1

Number of collection is equal 2: The 2 collections are the system.indexes system.users. Execute the "show collections" command under your database to confirm. Filesize: MongoDB allocates "physical files" or files on disk per database. For example eventsdb.0, eventsdb.1 ... Collections are stored with a distributed way within these files. Dropping a ...


0

Updating to the latest mongo php driver, 1.6.6 fixed it. sudo pecl upgrade mongo


2

MySQL can handle at least some aspects of such. At 15TB, disk I/O is the number one problem! Both on INSERT and SELECT. Indexes are BTree structured. This gives "close to instantaneous" fetching of one row, given the index. It also gives rapid scanning in the BTree order, forward or backward. You can have multiple unrelated indexes, but it is ...


0

Elasticsearch is nice to use, any solution will have unneeded features. But why not this for a persistent key value storage solution http://rocksdb.org/


1

For your use case of key-value data, where the value is simple, MongoDB is more than you need. It is a document-oriented data store for complex value types. A specific key-value store would suit your needs. RIAK is the one I've looked at though several others exist. Since your retrieval will be by time range i.e. key range, Elastic's full-text ...


0

You can only use a single storage engine type per mongod instance. There is only a single dbPath setting for a mongod deployment, and you cannot mix & match data files from different storage engines within the same data path. However, you can use different storage engine configurations within members of a replica set (for example, mmap primary and ...


0

The mongoimport tool is only intended for importing simple data in text formats (JSON, CSV, TSV). To backup and restore a full database (including index definitions & collection options) typical approaches are to use either: Filesystem snapshots mongodump / mongorestore The MongoDB manual has a section on Backup and Recovery describing supported ...


0

At the moment for security issues I just changed auth true in the mongod.conf, created a new user for my test DB and changed the port to be something different than 27017. First question: There is something else to do to enhance security? The MongoDB documentation has a Security Checklist and information on best practices. Aside from enabling ...


0

If you follow the upgrade process it is designed to avoid downtime -- for example using rs.stepDown() to gracefully step down the replica set primaries rather than abruptly triggering an election by shutting down the server. Of course there is no guarantee if something doesn't go to plan, but you should test your upgrade in a QA/staging environment before ...


0

As noted in the install page, the MongoDB distribution is comprised of several packages: mongodb-org: This package is a metapackage that will automatically install the four component packages listed below. mongodb-org-server: This package contains the mongod daemon and associated configuration and init scripts. mongodb-org-mongos: This package contains the ...


1

My field avgObjSize was around 6442 bytes. I chose a random document in my collection, I typed : Object.bsonsize(db.collectionName.find({"_id" : ObjectId("5508497c51a990da07b07106")})) And I obtained 810 bytes. Why do I have this huge difference ? The db.collection.find() method returns a cursor, so what you have calculated is the ...


0

Here's typically what I do to get Mongo installed on a brand new Ubuntu install. YMMV: ##Backup current sources list. sudo mv /etc/apt/sources.list /etc/apt/sourcesBackup.list Then open up vi to make a new sources list: sudo vi /etc/apt/sources.list Copy and paste the default sources list (the distro's I use have a custom sources list, so you might ...


0

It doesn't look like MongoDB provides a repo for Saucy: http://repo.mongodb.org/apt/ubuntu/dists/ So if you installed via Ubuntu-provided repository you have a few options: Remove the RPM and install via binaries Upgrade to Trusty Wait for Ubuntu to update its repo.


1

You can verify that no migrations are running by checking the balance with sh.isBalancerRunning() which is true if chunks are being migrated and false if not. Using BalancerState only shows you if it is enabled or disabled, not its current run state. While it depends on what the specific documentation says, I'd probably feel safer setting the balancer ...


0

The REST API (--rest) depends on the HTTP interface (--httpinterface) so the warning here is that the HTTP interface is being enabled for you automatically in order to support REST. Both the REST API and the HTTP interface are strongly discouraged outside of trusted development environments as they are not secure. Starting from MongoDB 2.6, both of these ...


1

It looks like the current MongoDB 3.0 upgrade instructions are missing mention of two important parameters for backing up and restoring users and roles: mongodump --dumpDbUsersAndRoles (see also: Required Access to Backup User Data). mongorestore --restoreDbUsersAndRoles (see also: Required Access to Restore User Data) I can think of several approaches ...


0

First of all when you run mongod as a normal user you need to make sure that the particular user has the following permissions: Access to network interface ( open socket ) in order to be able to listen to connections Access to the database folder. The default is accessible only by root or mongod user (/data/db) Access to logging folder /var/log/mongod ...


1

Upgrade Requirements To upgrade an existing MongoDB deployment to 3.0, you must be running 2.6. If you’re running a version of MongoDB before 2.6, you must upgrade to 2.6 before upgrading to 3.0. See Upgrade MongoDB to 2.6 for the procedure to upgrade from 2.4 to 2.6. Once upgraded to MongoDB 2.6, you cannot downgrade to any version earlier than MongoDB 2.4. ...


1

The normal rules of replica set elections apply. If your shard is backed by a 3-node replica set, then you can have any single node down while still being able to maintain a primary. A strict majority of nodes must be available, so 2/3 in the 3-node example. If the data-bearing server you are planning to restart happens to be a replica set primary, I would ...


1

You can perform a rolling upgrade of your replica set from MongoDB 2.6 to 3.0. While a mixed version 2.6/3.0 replica set is supported for the purposes of upgrading, you should not run with this configuration for longer than is required. You should also read the 3.0 upgrade and compatibility change notes carefully, as important considerations will be ...


2

The current wording in the documented steps may be somewhat confusing given the relative references to first/last/second config servers. I've added some context for the documented steps below, but you should consider the manual the definitive source. It's also worth noting that you do not have to upgrade the config servers to use WiredTiger (even if your ...


2

As part of the MongoDB 3.0 upgrade it is strongly recommended that you upgrade to the SCRAM-SHA-1 authentication scheme. New users will have their credentials created in this format by default; mixed authentication schemas will likely lead to confusion. You will need to upgrade your client driver & admin tools (if you're using a GUI) in order to use the ...


0

tl;dr Your data may be corrupted. An update to 2.6 prior to an update to 3.0 is mandatory. See below for details. The problem You have a problem. Reading the release notes before fiddling with and updating any software is best practise, with MongoDB's release notes being no exception. If you had read them and the linked upgrade guide, you would have ...


0

I solved. The problem was that I did not have the library libsasl2-modules-gssapi-mit. Once I installed everything works fine


1

It will work for conditional $set update operation http://docs.mongodb.org/manual/reference/operator/update/setOnInsert/ db.products.update( { _id: 1 }, { $set: { item: "apple" }, $setOnInsert: { defaultQty: 100 } }, {upsert: true } ) Here setOnInsert will set defaultQty only when a new record is inserted. Both $set and $setOnInsert can ...


1

The solution to this issue was as follows: Starting with the secondary: Inside of Mongo I ran the following: db.shutdownServer() exit On the command line: rm -rf /var/lib/mongodb/* sudo service mongodb start It then takes a couple of hours to resync. Once resynced I did the following on the primary: rs.status() //To make sure that the everything was ...


1

Question 1: The answer here is yes and no. In a replica set if your PRIMARY fails one of your SECONDARIES will take charge. If all CRUD statements have replicated from PRI to SEC when your disk crash then you are fine. But in case that some statements are not (replication lag) and your disk crash you will lose those statements. If you can handle that loss ...


0

Here is what you can do to start Run the following on the old PRIMARY var dt = new Date(db.serverStatus().localTime - db.serverStatus().uptime*1000).toString() ; dt This will print the exact time mongod was started. PRIMARY failover was triggered 2015-03-03T12:18:41.540-0500. If dt is close to 2015-03-03T12:18:41.540-0500 mongod crashed or was ...


0

You need to login and use ADMIN database to perform the operation.


0

What you did is correct as per the procedure and messages found under the mongod log is something expected and will display unless you perform operations with a mongo shell and it should allow you to connect to localhost or any remote server and then to the desired database. Since you had cancelled the running processes with Ctrl-C event, it had been ...


0

You can see network activity in a replicated and or sharded environment despite not sending any requests to the cluster proactively. I also just came across dirty % in mongostat while testing WT. It appears to be the % of in-memory pages.


0

Yes, I had the same issue. I use the db.getSiblingDB('yourdb') command in my scripts to make many calls to various databases. This is documented further at http://docs.mongodb.org/manual/reference/method/db.getSiblingDB/ .


-2

Couchbase does support Master/Master replication, through it's XDCR (Cross Datacenter Replication) function. http://docs.couchbase.com/admin/admin/XDCR/xdcr-intro.html Full disclosure - I work for Couchbase.


1

No, MongoDB does not support two-way synchronization. It has master-slave replication, where all writes must occur on the master node before being replicated to the slave nodes. You can read about all the replication capabilities of MongoDB in their documentation.


0

At present ( meaning as of writing ) there really isn't an actual "official release date" for MongoDB 3.0 or is there "really" an official source for the repository of binary builds for any platform. Results vary for each distribution, but in this case you are probably best following the official documentation links and changing the version in the required ...


2

Since there is already and answer submitted, and a useful and valid one at that, I do not want to distract from it's own usefulness but there are indeed points to raise that go way beyond just a short comment. So consider this "augmentation", which is hopefully valid but primarily in addition to what has already been said. The truth is to really consider ...



Top 50 recent answers are included