问题描述
配置文件如下:
# mongod.conf# for documentation of all options, see:# http://docs.mongodb.org/manual/reference/configuration-options/# Where and how to store data.storage: dbPath: /var/lib/mongodb journal: enabled: true# engine:# mmapv1:# wiredTiger:# where to write logging data.systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log# network interfacesnet: port: 27017 bindIp: 127.0.0.1,116.xxx.xxx.xxx#processManagement:#security:#operationProfiling:#replication:#sharding:## Enterprise-Only Options:#auditLog:#snmp:
启动后的错误日志如下:
2015-12-11T14:51:43.451+0800 I CONTROL [initandlisten] db version v3.0.72015-12-11T14:51:43.451+0800 I CONTROL [initandlisten] git version: 6ce7cbe8c6b899552dadd907604559806aa2e9bd2015-12-11T14:51:43.451+0800 I CONTROL [initandlisten] build info: Linux ip-10-229-88-125 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_492015-12-11T14:51:43.451+0800 I CONTROL [initandlisten] allocator: tcmalloc2015-12-11T14:51:43.451+0800 I CONTROL [initandlisten] options: { config: '/etc/mongod.conf', net: { bindIp: '127.0.0.1,116.xxx.xxx.xxx', port: 27017 }, processManagement: { fork: true }, security: { authorization: 'enabled' }, storage: { dbPath: '/var/lib/mongodb', journal: { enabled: true } }, systemLog: { destination: 'file', logAppend: true, path: '/var/log/mongodb/mongod.log' } }2015-12-11T14:51:43.532+0800 I CONTROL [initandlisten] now exiting2015-12-11T14:51:43.532+0800 I NETWORK [initandlisten] shutdown: going to close listening sockets...2015-12-11T14:51:43.532+0800 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock2015-12-11T14:51:43.532+0800 I NETWORK [initandlisten] shutdown: going to flush diaglog...2015-12-11T14:51:43.532+0800 I NETWORK [initandlisten] shutdown: going to close sockets...2015-12-11T14:51:43.532+0800 I STORAGE [initandlisten] shutdown: waiting for fs preallocator...2015-12-11T14:51:43.532+0800 I STORAGE [initandlisten] shutdown: final commit...2015-12-11T14:51:43.534+0800 I JOURNAL [initandlisten] journalCleanup...2015-12-11T14:51:43.534+0800 I JOURNAL [initandlisten] removeJournalFiles2015-12-11T14:51:43.534+0800 I JOURNAL [initandlisten] Terminating durability thread ...2015-12-11T14:51:43.634+0800 I JOURNAL [journal writer] Journal writer thread stopped2015-12-11T14:51:43.635+0800 I JOURNAL [durability] Durability thread stopped2015-12-11T14:51:43.635+0800 I STORAGE [initandlisten] shutdown: closing all files...2015-12-11T14:51:43.637+0800 I STORAGE [initandlisten] closeAllFiles() finished2015-12-11T14:51:43.637+0800 I STORAGE [initandlisten] shutdown: removing fs lock...2015-12-11T14:51:43.637+0800 I CONTROL [initandlisten] dbexit: rc: 48
求大师指点。
问题解答
回答1:挖个坟。今天我也遇到这个问题了,真坑!网上的博客都是错的,复制粘贴人云亦云。摸索着改了几次,改成: bindIp: [127.0.0.1, 116.xxx.xxx.xxx] 就对了

