MongoDB 3.4配置远程访问 为什么无法启动?
日志文件:
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] MongoDB starting : pid=22117 port=27017 dbpath=/var/lib/mongo 64-bit host=magnetic
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] db version v3.4.0
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] git version: f4240c60f005be757399042dc12f6addbc3170c1
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] allocator: tcmalloc
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] modules: none
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] build environment:
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] distmod: rhel70
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] distarch: x86_64
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] target_arch: x86_64
2016-12-08T22:11:20.459-0500 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1,10.254.4.21,124.247.221.248", port: 27017 }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, security: { authorization: "enabled" }, storage: { dbPath: "/var/lib/mongo", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2016-12-08T22:11:20.486-0500 E NETWORK [initandlisten] listen(): bind() failed Cannot assign requested address for socket: 10.254.4.21:27017
2016-12-08T22:11:20.486-0500 E NETWORK [initandlisten] Failed to set up sockets during startup.
2016-12-08T22:11:20.486-0500 E STORAGE [initandlisten] Failed to set up listener: InternalError: Failed to set up sockets
2016-12-08T22:11:20.486-0500 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2016-12-08T22:11:20.486-0500 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2016-12-08T22:11:20.486-0500 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2016-12-08T22:11:20.487-0500 I CONTROL [initandlisten] now exiting
2016-12-08T22:11:20.487-0500 I CONTROL [initandlisten] shutting down with code:48\n```
** 启动代码:**
/usr/bin/mongod -f /etc/mongod.conf --auth
about to fork child process, waiting until server is ready for connections.
forked process: 22110
ERROR: child process failed, exited with error number 48
5 回复
48
@jiangzhuo 什么意思?
@NOOZN 错误信息很清楚 48 找不到10.254.4.21:27017 可能在用或者什么其他原因,你都贴出错误信息,就不自己看看的
@jiangzhuo 新手理解错误了 bindIp表示外网可以通过这个ip来访问吗? 而不是只有这个外网ip可以访问数据…
@jiangzhuo 是的