wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz
tar zxf mongodb-linux-i686-1.8.2.tgz
mv mongodb-linux-i686-1.8.2 /usr/local/mongodb
mkdir /data/mongodb
touch /var/log/mongodb/mongod.log
vim /etc/mongod.conf
    插入内容
    systemLog:
       destination: file
       path: "/var/log/mongodb/mongod.log"
       logAppend: true
    storage:
       dbPath: "/data/mongodb"
       journal:
          enabled: true
    processManagement:
       fork: true
    net:
       bindIpAll: true
       port: 27017
    setParameter:
       enableLocalhostAuthBypass: false
添加rc.local文件
cat <<EOF >/etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
EOF
赋予权限
chmod +x /etc/rc.local
启动rc.local服务
systemctl start rc-local
启动mongodb服务
/usr/local/mongodb/bin/mongod --config=/etc/mongod.conf
如果出现
mongod: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
需要安装curl
apt-get install curl
切换到admin目录
use admin
添加管理用户root(所有)
db.createUser({user: "root",pwd: "*******",roles: [ { role: "root", db: "admin" } ]});
添加数据获取用户zz_api(读写)
db.createUser({user: "zz_api",pwd: "*******",roles: [ { role: "readWrite", db: "zz_web" } ]});
添加爬虫用户zz_spider(读写)
db.createUser({user: "zz_spider",pwd: "*******",roles: [ { role: "readWrite", db: "zz_web" } ]});
创建zz_web数据库
use zz_web
退出
exit
添加开机自启
vim /etc/rc.local
在exit 0之前添加
/usr/local/mongodb/bin/mongod --auth --config=/etc/mongodb.conf >/dev/null 2>&1
退出重启服务器测试

debian安装mongoDB的更多相关文章

  1. Debian/Ubuntu手动编译安装MongoDB C++11驱动及驱动测试

    本文章仅限cnblogs网站内转载!请某网站自觉,遵纪守法,尊重原创! 系统环境情况: 最小化.无桌面环境 新安装的Debian 8 Server 版本操作系统虚拟机一台 手动编译安装MongoDB ...

  2. 在debian9上安装mongodb

    MongoDB是一个免费的开源NoSQL文档数据库,在现代Web应用程序中常用.在本教程中,您将安装MongoDB,管理其服务,并可选择启用远程访问.要遵循这个...... 介绍 MongoDB是一个 ...

  3. 【先定一个小目标】Windows下安装MongoDB 3.2

    1.MongoDB 安装 官网提供了三个版本下载: - MongoDB for Windows 64-bit 适合 64 位的 Windows Server 2008 R2, Windows 7 , ...

  4. Windows 下安装 MongoDB

    Windows 下安装 MongoDB 的步骤:1.官网www.mongodb.com下载安装包或zip包2.解压下载的文件到文件夹 D:\mongo .3.使用管理员权限打开CMD,导航到目录 D: ...

  5. windows 安装 mongodb

    windows 安装 mongodb 下载 首先到官网下载合适的安装包,下载地址为 https://www.mongodb.com/download-center MongoDB for Window ...

  6. Python: Win7 64位如何安装MongoDB?

    Windows 7 64位安装MongoDB 官网tutorial:  https://docs.mongodb.com/v3.0/tutorial/install-mongodb-on-window ...

  7. CentOS7 编译安装 Mongodb (实测 笔记 Centos 7.0 + Mongodb 2.6.6)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7.0-1406-x86_64-DVD.iso 安装步骤: 1.准备 1.1 显示系统版 ...

  8. 搭建LNAMP环境(六)- PHP7源码安装MongoDB和MongoDB拓展

    上一篇:搭建LNAMP环境(五)- PHP7源码安装Redis和Redis拓展 一.安装MongoDB 1.创建mongodb用户组和用户 groupadd mongodb useradd -r -g ...

  9. 在 CentOS7 上安装 MongoDB

    在 CentOS7 上安装 MongoDB 1 通过 SecureCRT 连接至 CentOS7 服务器: 2 进入到 /usr/local/ 目录: cd /usr/local 3 在当前目录下创建 ...

随机推荐

  1. 【XSY2962】作业 数学

    题目描述 有一个递推式: \[ \begin{align} f_0&=1-\frac{1}{e}\\ f_n&=1-nf_{i-1} \end{align} \] 求 \(f_n\) ...

  2. 初学cdq分治学习笔记(可能有第二次的学习笔记)

    前言骚话 本人蒟蒻,一开始看到模板题就非常的懵逼,链接,学到后面就越来越清楚了. 吐槽,cdq,超短裙分治....(尴尬) 正片开始 思想 和普通的分治,还是分而治之,但是有一点不一样的是一般的分治在 ...

  3. IScroll某些手机下不触发ScrollEnd问题处理

    同样是微信7.0,看起来内核都是x5内核,两款不同的手机,一个有问题,一个没有问题. IScroll在问题手机下会出现快速拨动时候不触发ScrollEnd事件现象,轻点一次才会触发,解决办法 docu ...

  4. [物理学与PDEs]第1章第2节 预备知识 2.3 Faraday 电磁感应定律

    1.  Faraday 电磁感应定律: 设 $l$ 为任一闭曲线, 则 $$\bex \oint_l{\bf E}\cdot\rd {\bf l} =-\int_S \cfrac{\p {\bf B} ...

  5. 大家都知道fastclick能解决300ms延迟,现在我们来看一下,使用方法

    1.在终端输入以下命令进行安装 npm install fastclick -S 2.在你用脚手架搭建好的项目中,找到mian.js这个入口文件,打开 3.在其中加入: import FastClic ...

  6. Vue技术内幕 出去看看吧 榨干部分小细节

    vue\src\platforms\web\entry-runtime-with-compiler.js /** * Get outerHTML of elements, taking care * ...

  7. Ansible------角色

    什么是角色 角色是一种解决问题的思想,也是一种规范. 目录 角色的目录结构如下: files: 存放由copy或script模块等调用的文件. templates: template模块查找所需要模板 ...

  8. 编程入门视频【 Python、PHP、ThinkPHP、Laravel、Mysql、微信小程序】

    免费分享 Python.PHP.ThinkPHP.Laravel.Mysql.微信小程序等学习视频 点击进入搜刮 免费分享 Python.PHP.ThinkPHP.Laravel.Mysql.微信小程 ...

  9. redis 远程操作命令

    在远程服务上执行命令 如果需要在远程 redis 服务上执行命令,同样我们使用的也是 redis-cli 命令. 语法 $ redis-cli -h host -p port -a password ...

  10. 题解P3711:【仓鼠的数学题】

    这题黑的丫!怎么会掉紫呢! noteskey 伯努利数... 这里 有介绍哟~ 写的非常详细呢~ 反正这题就是推柿子... 另外就是黈力算法的运用 QWQ 我们令 \(ANS(x)\) 为答案多项式, ...