Status addMongosOptions(moe::OptionSection* options) { moe::OptionSection general_options("General options"); Status ret = addGeneralServerOptions(&general_options); if (!ret.isOK()) { return ret; } #if defined(_WIN32) moe::OptionSection windows_scm_options("Windows Service Control Manager options"); ret = addWindowsServerOptions(&windows_scm_options); if (!ret.isOK()) { return ret; } #endif #ifdef MONGO_SSL moe::OptionSection ssl_options("SSL options"); ret = addSSLServerOptions(&ssl_options); if (!ret.isOK()) { return ret; } #endif moe::OptionSection sharding_options("Sharding options"); sharding_options.addOptionChaining("configdb", "configdb", moe::String, "1 or 3 comma separated config servers"); sharding_options.addOptionChaining("localThreshold", "localThreshold", moe::Int, "ping time (in ms) for a node to be considered local (default 15ms)"); sharding_options.addOptionChaining("test", "test", moe::Switch, "just run unit tests"); sharding_options.addOptionChaining("upgrade", "upgrade", moe::Switch, "upgrade meta data version"); sharding_options.addOptionChaining("chunkSize", "chunkSize", moe::Int, "maximum amount of data per chunk"); sharding_options.addOptionChaining("ipv6", "ipv6", moe::Switch, "enable IPv6 support (disabled by default)"); sharding_options.addOptionChaining("jsonp", "jsonp", moe::Switch, "allow JSONP access via http (has security implications)"); sharding_options.addOptionChaining("noscripting", "noscripting", moe::Switch, "disable scripting engine"); options->addSection(general_options); #if defined(_WIN32) options->addSection(windows_scm_options); #endif options->addSection(sharding_options); #ifdef MONGO_SSL options->addSection(ssl_options); #endif options->addOptionChaining("noAutoSplit", "noAutoSplit", moe::Switch, "do not send split commands with writes") .hidden(); return Status::OK(); }
Status addMongodOptions(moe::OptionSection* options) { moe::OptionSection general_options("General options"); Status ret = addGeneralServerOptions(&general_options); if (!ret.isOK()) { return ret; } #if defined(_WIN32) moe::OptionSection windows_scm_options("Windows Service Control Manager options"); ret = addWindowsServerOptions(&windows_scm_options); if (!ret.isOK()) { return ret; } #endif #ifdef MONGO_SSL moe::OptionSection ssl_options("SSL options"); ret = addSSLServerOptions(&ssl_options); if (!ret.isOK()) { return ret; } #endif moe::OptionSection ms_options("Master/slave options (old; use replica sets instead)"); moe::OptionSection rs_options("Replica set options"); moe::OptionSection replication_options("Replication options"); moe::OptionSection sharding_options("Sharding options"); general_options.addOptionChaining("auth", "auth", moe::Switch, "run with security"); general_options.addOptionChaining("cpu", "cpu", moe::Switch, "periodically show cpu and iowait utilization"); #ifdef _WIN32 general_options.addOptionChaining("dbpath", "dbpath", moe::String, "directory for datafiles - defaults to \\data\\db\\") .setDefault(moe::Value(std::string("\\data\\db\\"))); #else general_options.addOptionChaining("dbpath", "dbpath", moe::String, "directory for datafiles - defaults to /data/db/") .setDefault(moe::Value(std::string("/data/db"))); #endif general_options.addOptionChaining("diaglog", "diaglog", moe::Int, "0=off 1=W 2=R 3=both 7=W+some reads"); general_options.addOptionChaining("directoryperdb", "directoryperdb", moe::Switch, "each database will be stored in a separate directory"); general_options.addOptionChaining("ipv6", "ipv6", moe::Switch, "enable IPv6 support (disabled by default)"); general_options.addOptionChaining("journal", "journal", moe::Switch, "enable journaling"); general_options.addOptionChaining("journalCommitInterval", "journalCommitInterval", moe::Unsigned, "how often to group/batch commit (ms)"); general_options.addOptionChaining("journalOptions", "journalOptions", moe::Int, "journal diagnostic options"); general_options.addOptionChaining("jsonp", "jsonp", moe::Switch, "allow JSONP access via http (has security implications)"); general_options.addOptionChaining("noauth", "noauth", moe::Switch, "run without security"); general_options.addOptionChaining("noIndexBuildRetry", "noIndexBuildRetry", moe::Switch, "don't retry any index builds that were interrupted by shutdown"); general_options.addOptionChaining("nojournal", "nojournal", moe::Switch, "disable journaling (journaling is on by default for 64 bit)"); general_options.addOptionChaining("noprealloc", "noprealloc", moe::Switch, "disable data file preallocation - will often hurt performance"); general_options.addOptionChaining("noscripting", "noscripting", moe::Switch, "disable scripting engine"); general_options.addOptionChaining("notablescan", "notablescan", moe::Switch, "do not allow table scans"); general_options.addOptionChaining("nssize", "nssize", moe::Int, ".ns file size (in MB) for new databases") .setDefault(moe::Value(16)); general_options.addOptionChaining("profile", "profile", moe::Int, "0=off 1=slow, 2=all"); general_options.addOptionChaining("quota", "quota", moe::Switch, "limits each database to a certain number of files (8 default)"); general_options.addOptionChaining("quotaFiles", "quotaFiles", moe::Int, "number of files allowed per db, requires --quota"); general_options.addOptionChaining("repair", "repair", moe::Switch, "run repair on all dbs"); general_options.addOptionChaining("repairpath", "repairpath", moe::String, "root directory for repair files - defaults to dbpath"); general_options.addOptionChaining("rest", "rest", moe::Switch, "turn on simple rest api"); #if defined(__linux__) general_options.addOptionChaining("shutdown", "shutdown", moe::Switch, "kill a running server (for init scripts)"); #endif general_options.addOptionChaining("slowms", "slowms", moe::Int, "value of slow for profile and console log") .setDefault(moe::Value(100)); general_options.addOptionChaining("smallfiles", "smallfiles", moe::Switch, "use a smaller default file size"); general_options.addOptionChaining("syncdelay", "syncdelay", moe::Double, "seconds between disk syncs (0=never, but not recommended)") .setDefault(moe::Value(60.0)); general_options.addOptionChaining("sysinfo", "sysinfo", moe::Switch, "print some diagnostic system information"); general_options.addOptionChaining("upgrade", "upgrade", moe::Switch, "upgrade db if needed"); replication_options.addOptionChaining("oplogSize", "oplogSize", moe::Int, "size to use (in MB) for replication op log. default is 5% of disk space " "(i.e. large is good)"); ms_options.addOptionChaining("master", "master", moe::Switch, "master mode"); ms_options.addOptionChaining("slave", "slave", moe::Switch, "slave mode"); ms_options.addOptionChaining("source", "source", moe::String, "when slave: specify master as <server:port>"); ms_options.addOptionChaining("only", "only", moe::String, "when slave: specify a single database to replicate"); ms_options.addOptionChaining("slavedelay", "slavedelay", moe::Int, "specify delay (in seconds) to be used when applying master ops to slave"); ms_options.addOptionChaining("autoresync", "autoresync", moe::Switch, "automatically resync if slave data is stale"); rs_options.addOptionChaining("replSet", "replSet", moe::String, "arg is <setname>[/<optionalseedhostlist>]"); rs_options.addOptionChaining("replIndexPrefetch", "replIndexPrefetch", moe::String, "specify index prefetching behavior (if secondary) [none|_id_only|all]"); sharding_options.addOptionChaining("configsvr", "configsvr", moe::Switch, "declare this is a config db of a cluster; default port 27019; " "default dir /data/configdb"); sharding_options.addOptionChaining("shardsvr", "shardsvr", moe::Switch, "declare this is a shard db of a cluster; default port 27018"); sharding_options.addOptionChaining("noMoveParanoia", "noMoveParanoia", moe::Switch, "turn off paranoid saving of data for the moveChunk command; default") .hidden(); sharding_options.addOptionChaining("moveParanoia", "moveParanoia", moe::Switch, "turn on paranoid saving of data during the moveChunk command " "(used for internal system diagnostics)") .hidden(); options->addSection(general_options); #if defined(_WIN32) options->addSection(windows_scm_options); #endif options->addSection(replication_options); options->addSection(ms_options); options->addSection(rs_options); options->addSection(sharding_options); #ifdef MONGO_SSL options->addSection(ssl_options); #endif options->addOptionChaining("fastsync", "fastsync", moe::Switch, "indicate that this instance is starting from a dbpath snapshot of the repl peer") .hidden(); options->addOptionChaining("pretouch", "pretouch", moe::Int, "n pretouch threads for applying master/slave operations") .hidden(); // This is a deprecated option that we are supporting for backwards compatibility // The first value for this option can be either 'dbpath' or 'run'. // If it is 'dbpath', mongod prints the dbpath and exits. Any extra values are ignored. // If it is 'run', mongod runs normally. Providing extra values is an error. options->addOptionChaining("command", "command", moe::StringVector, "command") .hidden() .positional(1, 3); options->addOptionChaining("cacheSize", "cacheSize", moe::Long, "cache size (in MB) for rec store") .hidden(); options->addOptionChaining("nodur", "nodur", moe::Switch, "disable journaling") .hidden(); // things we don't want people to use options->addOptionChaining("nohints", "nohints", moe::Switch, "ignore query hints") .hidden(); options->addOptionChaining("nopreallocj", "nopreallocj", moe::Switch, "don't preallocate journal files") .hidden(); options->addOptionChaining("dur", "dur", moe::Switch, "enable journaling") .hidden(); options->addOptionChaining("durOptions", "durOptions", moe::Int, "durability diagnostic options") .hidden(); // deprecated pairing command line options options->addOptionChaining("pairwith", "pairwith", moe::Switch, "DEPRECATED") .hidden(); options->addOptionChaining("arbiter", "arbiter", moe::Switch, "DEPRECATED") .hidden(); options->addOptionChaining("opIdMem", "opIdMem", moe::Switch, "DEPRECATED") .hidden(); return Status::OK(); }
Status addMongosOptions(moe::OptionSection* options) { moe::OptionSection general_options("General options"); Status ret = addGeneralServerOptions(&general_options); if (!ret.isOK()) { return ret; } #if defined(_WIN32) moe::OptionSection windows_scm_options("Windows Service Control Manager options"); ret = addWindowsServerOptions(&windows_scm_options); if (!ret.isOK()) { return ret; } #endif #ifdef MONGO_CONFIG_SSL moe::OptionSection ssl_options("SSL options"); ret = addSSLServerOptions(&ssl_options); if (!ret.isOK()) { return ret; } #endif moe::OptionSection sharding_options("Sharding options"); sharding_options.addOptionChaining("sharding.configDB", "configdb", moe::String, "Connection string for communicating with config servers:\n" "<config replset name>/<host1:port>,<host2:port>,[...]"); sharding_options.addOptionChaining( "replication.localPingThresholdMs", "localThreshold", moe::Int, "ping time (in ms) for a node to be considered local (default 15ms)"); sharding_options.addOptionChaining("test", "test", moe::Switch, "just run unit tests") .setSources(moe::SourceAllLegacy); sharding_options.addOptionChaining( "sharding.chunkSize", "chunkSize", moe::Int, "maximum amount of data per chunk"); sharding_options.addOptionChaining("net.http.JSONPEnabled", "jsonp", moe::Switch, "allow JSONP access via http (has security implications)") .setSources(moe::SourceAllLegacy); sharding_options.addOptionChaining( "noscripting", "noscripting", moe::Switch, "disable scripting engine") .setSources(moe::SourceAllLegacy); options->addSection(general_options); #if defined(_WIN32) options->addSection(windows_scm_options); #endif options->addSection(sharding_options); #ifdef MONGO_CONFIG_SSL options->addSection(ssl_options); #endif options->addOptionChaining("noAutoSplit", "noAutoSplit", moe::Switch, "do not send split commands with writes") .hidden() .setSources(moe::SourceAllLegacy); options->addOptionChaining( "sharding.autoSplit", "", moe::Bool, "send split commands with writes") .setSources(moe::SourceYAMLConfig); return Status::OK(); }
Status addMongosOptions(moe::OptionSection* options) { moe::OptionSection general_options("General options"); Status ret = addGeneralServerOptions(&general_options); if (!ret.isOK()) { return ret; } #if defined(_WIN32) moe::OptionSection windows_scm_options("Windows Service Control Manager options"); ret = addWindowsServerOptions(&windows_scm_options); if (!ret.isOK()) { return ret; } #endif #ifdef MONGO_CONFIG_SSL moe::OptionSection ssl_options("SSL options"); ret = addSSLServerOptions(&ssl_options); if (!ret.isOK()) { return ret; } #endif moe::OptionSection sharding_options("Sharding options"); sharding_options.addOptionChaining("sharding.configDB", "configdb", moe::String, "Connection string for communicating with config servers:\n" "<config replset name>/<host1:port>,<host2:port>,[...]"); sharding_options.addOptionChaining( "replication.localPingThresholdMs", "localThreshold", moe::Int, "ping time (in ms) for a node to be considered local (default 15ms)"); sharding_options.addOptionChaining("test", "test", moe::Switch, "just run unit tests") .setSources(moe::SourceAllLegacy); /** Javascript Options * As a general rule, js enable/disable options are ignored for mongos. * However, we define and hide these options so that if someone * were to use these args in a set of options meant for both * mongos and mongod runs, the mongos won't fail on an unknown argument. * * These options have no affect on how the mongos runs. * Setting either or both to *any* value will provoke a warning message * and nothing more. */ sharding_options .addOptionChaining("noscripting", "noscripting", moe::Switch, "disable scripting engine") .hidden() .setSources(moe::SourceAllLegacy); general_options .addOptionChaining( "security.javascriptEnabled", "", moe::Bool, "Enable javascript execution") .hidden() .setSources(moe::SourceYAMLConfig); options->addSection(general_options).transitional_ignore(); #if defined(_WIN32) options->addSection(windows_scm_options).transitional_ignore(); #endif options->addSection(sharding_options).transitional_ignore(); #ifdef MONGO_CONFIG_SSL options->addSection(ssl_options).transitional_ignore(); #endif return Status::OK(); }