mongodb on VMPlayer ubuntu - mongodb

I have installed mongoDB on ubuntu in VMplayer running on windows7.
I have edited the hosts file to have
machinename 192.168.1.12.
I installed all the packages and trying to start the mongod.
This is the error I am getting:
ubuntu:/etc/init.d$ start mongodb start: Rejected send message, 1
matched rules; type="method_call", sender=":1.128" (uid=1000 pid=9669
comm="start mongodb ") interface="com.ubuntu.Upstart0_6.Job"
member="Start" error name="(unset)" requested_reply="0"
destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
Can you please let me know what could be the issue?
I was able to install successfully in a pevious in ubuntu.

That's a permission error, you need to sudo, i.e. run the following and you will be ok -
sudo start mongodb

Related

Failed to start mongod com.Could not find appropriate mongod in `/opt/mongodb/mms/mongodb-releases

I am getting following error when I tried to activate a backup for mongo instance.
I choosed local and copied all rpms to this folder /opt/mongodb/mms/mongodb-releases.
error:
Failed to start mongod
com.xgen.svc.brs.util.GenericMongoManager$MongodVersionException: Could not find appropriate mongod in `/opt/mongodb/mms/mongodb-releases/`, versions available to MMS: . Expecting version 3.4.4 or greater.
com.xgen.svc.brs.util.GenericMongoManager$Purpose.calculateBinaryPath(GenericMongoManager.java:166)
com.xgen.svc.brs.util.GenericMongoManager$Purpose.<init>(GenericMongoManager.java:125)
com.xgen.svc.brs.util.MongoManager$MongoDPurpose.<init>(MongoManager.java:331)
com.xgen.svc.brs.util.MongoManager$HeadPurpose.<init>(MongoManager.java:477)
com.xgen.svc.brs.job.ReplicaSetJob.startMongo(ReplicaSetJob.java:103)
com.xgen.svc.brs.job.ReplicaSetJob.startMongo(ReplicaSetJob.java:80)
com.xgen.svc.brs.job.IncrementalSyncJob.doWork(IncrementalSyncJob.java:82)
com.xgen.svc.brs.grid.Daemon.iterate(Daemon.java:116)
com.xgen.svc.brs.grid.Daemon.run(Daemon.java:305)

Assertion failure _setName.size on URI auth

I tried to much posibilities that I found searching for this error without success.
I can connect to my mongo with the CLI typing mongo --port myPort -u myUser ...
But I need to connect my app (in the same host) by URI.
This is what I get:
mongo mongodb://username:password#localhost:myPort/myDb
MongoDB shell version: 2.6.10
connecting to: mongodb://username:password#localhost:myPort/myDb
2017-05-19T23:34:33.568+0200 Assertion failure _setName.size() src/mongo/client/dbclientinterface.h 231
2017-05-19T23:34:33.569+0200 0x6b75c9 0x659e9f 0x636a32 0x5013b8 0x4fa7f1 0x6006fd 0x5eb869 0x7fdcdff35d76 0x1ebf47506362
mongo(_ZN5mongo15printStackTraceERSo+0x39) [0x6b75c9]
mongo(_ZN5mongo10logContextEPKc+0x21f) [0x659e9f]
mongo(_ZN5mongo12verifyFailedEPKcS1_j+0x142) [0x636a32]
mongo(_ZN5mongo16ConnectionStringC1ENS0_14ConnectionTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_+0x208) [0x5013b8]
mongo(_ZN5mongo16ConnectionString5parseERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERS6_+0x201) [0x4fa7f1]
mongo(_ZN5mongo17mongoConsExternalEPNS_7V8ScopeERKN2v89ArgumentsE+0x11d) [0x6006fd]
mongo(_ZN5mongo7V8Scope10v8CallbackERKN2v89ArgumentsE+0xa9) [0x5eb869]
/usr/lib/libv8.so.3.14.5(+0x99d76) [0x7fdcdff35d76]
[0x1ebf47506362]
2017-05-19T23:34:33.570+0200 Error: assertion src/mongo/client/dbclientinterface.h:231 at src/mongo/shell/mongo.js:148
exception: connect failed
Any idea? :\ Thanks
Solved upgrading mongod from 2.6 to 3.0.15
If you don't want to upgrade to a newer version of MongoDB you can also just drop the mongodb:// from the beginning. For example change:
mongo mongodb://username:password#localhost:myPort/myDb
to:
mongo username:password#localhost:myPort/myDb
Ref: https://jira.mongodb.org/browse/SERVER-15739?focusedCommentId=1000536&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1000536

ERROR: child process failed, exited with error number 51 MongoDB

Getting this error while restarting MongoDB , I am using Mongo 3.2.4 and doing this set up on a new machine
Starting mongod... about to fork child process, waiting until server is ready for connections.
forked process: 19438
ERROR: child process failed, exited with error number 51
mongod(_ZN5mongo19MmapV1ExtentManager4initEPNS_16OperationContextE+0x4A8) [0x1040278]
mongod(_ZN5mongo26MMAPV1DatabaseCatalogEntryC1EPNS_16OperationContextENS_10StringDataES3_bb+0x187) [0x1036dc7]
mongod(_ZN5mongo12MMAPV1Engine23getDatabaseCatalogEntryEPNS_16OperationContextENS_10StringDataE+0x14E) [0x103a1de]
mongod(_ZN5mongo14DatabaseHolder6openDbEPNS_16OperationContextENS_10StringDataEPb+0x133) [0xac92a3]
----- END BACKTRACE -----
For me this error occured due to incorrect ownership of some files in my data directory. I fixed this using the following command:
sudo chown -R mongodb: /path/to/db/directory
Where mongodb was the database user in my case.
This is resolved by inserting the following lines into /etc/security/limits.conf:
mongodb soft nofile 65535
mongodb hard nofile 90000
mongodb soft nproc 65535
mongodb hard nproc 90000
We need to add the user account used to run the Mongo service. Generally, it is the mongodb user.
In my case the problem was that I haven't created the appropriate folders specified in the config files.

Error in connecting to mongodb (mongodb-linux-x86_64-2.8.0-rc5) : auth failed, when starting nodejs appserver

I am new to mongodb, I am able to get my nodejs appserver started with mongodb 2.4 and 2.6. I have a requirement to test the latest mongodb, which is 2.8 with our app. I am able to start the mongodb 2.8 but when I try to start my nodejs appserver, I get following error.
2015-01-16T18:43:51.115Z <warn> globals.js:45 () MONGO URI = mongodb://myuser:password#localhost:27017/test
2015-01-16T18:43:51.178Z <error> globals.js:45 () #### Error in connecting to mongodb
2015-01-16T18:43:51.180Z <error> globals.js:45 () { [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 }
2015-01-16T18:43:51.182Z <error> globals.js:45 () MongoError: auth failed
.........
Also, I have created myuser in the test db and authenticated it successfully. Please help, I have tried all possible ways and with no success. Thank you very much in advance. (my environment is Ubantu Linux 14.04, virtualbox) One more thing that I forgot to mention is that I am using wiredTiger storageEngine. I tried with MMAPv1 as well and same result.
I had the same issue. It worked for me on Mac, but on Linux I hit this failure until I upgraded module mongoose from 3.6.x to 3.8.x (3.8.25). That solved the problem for me. You might consider doing the same, at least to rule out this problem.

Unable to load Mongodb Driver

I have a Nnginx -FPM php server running on Ubuntu.
I am trying to make the MongoDB Driver for PHP work but some how it never shows in my phpinfo() and every time I run a test script i get Fatal error: Class 'Mongo' not found
The actual MongoDB server is not installed in that server given that I will be connecting to another server.
What am I missing that it doesnt work?
I followed this straight forward steps
1) pecl search mongo
Show the latest 1.4.3 (stable) verion
2) sudo pecl install mongo
3) vim /etc/php5/fpm/php.ini
and at the end of the [dba] tag i add
[Mongo]
extension=mongo.so
4)
service nginx restart
service php5-fpm restart
Check to see if you have mongodb.ini in /etc/php5/conf.d/ The contents should look something like:
extension=mongo.so
mongo.auto_reconnect = true
mongo.allow_persistent = On
mongo.max_persistent = -1
mongo.max_connections = -1
;mongo.default_host = www.example.com
mongo.default_port = 42
mongo.chunk_size = 1024
mongo.cmd = "$"