错误原因:
集群服务器修改过一次IP,但是对应的/etc/hosts文件没有修改
错误日志
cat /var/log/mongdb/mongd.log
2019-01-16T09:50:44.675+0800 E STORAGE [initandlisten] Failed to set up listener: SocketException: Cannot assign requested address
2019-01-16T09:50:44.675+0800 I CONTROL [initandlisten] now exiting
2019-01-16T09:50:44.675+0800 I CONTROL [initandlisten] shutting down with code:48
问题原因:配置文件mongod.conf中bindip填写有误
应该填写私有ip地址,而不是公网ip地址
解决办法:
修改/etc/hosts
原文地址:https://www.cnblogs.com/xibuhaohao/p/12303057.html
时间: 2024-11-08 18:59:29