How to fix MongoDB Fatal Assertion 28595 error? - linux

I'm trying to get mongo server up and running in a docker container but getting error:
2020-07-29T21:15:58.518-0500 I CONTROL [main] ***** SERVER RESTARTED *****
2020-07-29T21:15:58.621-0500 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-07-29T21:15:58.681-0500 W ASIO [main] No TransportLayer configured during NetworkInterface startup
2020-07-29T21:15:58.684-0500 I CONTROL [initandlisten] MongoDB starting : pid=747 port=27017 dbpath=/app/database 64-bit host=610312a6720b
2020-07-29T21:15:58.686-0500 I CONTROL [initandlisten] db version v4.2.8
2020-07-29T21:15:58.687-0500 I CONTROL [initandlisten] git version: 43d25964249164d76d5e04dd6cf38f6111e21f5f
2020-07-29T21:15:58.689-0500 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
2020-07-29T21:15:58.690-0500 I CONTROL [initandlisten] allocator: tcmalloc
2020-07-29T21:15:58.692-0500 I CONTROL [initandlisten] modules: none
2020-07-29T21:15:58.693-0500 I CONTROL [initandlisten] build environment:
2020-07-29T21:15:58.694-0500 I CONTROL [initandlisten] distmod: ubuntu1804
2020-07-29T21:15:58.696-0500 I CONTROL [initandlisten] distarch: x86_64
2020-07-29T21:15:58.697-0500 I CONTROL [initandlisten] target_arch: x86_64
2020-07-29T21:15:58.698-0500 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "0.0.0.0", port: 27017 }, processManagement: { timeZoneInfo: "/usr/share/zoneinfo" }, storage: { dbPath: "/app/database", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/app/database/log/mongodb/mongod.log" } }
2020-07-29T21:15:58.711-0500 I STORAGE [initandlisten] Detected data files in /app/database created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2020-07-29T21:15:58.715-0500 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=483M,cache_overflow=(file_max=0M),session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
2020-07-29T21:15:59.442-0500 E STORAGE [initandlisten] WiredTiger error (1) [1596075359:442302][747:0x7faa34ed4b00], file:WiredTiger.wt, connection: __posix_open_file, 667: /app/database/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1596075359:442302][747:0x7faa34ed4b00], file:WiredTiger.wt, connection: __posix_open_file, 667: /app/database/WiredTiger.wt: handle-open: open: Operation not permitted
2020-07-29T21:15:59.475-0500 E STORAGE [initandlisten] WiredTiger error (1) [1596075359:475036][747:0x7faa34ed4b00], file:WiredTiger.wt, connection: __posix_open_file, 667: /app/database/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1596075359:475036][747:0x7faa34ed4b00], file:WiredTiger.wt, connection: __posix_open_file, 667: /app/database/WiredTiger.wt: handle-open: open: Operation not permitted
2020-07-29T21:15:59.504-0500 E STORAGE [initandlisten] WiredTiger error (1) [1596075359:504949][747:0x7faa34ed4b00], file:WiredTiger.wt, connection: __posix_open_file, 667: /app/database/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1596075359:504949][747:0x7faa34ed4b00], file:WiredTiger.wt, connection: __posix_open_file, 667: /app/database/WiredTiger.wt: handle-open: open: Operation not permitted
2020-07-29T21:15:59.533-0500 E STORAGE [initandlisten] WiredTiger error (1) [1596075359:533624][747:0x7faa34ed4b00], file:WiredTiger.wt, connection: __posix_open_file, 667: /app/database/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1596075359:533624][747:0x7faa34ed4b00], file:WiredTiger.wt, connection: __posix_open_file, 667: /app/database/WiredTiger.wt: handle-open: open: Operation not permitted
2020-07-29T21:15:59.538-0500 W STORAGE [initandlisten] Failed to start up WiredTiger under any compatibility version.
2020-07-29T21:15:59.539-0500 F STORAGE [initandlisten] Reason: 1: Operation not permitted
2020-07-29T21:15:59.540-0500 F - [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 915
2020-07-29T21:15:59.540-0500 F - [initandlisten]
Running the following command starts the server fine and is accessible outside docker container:
mongod --dbpath /app/database
but when following command is ran Mongo logs the above mentioned error log into the log file
service mongodb start
or
sudo service mongodb start
Not sure why this issue is causing. Kindly help. Thank you.

Related

Why do I get "0 - Unknown Error [object ProgressEvent]" errors?

I have downloaded this file of the repository(https://github.com/zeeshan87/Server-side-Development-with-NodeJS-Express-and-MongoDB/tree/master/Final%20Integrating%20Client%20and%20Server) that is an Angular project combined with NodeJS server for backend part, and tried to run the integrated version of the project. in the Angular part it seems it works fine, but I don't know how exactly run the node server part?
I tried to create a file named data inside ..\Final Integrating Client and Server\conFusionServer folder, then ran mongod --dbpath=data --bind_ip 127.0.0.1 and it seems it works also fine with the following result:
2020-02-03T21:08:28.069+0330 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-02-03T21:08:28.074+0330 I CONTROL [initandlisten] MongoDB starting : pid=8660 port=27017 dbpath=data 64-bit host=DESKTOP-UQ8B9FK
2020-02-03T21:08:28.074+0330 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2020-02-03T21:08:28.074+0330 I CONTROL [initandlisten] db version v4.0.10
2020-02-03T21:08:28.075+0330 I CONTROL [initandlisten] git version: c389e7f69f637f7a1ac3cc9fae843b635f20b766
2020-02-03T21:08:28.075+0330 I CONTROL [initandlisten] allocator: tcmalloc
2020-02-03T21:08:28.075+0330 I CONTROL [initandlisten] modules: none
2020-02-03T21:08:28.075+0330 I CONTROL [initandlisten] build environment:
2020-02-03T21:08:28.075+0330 I CONTROL [initandlisten] distmod: 2008plus-ssl
2020-02-03T21:08:28.075+0330 I CONTROL [initandlisten] distarch: x86_64
2020-02-03T21:08:28.076+0330 I CONTROL [initandlisten] target_arch: x86_64
2020-02-03T21:08:28.076+0330 I CONTROL [initandlisten] options: { net: { bindIp: "127.0.0.1" }, storage: { dbPath: "data" } }
2020-02-03T21:08:28.079+0330 I STORAGE [initandlisten] Detected data files in data created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2020-02-03T21:08:28.079+0330 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7627M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2020-02-03T21:08:28.369+0330 I STORAGE [initandlisten] WiredTiger message [1580751508:368748][8660:140711408328272], txn-recover: Main recovery loop: starting at 5/6528 to 6/256
2020-02-03T21:08:28.491+0330 I STORAGE [initandlisten] WiredTiger message [1580751508:490742][8660:140711408328272], txn-recover: Recovering log 5 through 6
2020-02-03T21:08:28.594+0330 I STORAGE [initandlisten] WiredTiger message [1580751508:593742][8660:140711408328272], txn-recover: Recovering log 6 through 6
2020-02-03T21:08:28.653+0330 I STORAGE [initandlisten] WiredTiger message [1580751508:652710][8660:140711408328272], txn-recover: Set global recovery timestamp: 0
2020-02-03T21:08:28.923+0330 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2020-02-03T21:08:29.057+0330 I CONTROL [initandlisten]
2020-02-03T21:08:29.057+0330 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-02-03T21:08:29.060+0330 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2020-02-03T21:08:29.061+0330 I CONTROL [initandlisten]
2020-02-03T21:08:29.459+0330 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'data/diagnostic.data'
2020-02-03T21:08:29.463+0330 I NETWORK [initandlisten] waiting for connections on port 27017
But when I go to http://localhost:4200 to see the project, I get 0 - Unknown Error [object ProgressEvent] errors when loading the page elements!
It seems the connection between Angular and Node.JS isn't established but how can I fix it?

MongoDB Doesn't Run

I just installed mongoDB with AUR in arch and tried to run it just like;
mongod
but it always says;
2019-05-11T17:07:09.608+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] MongoDB starting : pid=27076 port=27017 dbpath=/data/db 64-bit host=manjaro
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] db version v4.0.9
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] git version: fc525e2d9b0e4bceff5c2201457e564362909765
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1b 26 Feb 2019
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] allocator: tcmalloc
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] modules: none
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] build environment:
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] distmod: ubuntu1804
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] distarch: x86_64
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] target_arch: x86_64
2019-05-11T17:07:09.611+0000 I CONTROL [initandlisten] options: { storage: { dbPath: "/data/db", mmapv1: { smallFiles: true } } }
2019-05-11T17:07:09.611+0000 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2019-05-11T17:07:09.612+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2019-05-11T17:07:09.612+0000 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-05-11T17:07:09.612+0000 I CONTROL [initandlisten] now exiting
2019-05-11T17:07:09.612+0000 I CONTROL [initandlisten] shutting down with code:100
What should I do?
2019-05-11T17:07:09.611+0000 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
You're missing a path to it's db directory. Create one in your root folder using:
sudo mkdir /data/db
sudo recommended here, sometimes mongoDB can run in to permission issues otherwise.

Code 14 when Dockerizing Web App Using node.js and MongoDB

I am trying to Dockerize a web app I built using node.js and MongoDB, but when I run
docker-compose up
I am getting the following error:
$ docker-compose up
Creating network "nodeapp1_default" with the default driver Creating
mongo ... done Creating app ... done Attaching to mongo, app mongo
| 2019-02-05T15:02:34.925+0000 I CONTROL [main] Automatically
disabling TLS 1.0, to force-enable TLS 1.0 specify
--sslDisabledProtocols 'none' mongo | 2019-02-05T15:02:34.934+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017
dbpath=/data/db 64-bit host=e4fb5b7aa837 mongo |
2019-02-05T15:02:34.934+0000 I CONTROL [initandlisten] db version
v4.0.5 mongo | 2019-02-05T15:02:34.935+0000 I CONTROL
[initandlisten] git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
mongo | 2019-02-05T15:02:34.935+0000 I CONTROL [initandlisten]
OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016 mongo |
2019-02-05T15:02:34.935+0000 I CONTROL [initandlisten] allocator:
tcmalloc mongo | 2019-02-05T15:02:34.936+0000 I CONTROL
[initandlisten] modules: none mongo | 2019-02-05T15:02:34.936+0000
I CONTROL [initandlisten] build environment: mongo |
2019-02-05T15:02:34.936+0000 I CONTROL [initandlisten] distmod:
ubuntu1604 mongo | 2019-02-05T15:02:34.937+0000 I CONTROL
[initandlisten] distarch: x86_64 mongo |
2019-02-05T15:02:34.937+0000 I CONTROL [initandlisten]
target_arch: x86_64 mongo | 2019-02-05T15:02:34.937+0000 I CONTROL
[initandlisten] options: { net: { bindIpAll: true } } mongo |
2019-02-05T15:02:34.941+0000 I STORAGE [initandlisten]
wiredtiger_open config:
create,cache_size=256M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
mongo | 2019-02-05T15:02:36.060+0000 E STORAGE [initandlisten]
WiredTiger error (17) [1549378956:60130][1:0x7f0c375e0a40],
connection: __posix_open_file, 715: /data/db/WiredTiger.wt:
handle-open: open: File exists Raw:
[1549378956:60130][1:0x7f0c375e0a40], connection: __posix_open_file,
715: /data/db/WiredTiger.wt: handle-open: open: File exists mongo |
2019-02-05T15:02:36.066+0000 E STORAGE [initandlisten] WiredTiger
error (26) [1549378956:66441][1:0x7f0c375e0a40], connection:
__posix_fs_rename, 253: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename: rename: Text file busy Raw:
[1549378956:66441][1:0x7f0c375e0a40], connection: __posix_fs_rename,
253: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename:
rename: Text file busy mongo | 2019-02-05T15:02:36.077+0000 E
STORAGE [initandlisten] WiredTiger error (17)
[1549378956:77316][1:0x7f0c375e0a40], connection: __posix_open_file,
715: /data/db/WiredTiger.wt: handle-open: open: File exists Raw:
[1549378956:77316][1:0x7f0c375e0a40], connection: __posix_open_file,
715: /data/db/WiredTiger.wt: handle-open: open: File exists mongo |
2019-02-05T15:02:36.078+0000 E STORAGE [initandlisten] WiredTiger
error (26) [1549378956:78533][1:0x7f0c375e0a40], connection:
__posix_fs_rename, 253: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename: rename: Text file busy Raw:
[1549378956:78533][1:0x7f0c375e0a40], connection: __posix_fs_rename,
253: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename:
rename: Text file busy mongo | 2019-02-05T15:02:36.090+0000 E
STORAGE [initandlisten] WiredTiger error (17)
[1549378956:90882][1:0x7f0c375e0a40], connection: __posix_open_file,
715: /data/db/WiredTiger.wt: handle-open: open: File exists Raw:
[1549378956:90882][1:0x7f0c375e0a40], connection: __posix_open_file,
715: /data/db/WiredTiger.wt: handle-open: open: File exists mongo |
2019-02-05T15:02:36.092+0000 E STORAGE [initandlisten] WiredTiger
error (26) [1549378956:92202][1:0x7f0c375e0a40], connection:
__posix_fs_rename, 253: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename: rename: Text file busy Raw:
[1549378956:92202][1:0x7f0c375e0a40], connection: __posix_fs_rename,
253: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename:
rename: Text file busy mongo | 2019-02-05T15:02:36.094+0000 W
STORAGE [initandlisten] Failed to start up WiredTiger under any
compatibility version. mongo | 2019-02-05T15:02:36.094+0000 F
STORAGE [initandlisten] Reason: 26: Text file busy mongo |
2019-02-05T15:02:36.094+0000 F - [initandlisten] Fatal
Assertion 28595 at
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 638 mongo
| 2019-02-05T15:02:36.094+0000 F - [initandlisten] mongo |
mongo | ***aborting after fassert() failure mongo | mongo |
mongo exited with code 14
Here is my Dockerfile:
FROM node:8
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000 CMD [ "npm", "start" ]
and my docker-compose.yml file:
version: "2" services: app:
container_name: app
restart: always
build: .
ports:
- "3000:3000"
links:
- mongo mongo:
container_name: mongo
image: mongo
volumes:
- ./data:/data/db
ports:
- "27017:27017"
The problem seems to be coming from some file called WhiteTiger.wt. I have tried erasing this file from the data directory of my project directory but that did not work. Has anyone come across this problem before?
Thank you
I am assuming you are running Docker on Windows, and if so, I experienced the same issue and found the answer in the below post:
Windows Docker mongo container doesn't work with volume mount
The problem is that the volume mount is specified as a host volume. I resolved my issue by changing my volume mount to be a named volume. If you need to use host, you might be able to use the rsync tool specified in the answer to the question I linked.
My docker-compose.yml file
version: '3'
services:
mongodb1:
image: mongo:latest
restart: always
volumes:
- data1:/data/db
- config1:/data/configdb
ports:
- 30001:27017
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
volumes:
data1:
config1:

Can't connect to mongodb on remote but can on local

I'm trying to connect my node.js server (on ec2 instance) to my mongodb server (on ec2 instance but not the same). All works fine, i can connect to my mongodb with mongo on local but my node.js can't. Event if i try to type this command :
mongo <ec2-instance>/<dbname> -u <username> -p <password> --authenticationDatabase <dbname>
i get this error :
E QUERY [thread1] Error: couldn't connect to server
:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:237:13 #(connect):1:6 exception:
connect failed
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] MongoDB starting : pid=2888 port=27017 dbpath=/data/db 64-bit host=ip-172-31-23-145
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] db version v3.4.9
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.0-fips 29 Mar 2010
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] allocator: tcmalloc
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] modules: none
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] build environment:
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] distmod: amazon
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] distarch: x86_64
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] target_arch: x86_64
2018-02-15T10:37:08.017+0000 I CONTROL [initandlisten] options: {}
2018-02-15T10:37:08.017+0000 W - [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.
2018-02-15T10:37:08.042+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-02-15T10:37:08.042+0000 W STORAGE [initandlisten] Recovering data from the last clean checkpoint.
2018-02-15T10:37:08.042+0000 I STORAGE [initandlisten]
2018-02-15T10:37:08.042+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-02-15T10:37:08.042+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2018-02-15T10:37:08.042+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3480M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2018-02-15T10:37:08.065+0000 E STORAGE [initandlisten] WiredTiger error (1) [1518691028:65354][2888:0x7f4adae46e00], file:collection-2--1305918998266443804.wt, WT_SESSION.open_cursor: /data/db/collection-2--1305918998266443804.wt: handle-open: open: Operation not permitted
2018-02-15T10:37:08.065+0000 I - [initandlisten] Invariant failure: ret resulted in status UnknownError: 1: Operation not permitted at src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp 95
2018-02-15T10:37:08.065+0000 I - [initandlisten]
***aborting after invariant() failure
2018-02-15T10:37:08.076+0000 F - [initandlisten] Got signal: 6 (Aborted).
Here is what i got when i try to start mongod on my instance..

Cannot use mongoimport on vagrant

Following is my mongo.conf:
# mongod.conf
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
net:
port: 27017
# bindIp: 127.0.0.1
replication:
replSetName: rs0
oplogSizeMB: 250
I tried to import the data given here on the guest linux using
wget https://raw.githubusercontent.com/mongodb/docs-assets/primer-dataset/dataset.json
mongoimport --host=127.0.0.1 --port=27017 --db test --collection dataset --file dataset.json
and also tried on the host machine (mac):
mongoimport --host=127.0.0.1 --port=27071 --db test --collection dataset --file dataset.json
In both the cases I get the following output:
2016-02-25T11:01:56.280-0500 connected to: 127.0.0.1:27071
2016-02-25T11:01:59.278-0500 [........................] test.dataset 0.0 B/11.3 MB (0.0%)
2016-02-25T11:01:59.309-0500 [........................] test.dataset 0.0 B/11.3 MB (0.0%)
2016-02-25T11:01:59.309-0500 Failed: error checking connected node type: no reachable servers
2016-02-25T11:01:59.309-0500 imported 0 documents
All the requests that I make to port 27071 on the host system are forwarded to post 27017 on the linux guest. There are no connections issues as curl localhost:27071 gives It looks like you are trying to access MongoDB over HTTP on the native driver port.
UPDATE:
Following is the log of mongo:
2016-02-25T18:33:23.938+0000 I CONTROL ***** SERVER RESTARTED *****
2016-02-25T18:33:23.941+0000 I CONTROL [initandlisten] MongoDB starting : pid=4810 port=27017 dbpath=/var/lib/mongodb 64-bit host=vagrant-ubuntu-trusty-64
2016-02-25T18:33:23.941+0000 I CONTROL [initandlisten] db version v3.0.9
2016-02-25T18:33:23.941+0000 I CONTROL [initandlisten] git version: 20d60d3491908f1ae252fe452300de3978a040c7
2016-02-25T18:33:23.941+0000 I CONTROL [initandlisten] build info: Linux ip-10-732-9-221 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2016-02-25T18:33:23.941+0000 I CONTROL [initandlisten] allocator: tcmalloc
2016-02-25T18:33:23.941+0000 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "0.0.0.0", port: 27017 }, replication: { oplogSizeMB: 250, replSetName: "rs0" }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2016-02-25T18:33:23.969+0000 I JOURNAL [initandlisten] journal dir=/var/lib/mongodb/journal
2016-02-25T18:33:23.969+0000 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2016-02-25T18:33:24.006+0000 I JOURNAL [durability] Durability thread started
2016-02-25T18:33:24.006+0000 I JOURNAL [journal writer] Journal writer thread started
2016-02-25T18:33:24.007+0000 I CONTROL [initandlisten]
2016-02-25T18:33:24.007+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-02-25T18:33:24.007+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-02-25T18:33:24.007+0000 I CONTROL [initandlisten]
2016-02-25T18:33:24.007+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-02-25T18:33:24.007+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-02-25T18:33:24.007+0000 I CONTROL [initandlisten]
2016-02-25T18:33:24.010+0000 I REPL [initandlisten] Did not find local replica set configuration document at startup; NoMatchingDocument Did not find replica set configuration document in local.system.replset
2016-02-25T18:33:24.011+0000 I NETWORK [initandlisten] waiting for connections on port 27017
If I try to do mongoimport --host=0.0.0.0 --port=27071 --db test --collection dataset --file dataset.json from the host system, following is added to the log:
2016-02-25T18:36:03.443+0000 I NETWORK [initandlisten] connection accepted from 10.0.2.2:51277 #1 (1 connection now open)
2016-02-25T18:36:06.479+0000 I NETWORK [conn1] end connection 10.0.2.2:51277 (0 connections now open)
and when I try this same command from the guest linux, I get:
2016-02-25T18:38:29.982+0000 I NETWORK [initandlisten] connection accepted from 127.0.0.1:59910 #2 (1 connection now open)
2016-02-25T18:38:32.994+0000 I NETWORK [conn2] end connection 127.0.0.1:59910 (0 connections now open)
Try to chance your bindIp param to 0.0.0.0, and restart the service.

Resources