yum方式
配置.repo
- 创建 /etc/yum.repos.d/mongodb-org-3.4.repo
1
2
3
4
5
6
| [mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
|
安装install
1
| $ yum install -y mongodb-org
|
运行
1
| $ systemctl start mongod.service
|
停止
1
| $ systemctl stop mongod.service
|
设置开机启动
1
| $ systemctl enable mongod.service
|
关闭开机启动
1
| $ systemctl disable mongod.service
|
重启
1
| $ systemctl restart mongod.service
|
删除包
1
| yum erase $(rpm -qa | grep mongodb-org)
|
清理文件
1
2
| sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongo
|
检测后台进程是否存在
检测27017端口是否在监听
1
| $ netstat -lntp | grep 27017
|
第三方GUI客户端
Mongoclient
http://www.mongoclient.com/
https://github.com/rsercano/mongoclient
Robomongo
https://robomongo.org/
MongoChef
http://3t.io/mongochef/
我的博客