source Also make sure that another mongod instance is not already running on the
t is stating that Mongo is already running. If you are certain it is not, then the lock file still exists from a previous unclean shutdown.
ps aux | grep mongo
if that returns nothing, it will mean the lock file still exists. looking at your error, the file is /data/db/mongod.lock
rm /data/db/mongod.lock
Should get rid of it so you'll be able to start the mongo service running again.
允许远程链接
这个实例监听的地址是localhost
,远程服务器无法连接到这个实例上(但是你自己从本机应该可以)。你可以通过bindIp
来修改监听的地址。比如你的服务器地址是192.168.1.10
,那应该在启动时加上--bind_ip "127.0.0.1,192.168.0.10"
,如果你用配置文件的方式,应该修改bindIp
那一段。