centos7 MongoDB4 0搭建分布式集群

2021-10-07 05:34:05 字數 432 閱讀 3663

搭建之前先了解一下mongodb分片群集主要有如下三個元件:

shard:分片伺服器,用於儲存實際的資料塊,實際生產環境中乙個shard server 角色可以由幾台伺服器組成乙個peplica set 承擔,防止主機單點故障。

config server:配置伺服器,儲存了整個分片群集的配置資訊,其中包括chunk資訊。

routers:前端路由,客戶端由此接入,且讓整個群集看上去像單一資料庫,前端應用可以透明使用。

系統環境

centos7.5、mongodb4.0.2、關閉防火牆。

CentOS7安裝解壓版mongodb4 0 6

curl osetenforce 0 sed i s selinux enforcing selinux disabled g etc selinux config 依賴包 yum install libcurl openssl ytar zxf mongodb linux x86 64 rhel7...

centos7安裝mongodb4版本

解壓之後 配置環境變數 vi etc profile 新增此配置 export mongodb home usr apk mongodb mongodb linux x86 64 rhel70 4.2.5 export path path bin 當然你也可以直接把bin寫上去都是一樣 export...

centos7安裝MongoDB 單機

軟體所在位置 root 236 mongodb linux x86 64 3.6.13 pwd usr local mongodb linux x86 64 3.6.13 root 236 mongodb linux x86 64 3.6.13 vi etc profile export mongo...