| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- // Copyright 2015 MemDB.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- // implied. See the License for the specific language governing
- // permissions and limitations under the License. See the AUTHORS file
- // for names of contributors.
- 'use strict';
- /*
- * MemDB server config template
- *
- * Please modify it on your needs
- * This is plain javascript, you can add any js code here, just export the config
- */
- module.exports = {
- // *** global settings for all shards ***
- // Global backend storage, all shards must connect to the same mongodb (cluster)
- backend: {
- engine: 'mongodb', // should be 'mongodb'
- url: 'mongodb://localhost/fhmj?authSource=admin', // mongodb connect string
- options: {}, // mongodb connect options
- },
- // Global locking redis, all shards must connect to the same redis (cluster)
- locking: {
- host: '127.0.0.1',
- port: 6379,
- db: 1,
- },
- // Data replication redis, one redis instance for each shard
- // You can override this in shard settings to choice different slave for each shard
- slave: {
- host: '127.0.0.1',
- port: 6379,
- db: 1,
- },
- // Log settings
- log: {
- // Log file path
- path : './logs/memdbcluster',
- // Log Level (one of 'ALL', 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'OFF')
- // Please set to WARN on production
- level: 'WARN',
- },
- // Promise settings
- promise: {
- // Enable long stack trace, disable it on production
- longStackTraces: false,
- },
- // user for memdbcluster ssh login, default current user
- // when start using memdbcluster, make sure you have ssh permission (without password) on all servers,
- // and the memdb version, install folder, config files are all the same in all servers
- user: process.env.USER,
- // Collection settings (for index), modify it on your need
- collections: require('./memdb.index'),
- shards: {
- mjconnector1: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 61017
- },
- mjconnector2: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 61027
- },
- mjconnector3: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 61037
- },
- increaser: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 61097
- },
- mjgame10: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 61107
- },
- mjgame11: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 61117
- },
- mjgame12: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 61127
- },
- mjgame13: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 61137
- },
- mjgame14: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 61147
- },
- mjhall1: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 62017
- },
- mjhall2: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 62027
- },
- mjhall3: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 62037
- },
- mjhttp1: {
- host: '127.0.0.1',
- bind: '127.0.0.1',
- port: 62107
- }
- },
- // *** additional settings ***
- // These settings are unstable and may change in later version
- // Delay for flush changes to backend storage
- // Set it to large value to improve performance if the data delay in backend storage is not an issue.
- persistentDelay : 0, // 600 * 1000, // number in ms, default 10 min. 0 indicates never
- // Idle time before document is removed from memory.
- // Larger value can improve performance but use more memory.
- // Set it to large value if the documents accessed via this shard is limited.
- // Do not access too many different documents in a short time, which may exhault memory and trigger heavy GC operation.
- // idleTimeout : 1800 * 1000, // number in ms, default 30 min. 0 indicates never
- // GC will be triggered when memory usage reach this limit
- // GC can be very heavy, please adjust idleTimeout to avoid GC.
- // memoryLimit : 1024, // number in MB, default 1024
- // Disable redis replica, DO NOT turn on this in production.
- // disableSlave : false, // default false
- // Slow query time
- // slowQuery : 2000, // number in ms. default 2000
- // Turn on heapdump module (https://www.npmjs.com/package/heapdump)
- // heapdump : false, // default false
- };
|