mongodb2.6安装
2015-12-19 20:32
627 查看
操作系统环境如下:
[root@zxl-nginx ~]# cat /etc/issue CentOS release 6.4 (Final) Kernel \r on an \m [root@zxl-nginx ~]# uname -r 2.6.32-358.el6.x86_64mongodb2.6下载地址
# wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.11.tgz[/code]安装mongodb2.6[root@zxl-nginx src]# ll mongodb-linux-x86_64-2.6.11.gz -rw-r--r-- 1 root root 116659120 Dec 13 09:32 mongodb-linux-x86_64-2.6.11.gz [root@zxl-nginx src]# tar fxz mongodb-linux-x86_64-2.6.11.gz [root@zxl-nginx src]# mv mongodb-linux-x86_64-2.6.11 /usr/local/ [root@zxl-nginx src]# ln -s /usr/local/mongodb-linux-x86_64-2.6.11 /usr/local/mongodb创建mongodb用户[root@zxl-nginx src]#groupadd -r mongodb [root@zxl-nginx src]#useradd -r -g mongodb mongodb创建mongodb数据库和logs目录[root@zxl-nginx src]#mkdir /data/ [root@zxl-nginx src]#mkdir /data/logs /data/m20000 [root@zxl-nginx src]#chown mongodb.mongodb /data -Rmongo环境变量配置vim /etc/profile export PATH=$PATH:/usr/local/mongodb/bin加载环境配置文件source /ect/profile启动mongodbmongod --dbpath=/data/m20000/ --logpath=/data/logs/m20000.log --logappend -fork --port 20000登陆mongodb[root@zxl-nginx ~]# mongo --port 20000 MongoDB shell version: 2.6.11 connecting to: 127.0.0.1:20000/test > db test
创建数据以及查看> use zxl switched to db zxl > db.ha.insert({name:"abc",age:21}) WriteResult({ "nInserted" : 1 }) > db.ha.find() { "_id" : ObjectId("56739b27154b52481c1c5749"), "name" : "abc", "age" : 21 }
本文出自 “村里的男孩” 博客,请务必保留此出处http://noodle.blog.51cto.com/2925423/1726421
相关文章推荐
- nodejs使用connect-mongodb报错(Please ensure that you set the default write concern)
- MongoDB使用小结:一些不常见的经验分享
- MongoDB 3.2版WiredTiger存储引擎性能测试
- Mongodb的安装(Mac)以及相关宝贵资料
- 使用 Node.js、Express、AngularJS 和 MongoDB 构建一个Web程序
- mongodb-php应用
- mongodb--应用
- 数据库安装配置文件总结(mysql,SQL Server,oracle,Mongodb,DB2)
- 【八】MongoDB管理之分片集群实践
- nodejs+mongodb系列教程之(5/5)--一个完整的项目
- 一些简单的mongodb常用命令收集
- ubuntu安装mongodb及配置
- MongoDB的安装(单机,副本集,分片)
- nodejs+mongodb系列教程之(4/5)--mongoose使用
- 【七】MongoDB管理之分片集群介绍
- MongoDB 备份(mongodump)恢复(mongorerstore) 导出 (Mongoexport) 导入( Mongoimport)
- MongoDB设置访问权限、设置用户
- 【Mongodb】3.X 配置身份验证
- nodejs+mongodb系列教程之(3/5)--理解路由和中间件
- mongodb查询