官网连接地址:https://www.mongodb.com/download-center?jmp=nav#community

列表中没有CentOS!!我选的是这个Linux 64-bit legacy x64版本的。

下载mongo:

wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.2.tgz

解压:

tar zxvf mongodb-linux-x86_64-4.0.2.tgz

解压后的目录移到/usr/local下:

mv mongodb-linux-x86_64-4.0.2 /usr/local

在mongodb下创建data 和logs 目录

mkdir -p data/db

mkdir logs && touch logs/mongodb.log

加到profile

export PATH=/usr/local/mongodb-linux-x86_64-4.0.2/bin:$PATH

创建启动时的配置文件mongodb.conf

# 数据存储文件目录
dbpath=/usr/local/mongodb-linux-x86_64-4.0./data/db
# 日志文件
logpath=/usr/local/mongodb-linux-x86_64-4.0./logs/mongodb.log
# 后台运行
fork=true
auth=true
bind_ip=0.0.0.0

然后就成功启动了~

用mongo命令来连接一下服务:

References:

https://blog.csdn.net/gcalan/article/details/81066582 (这个不建议,用最后的命令启动有点问题)

https://www.2cto.com/net/201611/565439.html(推荐使用这个,赞)

centos 7 64安装mongodb的更多相关文章

  1. Linux系统运维笔记(四),CentOS 6.4安装 MongoDB

    Linux系统运维笔记(四),CentOS 6.4安装 MongoDB 1,下载 https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6 ...

  2. CentOS 6.5安装MongoDB 2.6(多yum数据源)

    下面我们在CentOS 6.5 x64系统上安装最新的MongoDB 2.6.5版. 在MongoDB v2.6.5版的软件仓库一共有五个包: 1)mongodb-org此包是元数据包,它可以实现自动 ...

  3. Centos 使用yum安装MongoDB 4.0

    1.配置MongoDB的yum源 创建yum源文件: #cd /etc/yum.repos.d #vim mongodb-org-4.0.repo 添加以下内容:(我们这里使用阿里云的源) [mngo ...

  4. Centos 7.x 安装 MongoDB

    官方安装资料:点击直达 本次以Centos为安装主机 1:首先先导入MongoDB的yum源,因为Centos默认是没有MongoDB的yum源,创建文件:/etc/yum.repos.d/mongo ...

  5. CentOS 6.5 安装 MongoDB

    1. 配置 yum 新建 /etc/yum.repos.d/mongodb-org-3.4.repo 文件,使用以下配置:(适用于 MongoDB 3.0 以后版本) [mongodb-org-3.4 ...

  6. Centos环境下安装mongoDB

    安装前注意: 此教程是通过yum安装的.仅限64位centos系统 安装步骤: 1.创建仓库文件: vi /etc/yum.repos.d/mongodb-org-3.4.repo 然后复制下面配置, ...

  7. CentOS 6.5安装MongoDB

    1.创建mongodb.repo文件在/etc/yum.repos.d/目录下创建文件mongodb.repo,它包含MongoDB仓库的配置信息,内容如下: [mongodb] name=Mongo ...

  8. CentOS 7 服务器配置--安装MongoDB

    #下载MongoDB源文件: wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-3.4.7-tgz 注意:wget此处 ...

  9. centos 7.5 安装mongodb

    MongoDB安装和启动 从官网下载最新对应的版本然后解压,本文以3.6.9为例,将文件拷贝到opt目录下,然后解压: [root@localhost opt]# tar zxvf mongodb-l ...

随机推荐

  1. Oracle 12C -- 预定义audit policies

    在12C中,预定义了三种审计策略:ora_secureconfig,ora_database_parameter,ora_account_mgmt可以通过脚本$ORACLE_HOME/rdbms/ad ...

  2. Android开发实现计算器的例子

    例子 代码如下 复制代码 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" a ...

  3. Ubuntu 13.10 安装软件失败后出现的问题——已安装 post-installation 脚本 返回了错误号 1

    安装Oracle-java7-installer失败后,再次重新安装后出现错误-- dpkg: error processing oracle-java7-installer (--configure ...

  4. Java – How to convert String to Char Array

    Java – How to convert String to Char ArrayIn Java, you can use String.toCharArray() to convert a Str ...

  5. marquee标签详解

    <marquee>标签,它是成对出现的标签,首标签<marquee>和尾标签</marquee>之间的内容就是滚动内容.<marquee>标签的属性主要 ...

  6. Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id

    报错: [ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or ...

  7. Android 开发日常积累

    Android 集合 Android 开源项目分类汇总 扔物线的 HenCoder 高级 Android 教程 hencoder HenCoder:给高级 Android 工程师的进阶手册 Andro ...

  8. 不应直接存储或返回可变成员 Mutable members should not be stored or returned directly

    Mutable objects are those whose state can be changed. For instance, an array is mutable, but a Strin ...

  9. nginx配置长连接

    http { keepalive_timeout 20; --长连接timeout keepalive_requests 8192; --每个连接最大请求数 } events { worker_con ...

  10. .NET+MVC+Alipay的Sdk版单笔转账到支付宝账户接口

    public class AliPayController : Controller { // GET: AliPay public ActionResult Index() { return Red ...