32位ubuntu安装mongodb

前端之家收集整理的这篇文章主要介绍了32位ubuntu安装mongodb前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1.下载文件

curl -O https://fastdl.mongodb.org/linux/mongodb-linux-i686-3.2.4.tgz

2.解压缩并修改路径

tar -zxvf mongodb-linux-i686-3.2.4.tgz
sudo mv mongodb-linux-i686-3.2.4.tgz /usr/local/mongodb

3.添加修改配置文件(注意权限)

cd /usr/local/mongodb/bin
sudo mkdir conf
sudo touch mongod.conf

配置文件如下:

systemLog:
   destination: file
   path: "/home/ubuntu/mongodb/mongod.log"
   logAppend: true
storage:
   engine: mmapv1
   dbPath: "/home/ubuntu/mongodb/data/db"
   journal:
      enabled: true
processManagement:
   pidFilePath: "/home/ubuntu/mongodb/pids/pids.txt"
   fork: true
net:
   bindIp: 127.0.0.1
   port: 27017
setParameter:
   enableLocalhostAuthBypass: false

注意:storageEngine数据库引擎,自version 3.2后默认是wiredTiger,无法在32位系统运行,修改mmapv1
4.添加环境变量

PATH=$PATH:/usr/local/mongodb/bin
export PATH

5.启动mongo

mongod --config  /usr/local/mongodb/bin/conf/mongod.conf

如果出现一下错误

2017-09-17T13:11:51.397+0800 F CONTROL  [main] Failed global initialization: BadValue: Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly.

在终端输入export LC_ALL=C即可

猜你在找的Ubuntu相关文章