mongoDB绑定多个IP无法启动

 swaimprichett_556 发布于 2022-10-25 18:01

配置文件如下:

# 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 interfaces
net:
  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.7
2015-12-11T14:51:43.451+0800 I CONTROL  [initandlisten] git version: 6ce7cbe8c6b899552dadd907604559806aa2e9bd
2015-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_49
2015-12-11T14:51:43.451+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2015-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 exiting
2015-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.sock
2015-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] removeJournalFiles
2015-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 stopped
2015-12-11T14:51:43.635+0800 I JOURNAL  [durability] Durability thread stopped
2015-12-11T14:51:43.635+0800 I STORAGE  [initandlisten] shutdown: closing all files...
2015-12-11T14:51:43.637+0800 I STORAGE  [initandlisten] closeAllFiles() finished
2015-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] 就对了

    2022-10-26 23:36 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有