github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/mongodb/config/mongodb5.0-config.tpl (about)

     1  # mongod.conf
     2  # for documentation of all options, see:
     3  #   http://docs.mongodb.org/manual/reference/configuration-options/
     4  
     5  {{- $log_root := getVolumePathByName ( index $.podSpec.containers 0 ) "log" }}
     6  {{- $mongodb_root := getVolumePathByName ( index $.podSpec.containers 0 ) "data" }}
     7  {{- $mongodb_port_info := getPortByName ( index $.podSpec.containers 0 ) "mongodb" }}
     8  {{- $phy_memory := getContainerMemory ( index $.podSpec.containers 0 ) }}
     9  
    10  # require port
    11  {{- $mongodb_port := 27017 }}
    12  {{- if $mongodb_port_info }}
    13  {{- $mongodb_port = $mongodb_port_info.containerPort }}
    14  {{- end }}
    15  
    16  # where and how to store data.
    17  storage:
    18    dbPath: {{ $mongodb_root }}/db
    19    journal:
    20      enabled: true
    21    directoryPerDB: true
    22  
    23  # where to write logging data.
    24  {{ block "logsBlock" . }}
    25  systemLog:
    26    destination: file
    27    quiet: false
    28    logAppend: true
    29    logRotate: reopen
    30    path: /data/mongodb/logs/mongodb.log
    31    verbosity: 0
    32  {{ end }}
    33  
    34  # network interfaces
    35  net:
    36    port: {{ $mongodb_port }}
    37    unixDomainSocket:
    38      enabled: false
    39      pathPrefix: {{ $mongodb_root }}/tmp
    40    ipv6: false
    41    bindIpAll: true
    42    #bindIp:
    43  
    44  # replica set options
    45  replication:
    46    replSetName: replicaset
    47    enableMajorityReadConcern: true
    48  
    49  # sharding options
    50  #sharding:
    51    #clusterRole:
    52  
    53  # process management options
    54  processManagement:
    55     fork: false
    56     pidFilePath: {{ $mongodb_root }}/tmp/mongodb.pid
    57  
    58  # set parameter options
    59  setParameter:
    60     enableLocalhostAuthBypass: true
    61  
    62  # security options
    63  security:
    64    authorization: enabled
    65    keyFile: /etc/mongodb/keyfile