mongo1的5个配置文件

2021/9/17 23:35:12

本文主要是介绍mongo1的5个配置文件,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

前言:这是文章<<单机搭建mongo集群,3个分片集>>配套配置文件
链接:https://editor.csdn.net/md?articleId=120353582

cd  /data/mongo1/conf

在这里插入图片描述
mongo1 配置节点的配置文件

[root@node4 conf]# cat configsvr.conf
systemLog:
  destination: file
  path: "/data/mongo1/logs/configsvr27100.log"
  logAppend: true
storage:
  journal:
    enabled: true
  dbPath: "/data/mongo1/db_configsvr/"
  directoryPerDB: true
  wiredTiger:
    engineConfig:
      cacheSizeGB: 1
      directoryForIndexes: true
    collectionConfig:
      blockCompressor: zlib
    indexConfig:
      prefixCompression: true
net:
  bindIp: 127.0.0.1,192.168.199.204
  port: 27100
replication:
  oplogSizeMB: 2048
  replSetName: csvr
sharding:
  clusterRole: configsvr
processManagement:
  fork: true

mongo1 配置shard1的配置文件

[root@node4 conf]# cat shard1.conf
systemLog:
   destination: file
   path: "/data/mongo1/logs/shard1_27017.log"
   logAppend: true
storage:
   journal:
      enabled: true
   dbPath: "/data/mongo1/db_shard1"
processManagement:
   fork: true
net:
   bindIp: 127.0.0.1,192.168.199.204
   port: 27017
setParameter:
   enableLocalhostAuthBypass: false
replication:
   replSetName: "rs0"
sharding:
   clusterRole: shardsvr

mongo1 配置shard2的配置文件

[root@node4 conf]# cat shard2.conf
systemLog:
   destination: file
   path: "/data/mongo1/logs/shard2_27018.log"
   logAppend: true
storage:
   journal:
      enabled: true
   dbPath: "/data/mongo1/db_shard2"
processManagement:
   fork: true
net:
   bindIp: 127.0.0.1,192.168.199.204
   port: 27018
setParameter:
   enableLocalhostAuthBypass: false
replication:
   replSetName: "rs1"
sharding:
   clusterRole: shardsvr

mongo1 配置shard3的配置文件

[root@node4 conf]# cat shard3.conf
systemLog:
   destination: file
   path: "/data/mongo1/logs/shard3_27019.log"
   logAppend: true
storage:
   journal:
      enabled: true
   dbPath: "/data/mongo1/db_shard3"
processManagement:
   fork: true
net:
   bindIp: 127.0.0.1,192.168.199.204
   port: 27019
setParameter:
   enableLocalhostAuthBypass: false
replication:
   replSetName: "rs2"
sharding:
   clusterRole: shardsvr

mongo1 配置路由节点配置文件

[root@node4 conf]# cat mongos.conf
systemLog:
  destination: file
  path: "/data/mongo1/logs/mongos28100.log"
  logAppend: true
net:
  bindIp: 127.0.0.1,192.168.199.204
  port: 28100
  # 将confige server 添加到路由
sharding:
  configDB: csvr/192.168.199.204:27100,192.168.199.204:27200,192.168.199.204:27300
processManagement:
  fork: true


这篇关于mongo1的5个配置文件的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程