【安装文档】mongodb安装步骤说明(Linux版)

前言

本文主要讲解在Linux服务器上安装mongodb服务。

所需安装文件:
mongodb-linux-x86_64-rhel55-3.2.8.tgz

安装步骤

[@bx_44_177 /opt/mongodb]#mkdir -p /opt/mongodb/data
[@bx_44_177 /opt/mongodb]#mkdir -p /opt/mongodb/logs
[@bx_44_177 /opt/mongodb]#tar zxvf mongodb-linux-x86_64-rhel55-3.2.8.tgz
[@bx_44_177 /opt/mongodb]#cd mongodb-linux-x86_64-rhel55-3.2.8/bin/
[@bx_44_177 /opt/mongodb]#mongod --dbpath /opt/mongodb/data/

CAP定理

CAP定理

CAP定理又称CAP原则(CAP理论),指的是在一个分布式系统中,最多只能同时满足Consistency(一致性)、Availability(可用性)、Partition tolerance(分区容错性)这三项中的两项。

如下图示:

cap.pngcap.png

Springboot项目使用Redis实现发布订阅功能

Redis发布订阅

Redis发布订阅(pub/sub)是一种消息通信模式:发送者(pub)发送消息,订阅者(sub)接收消息;
消息发布者和订阅者不进行直接通信,发布者客户端向指定的频道(channel)发布消息,订阅该频道的每个客户端都可以收到该消息。
如下图示:

Redis发布订阅模式Redis发布订阅模式