Linux下安装Monogodb-3.2.4
2016-04-07 15:15
543 查看
1.首先下载安装包
在Mongodb官方网站现在最新的tar包。https://www.mongodb.org/downloads
这里下载的是mongodb-linux-x86_64-3.2.4.tgz
2.传送到服务器上去
[root@Mongodb Csong]# ls <strong>mongodb-linux-x86_64-3.2.4.tgz</strong> mongo-r3.3.4 mongo-r3.3.4.zip tar-1.23-11.el6.x86_64.rpm unzip-6.0-1.el6.x86_64.rpm
3.解压mongodb-linux-x86_64-3.2.4.tgz
[root@Mongodb Csong]# tar -zxvf mongodb-linux-x86_64-3.2.4.tgz mongodb-linux-x86_64-3.2.4/README mongodb-linux-x86_64-3.2.4/THIRD-PARTY-NOTICES mongodb-linux-x86_64-3.2.4/MPL-2 mongodb-linux-x86_64-3.2.4/GNU-AGPL-3.0 mongodb-linux-x86_64-3.2.4/bin/mongodump mongodb-linux-x86_64-3.2.4/bin/mongorestore mongodb-linux-x86_64-3.2.4/bin/mongoexport mongodb-linux-x86_64-3.2.4/bin/mongoimport mongodb-linux-x86_64-3.2.4/bin/mongostat mongodb-linux-x86_64-3.2.4/bin/mongotop mongodb-linux-x86_64-3.2.4/bin/bsondump mongodb-linux-x86_64-3.2.4/bin/mongofiles mongodb-linux-x86_64-3.2.4/bin/mongooplog mongodb-linux-x86_64-3.2.4/bin/mongoperf mongodb-linux-x86_64-3.2.4/bin/mongod mongodb-linux-x86_64-3.2.4/bin/mongos mongodb-linux-x86_64-3.2.4/bin/mongo [root@Mongodb Csong]# ls mongodb-linux-x86_64-3.2.4 mongodb-linux-x86_64-3.2.4.tgz mongo-r3.3.4 mongo-r3.3.4.zip tar-1.23-11.el6.x86_64.rpm unzip-6.0-1.el6.x86_64.rpm
4.重命名文件夹
[root@Mongodb Csong]# mv mongodb-linux-x86_64-3.2.4 /usr/local/mongodb [root@Mongodb Csong]# cd /usr/local/mongodb/ [root@Mongodb mongodb]# ls bin GNU-AGPL-3.0 MPL-2 README THIRD-PARTY-NOTICES [root@Mongodb mongodb]# mkdir data --需要创建data文件夹 [root@Mongodb mongodb]# mkdir logs [root@Mongodb mongodb]# ls bin data GNU-AGPL-3.0 logs MPL-2 README THIRD-PARTY-NOTICES [root@Mongodb mongodb]# cd data/ [root@Mongodb data]# ls [root@Mongodb data]# mkdir db [root@Mongodb data]# cd ../bin [root@Mongodb bin]# ls bsondump mongo mongod mongodump mongoexport mongofiles mongoimport mongooplog mongoperf mongorestore mongos mongostat mongotop
5.启动mongodb
这里使用后台运行mongodb,使用--logpath和--fork参数[root@Mongodb bin]# ./mongod --dbpath=/usr/local/mongodb/data/db/ --logpath=/usr/local/mongodb/logs/mongodb.log --fork about to fork child process, waiting until server is ready for connections. forked process: 1195 child process started successfully, parent exiting现在mongodby已经在后台运行了,现在可以使用bin目录下的mongo登入了。
6.登入mongodb
[root@Mongodb bin]# ./mongo MongoDB shell version: 3.2.4 connecting to: test Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user Server has startup warnings: 2016-04-07T07:06:19.661+0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended. 2016-04-07T07:06:19.661+0800 I CONTROL [initandlisten] > x=20 20 >至此全部完成。
相关文章推荐
- Linux学习笔记(一)
- CentOS 6 安装VMWare tools,以及解决安装后/mnt中有hgfs但没共享文件的方法
- Linux下Rsync+Inotify-tools实现数据实时同步
- Linux
- linux字符驱动之异步通知按键驱动
- Linux查看机器负载
- Android SELinux Enforing 和 Permissive 模式切换
- Centos 6.5 下安装 Zabbix server 3.0服务器的安装及 监控主机的加入(2)
- CentOS 如何修改mysql 用户root的密码
- 在Linux下如何使用GCC编译程序、简单生成静态库及动态库
- Linux零基础入学之1-1课程介绍&了解RHEL7&安装RHEL7
- 在Windows和Linux上安装paramiko模块
- Red Hat Linux 挂载外部资源
- linux线程同步05
- centos内核升级步骤
- SSH安全设置
- 设置 Linux 的 LD_LIBRARY_PATH 变量
- linux+Qt程序如何打包发布
- Linux rm命令
- Linux下安装mysql