安装mongodb
2020-07-15 04:54
295 查看
一。安装
1. 下载编译好的二进制
[root@VM_14_49_centos mongodb_01]# wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.6.0.tgz --2017-12-17 11:24:01-- https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.6.0.tgz Resolving fastdl.mongodb.org... 52.222.211.118, 52.222.211.146, 52.222.211.226, ...
2. 解压缩
[root@VM_14_49_centos mongodb_01]# ls mongodb-linux-x86_64-rhel62-3.6.0.tgz [root@VM_14_49_centos mongodb_01]# tar -xvf mongodb-linux-x86_64-rhel62-3.6.0.tgz mongodb-linux-x86_64-rhel62-3.6.0/README mongodb-linux-x86_64-rhel62-3.6.0/THIRD-PARTY-NOTICES mongodb-linux-x86_64-rhel62-3.6.0/MPL-2 mongodb-linux-x86_64-rhel62-3.6.0/GNU-AGPL-3.0
3. 配置环境
[root@VM_14_49_centos mongodb_01]# ls mongodb-linux-x86_64-rhel62-3.6.0 mongodb-linux-x86_64-rhel62-3.6.0.tgz [root@VM_14_49_centos mongodb_01]# cd mongodb-linux-x86_64-rhel62-3.6.0 [root@VM_14_49_centos mongodb-linux-x86_64-rhel62-3.6.0]# ls bin GNU-AGPL-3.0 MPL-2 README THIRD-PARTY-NOTICES [root@VM_14_49_centos mongodb-linux-x86_64-rhel62-3.6.0]# $PATH -bash: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin: No such file or directory [root@VM_14_49_centos mongodb-linux-x86_64-rhel62-3.6.0]# cp ./bin/* /usr/local/bin [root@VM_14_49_centos mongodb-linux-x86_64-rhel62-3.6.0]#
4. 查看权限
[root@VM_14_49_centos mongodb-linux-x86_64-rhel62-3.6.0]# ls -ahl /usr/local/bin total 278M drwxr-xr-x. 2 root root 4.0K Dec 17 11:40 . drwxr-xr-x. 13 root root 4.0K Dec 3 10:58 .. -rwxr-xr-x 1 root root 10M Dec 17 11:40 bsondump -rwxr-xr-x 1 root root 5.2K Dec 17 11:40 install_compass -rwxr-xr-x 1 root root 33M Dec 17 11:40 mongo -rwxr-xr-x 1 root root 57M Dec 17 11:40 mongod -rwxr-xr-x 1 root root 13M Dec 17 11:40 mongodump -rwxr-xr-x 1 root root 11M Dec 17 11:40 mongoexport -rwxr-xr-x 1 root root 11M Dec 17 11:40 mongofiles -rwxr-xr-x 1 root root 11M Dec 17 11:40 mongoimport -rwxr-xr-x 1 root root 56M Dec 17 11:40 mongoperf -rwxr-xr-x 1 root root 14M Dec 17 11:40 mongoreplay -rwxr-xr-x 1 root root 14M Dec 17 11:40 mongorestore -rwxr-xr-x 1 root root 33M Dec 17 11:40 mongos -rwxr-xr-x 1 root root 11M Dec 17 11:40 mongostat -rwxr-xr-x 1 root root 11M Dec 17 11:40 mongotop [root@VM_14_49_centos mongodb-linux-x86_64-rhel62-3.6.0]#
5. 配置conf文件
[root@VM_14_49_centos ~]# mkdir DB [root@VM_14_49_centos ~]# cd DB/ [root@VM_14_49_centos DB]# mkdir mongodb [root@VM_14_49_centos DB]# cd mongodb/ [root@VM_14_49_centos mongodb]# mkdir conf [root@VM_14_49_centos mongodb]# mkdir data [root@VM_14_49_centos mongodb]# mkdir log [root@VM_14_49_centos mongodb]# vim conf/mongod.conf [root@VM_14_49_centos mongodb]# cat conf/mongod.conf port = 12345 dbpath = /root/DB/mongodb/data logpath = /root/DB/mongodb/log/mongod.log fork = true logappend = true bind_ip = 127.0.0.1 [root@VM_14_49_centos mongodb]#
6. 启动mongodb
[root@VM_14_49_centos mongodb]# mongod -f conf/mongod.conf about to fork child process, waiting until server is ready for connections. forked process: 27999 child process started successfully, parent exiting [root@VM_14_49_centos mongodb]#
7. 登录
[root@VM_14_49_centos mongodb]# mongo 127.0.0.1:12345/myTest MongoDB shell version v3.6.0 connecting to: mongodb://127.0.0.1:12345/myTest MongoDB server version: 3.6.0 Welcome to the MongoDB shell.
8. 查看数据库
> show dbs admin 0.000GB local 0.000GB >
转载于:https://www.cnblogs.com/GH-123/p/8051679.html
相关文章推荐
- nginx、php-fpm安装mongodb及驱动扩展
- MongoDB安装及将MongoDB服务器作为windows服务运行
- mongodb 安装配置管理-- 网络摘抄
- MongoDB的安装和命令介绍
- mongodb win32 安装步骤 及java 简单操作
- MongoDB学习笔记(一) MongoDB介绍及安装
- MongoDB的安装与配置
- MAC 安装MongoDB后,启动数据库服务报错
- MongoDB 安装 4.0.6版本 windows服务无法启动(报错1053)
- linux,centous 安装 mongodb
- MongoDB介绍及安装--OK
- 如何在Linux下手动安装mongodb
- Linux中mongodb安装和导出为json
- CentOS 7 yum方式快速安装MongoDB
- Windows下MongoDB安装与配置
- Linux_Ubuntu_安装mongoDB
- mac下安装和配置mongodb的步骤详解
- CentOS-6安装使用mongodb
- Centos7安装mongodb出现的问题:服务无法启动
- window下 c++访问mongodb之安装驱动