首页 > 数据库 >mongodb获取配置参数getParameter和setParameter设置参数

mongodb获取配置参数getParameter和setParameter设置参数

时间:2024-10-25 17:11:38浏览次数:1  
标签:10 false mongodb verbosity getParameter NumberLong 参数 true 104857600


1、获取某个配置参数的值:
db.runCommand( { getParameter :1,tcmallocAggressiveMemoryDecommit:1} )
2、设置某个配置参数的值:
db.adminCommand({setParameter:1,tcmallocAggressiveMemoryDecommit:1})


restcloud1:SECONDARY> db.runCommand( { getParameter :1,tcmallocAggressiveMemoryDecommit:1} )
{
        "tcmallocAggressiveMemoryDecommit" : 0,
        "ok" : 1,
        "$clusterTime" : {
                "clusterTime" : Timestamp(1729839283, 5),
                "signature" : {
                        "hash" : BinData(0,"ow9/m9VuRu0MTE8DLPETaJHDOmc="),
                        "keyId" : NumberLong("7399092378755137537")
                }
        },
        "operationTime" : Timestamp(1729839283, 5)
}
restcloud1:SECONDARY> 

restcloud1:SECONDARY> db.adminCommand({setParameter:1,tcmallocAggressiveMemoryDecommit:1})
{
        "was" : 0,
        "ok" : 1,
        "$clusterTime" : {
                "clusterTime" : Timestamp(1729839357, 3),
                "signature" : {
                        "hash" : BinData(0,"WM+I3xe2GYg6kMTsf+zAlkEIAXo="),
                        "keyId" : NumberLong("7399092378755137537")
                }
        },
        "operationTime" : Timestamp(1729839357, 3)
}
restcloud1:SECONDARY> db.runCommand( { getParameter :1,tcmallocAggressiveMemoryDecommit:1} )
{
        "tcmallocAggressiveMemoryDecommit" : 1,
        "ok" : 1,
        "$clusterTime" : {
                "clusterTime" : Timestamp(1729839365, 2),
                "signature" : {
                        "hash" : BinData(0,"8HcHh/hgduHsTbn57foz8x36xb4="),
                        "keyId" : NumberLong("7399092378755137537")
                }
        },
        "operationTime" : Timestamp(1729839365, 2)
}
restcloud1:SECONDARY> 

 


3、获取所有配置参数的值:

db.runCommand( { getParameter : '*' } )


restcloud1:SECONDARY> db.runCommand( { getParameter : '*' } )
{
        "AlwaysRecordTraffic" : "",
        "KeysRotationIntervalSec" : 7776000,
        "ShardingTaskExecutorPoolHostTimeoutMS" : 300000,
        "ShardingTaskExecutorPoolMaxConnecting" : 2,
        "ShardingTaskExecutorPoolMaxSize" : 32767,
        "ShardingTaskExecutorPoolMaxSizeForConfigServers" : -1,
        "ShardingTaskExecutorPoolMinSize" : 1,
        "ShardingTaskExecutorPoolMinSizeForConfigServers" : -1,
        "ShardingTaskExecutorPoolRefreshRequirementMS" : 60000,
        "ShardingTaskExecutorPoolRefreshTimeoutMS" : 20000,
        "ShardingTaskExecutorPoolReplicaSetMatching" : "automatic",
        "TransactionRecordMinimumLifetimeMinutes" : 30,
        "adaptiveServiceExecutorIdlePctThreshold" : 60,
        "adaptiveServiceExecutorMaxQueueLatencyMicros" : 500,
        "adaptiveServiceExecutorRecursionLimit" : 8,
        "adaptiveServiceExecutorReservedThreads" : -1,
        "adaptiveServiceExecutorRunTimeJitterMillis" : 500,
        "adaptiveServiceExecutorRunTimeMillis" : 5000,
        "adaptiveServiceExecutorStuckThreadTimeoutMillis" : 250,
        "allowRolesFromX509Certificates" : true,
        "allowSecondaryReadsDuringBatchApplication" : true,
        "authSchemaVersion" : 5,
        "authenticationMechanisms" : [
                "MONGODB-X509",
                "SCRAM-SHA-1",
                "SCRAM-SHA-256"
        ],
        "authorizationManagerCacheSize" : 100,
        "authorizationManagerPinnedUsers" : [ ],
        "authorizationManagerPinnedUsersRefreshIntervalMillis" : NumberLong(1000),
        "bgSyncOplogFetcherBatchSize" : 13981010,
        "cachePressureThreshold" : 95,
        "checkCachePressurePeriodSeconds" : 5,
        "clientCursorMonitorFrequencySecs" : 4,
        "cloudFreeMonitoringEndpointURL" : "https://cloud.mongodb.com/freemonitoring/mongo",
        "clusterAuthMode" : "keyFile",
        "collectionClonerBatchSize" : 0,
        "collectionClonerUsesExhaust" : true,
        "connPoolMaxConnsPerHost" : 200,
        "connPoolMaxInUseConnsPerHost" : 2147483647,
        "connPoolMaxShardedConnsPerHost" : 200,
        "connPoolMaxShardedInUseConnsPerHost" : 2147483647,
        "createRollbackDataFiles" : true,
        "cursorTimeoutMillis" : NumberLong(600000),
        "diagnosticDataCollectionDirectoryPath" : "/data/mongo27018/db/diagnostic.data",
        "diagnosticDataCollectionDirectorySizeMB" : 200,
        "diagnosticDataCollectionEnabled" : true,
        "diagnosticDataCollectionFileSizeMB" : 10,
        "diagnosticDataCollectionPeriodMillis" : 1000,
        "diagnosticDataCollectionSamplesPerChunk" : 300,
        "diagnosticDataCollectionSamplesPerInterimUpdate" : 10,
        "disableIndexSpecNamespaceGeneration" : false,
        "disableJavaScriptJIT" : true,
        "disableLogicalSessionCacheRefresh" : false,
        "disableNonSSLConnectionLogging" : false,
        "disableNonTLSConnectionLogging" : false,
        "disabledSecureAllocatorDomains" : [ ],
        "enableElectionHandoff" : true,
        "enableFlowControl" : true,
        "enableHybridIndexBuilds" : true,
        "enableIndexBuildsCoordinatorForCreateIndexesCommand" : false,
        "enableLocalhostAuthBypass" : true,
        "enableOverrideClusterChainingSetting" : false,
        "enableShardedIndexConsistencyCheck" : true,
        "enableTestCommands" : false,
        "enforceUserClusterSeparation" : true,
        "failIndexKeyTooLong" : true,
        "featureCompatibilityVersion" : {
                "version" : "4.2"
        },
        "findChunksOnConfigTimeoutMS" : 900000,
        "flowControlDecayConstant" : 0.5,
        "flowControlFudgeFactor" : 0.95,
        "flowControlMaxSamples" : 1000000,
        "flowControlMinTicketsPerSecond" : 100,
        "flowControlSamplePeriod" : 1000,
        "flowControlTargetLagSeconds" : 10,
        "flowControlThresholdLagPercentage" : 0.5,
        "flowControlTicketAdderConstant" : 1000,
        "flowControlTicketMultiplierConstant" : 1.05,
        "flowControlWarnThresholdSeconds" : 10,
        "forceRollbackViaRefetch" : false,
        "globalConnPoolIdleTimeoutMinutes" : 2147483647,
        "heapProfilingEnabled" : false,
        "heapProfilingSampleIntervalBytes" : NumberLong(262144),
        "honorSystemUmask" : false,
        "incrementChunkMajorVersionOnChunkSplits" : false,
        "initialSyncOplogBuffer" : "collection",
        "initialSyncOplogBufferPeekCacheSize" : 10000,
        "initialSyncOplogFetcherBatchSize" : 13981010,
        "initialSyncSourceReadPreference" : "",
        "internalDocumentSourceCursorBatchSizeBytes" : 4194304,
        "internalDocumentSourceGroupMaxMemoryBytes" : NumberLong(104857600),
        "internalDocumentSourceLookupCacheSizeBytes" : 104857600,
        "internalDocumentSourceSortMaxBlockingSortBytes" : NumberLong(104857600),
        "internalGeoNearQuery2DMaxCoveringCells" : 16,
        "internalGeoPredicateQuery2DMaxCoveringCells" : 16,
        "internalInsertMaxBatchSize" : 64,
        "internalLookupStageIntermediateDocumentMaxSizeBytes" : NumberLong(104857600),
        "internalPipelineLengthLimit" : 2147483647,
        "internalProhibitShardOperationRetry" : false,
        "internalQueryAllowShardedLookup" : false,
        "internalQueryAlwaysMergeOnPrimaryShard" : false,
        "internalQueryCacheDisableInactiveEntries" : false,
        "internalQueryCacheEvictionRatio" : 10,
        "internalQueryCacheFeedbacksStored" : 20,
        "internalQueryCacheListPlansNewOutput" : false,
        "internalQueryCacheMaxSizeBytesBeforeStripDebugInfo" : NumberLong(536870912),
        "internalQueryCacheSize" : 5000,
        "internalQueryCacheWorksGrowthCoefficient" : 2,
        "internalQueryDisableExchange" : false,
        "internalQueryEnumerationMaxIntersectPerAnd" : 3,
        "internalQueryEnumerationMaxOrSolutions" : 10,
        "internalQueryEnumerationPreferLockstepOrEnumeration" : false,
        "internalQueryExecMaxBlockingSortBytes" : 33554432,
        "internalQueryExecYieldIterations" : 128,
        "internalQueryExecYieldPeriodMS" : 10,
        "internalQueryExplainSizeThresholdBytes" : 10485760,
        "internalQueryFacetBufferSizeBytes" : 104857600,
        "internalQueryFacetMaxOutputDocSizeBytes" : NumberLong(104857600),
        "internalQueryForceIntersectionPlans" : false,
        "internalQueryIgnoreUnknownJSONSchemaKeywords" : false,
        "internalQueryMaxAddToSetBytes" : NumberLong(104857600),
        "internalQueryMaxPushBytes" : 104857600,
        "internalQueryMaxRangeBytes" : 104857600,
        "internalQueryMaxScansToExplode" : 200,
        "internalQueryPlanEvaluationCollFraction" : 0.3,
        "internalQueryPlanEvaluationMaxResults" : 101,
        "internalQueryPlanEvaluationWorks" : 10000,
        "internalQueryPlanOrChildrenIndependently" : true,
        "internalQueryPlannerEnableHashIntersection" : false,
        "internalQueryPlannerEnableIndexIntersection" : true,
        "internalQueryPlannerGenerateCoveredWholeIndexScans" : false,
        "internalQueryPlannerMaxIndexedSolutions" : 64,
        "internalQueryProhibitBlockingMergeOnMongoS" : false,
        "internalQueryProhibitMergingOnMongoS" : false,
        "internalQueryS2GeoCoarsestLevel" : 0,
        "internalQueryS2GeoFinestLevel" : 23,
        "internalQueryS2GeoMaxCells" : 20,
        "internalValidateFeaturesAsMaster" : true,
        "javascriptProtection" : false,
        "journalCommitInterval" : 100,
        "jsHeapLimitMB" : 1100,
        "localLogicalSessionTimeoutMinutes" : 30,
        "logComponentVerbosity" : {
                "verbosity" : 0,
                "accessControl" : {
                        "verbosity" : -1
                },
                "command" : {
                        "verbosity" : -1
                },
                "control" : {
                        "verbosity" : -1
                },
                "executor" : {
                        "verbosity" : -1
                },
                "geo" : {
                        "verbosity" : -1
                },
                "index" : {
                        "verbosity" : -1
                },
                "network" : {
                        "verbosity" : -1,
                        "asio" : {
                                "verbosity" : -1
                        },
                        "bridge" : {
                                "verbosity" : -1
                        },
                        "connectionPool" : {
                                "verbosity" : -1
                        }
                },
                "query" : {
                        "verbosity" : -1
                },
                "replication" : {
                        "verbosity" : -1,
                        "election" : {
                                "verbosity" : -1
                        },
                        "heartbeats" : {
                                "verbosity" : -1
                        },
                        "initialSync" : {
                                "verbosity" : -1
                        },
                        "rollback" : {
                                "verbosity" : -1
                        }
                },
                "sharding" : {
                        "verbosity" : -1,
                        "shardingCatalogRefresh" : {
                                "verbosity" : -1
                        }
                },
                "storage" : {
                        "verbosity" : -1,
                        "recovery" : {
                                "verbosity" : -1
                        },
                        "journal" : {
                                "verbosity" : -1
                        }
                },
                "write" : {
                        "verbosity" : -1
                },
                "ftdc" : {
                        "verbosity" : -1
                },
                "tracking" : {
                        "verbosity" : -1
                },
                "transaction" : {
                        "verbosity" : -1
                }
        },
        "logLevel" : 0,
        "logicalSessionRefreshMillis" : 300000,
        "maxAcceptableLogicalClockDriftSecs" : NumberLong(31536000),
        "maxBSONDepth" : 200,
        "maxCatchUpPercentageBeforeBlockingWrites" : 10,
        "maxIndexBuildDrainBatchSize" : 1000,
        "maxIndexBuildDrainMemoryUsageMegabytes" : 16,
        "maxIndexBuildMemoryUsageMegabytes" : 200,
        "maxLogSizeKB" : 10,
        "maxNumberOfTransactionOperationsInSingleOplogEntry" : 2147483647,
        "maxOplogTruncationPointsAfterStartup" : NumberLong(100),
        "maxOplogTruncationPointsDuringStartup" : NumberLong(100),
        "maxSessions" : 1000000,
        "maxSyncSourceLagSecs" : 30,
        "maxTargetSnapshotHistoryWindowInSeconds" : 5,
        "maxTransactionLockRequestTimeoutMillis" : 5,
        "migrateCloneInsertionBatchDelayMS" : 0,
        "migrateCloneInsertionBatchSize" : 0,
        "migrationLockAcquisitionMaxWaitMS" : 500,
        "minMillisBetweenSnapshotWindowDec" : 500,
        "minMillisBetweenSnapshotWindowInc" : 500,
        "minNumChunksForSessionsCollection" : 1024,
        "minOplogTruncationPoints" : NumberLong(10),
        "notablescan" : false,
        "numInitialSyncAttempts" : 10,
        "numInitialSyncCollectionCountAttempts" : 3,
        "numInitialSyncCollectionFindAttempts" : 3,
        "numInitialSyncConnectAttempts" : 10,
        "numInitialSyncListCollectionsAttempts" : 3,
        "numInitialSyncListDatabasesAttempts" : 3,
        "numInitialSyncListIndexesAttempts" : 3,
        "numInitialSyncOplogFindAttempts" : 3,
        "opensslCipherConfig" : "",
        "opensslDiffieHellmanParameters" : "",
        "oplogFetcherInitialSyncMaxFetcherRestarts" : 10,
        "oplogFetcherSteadyStateMaxFetcherRestarts" : 1,
        "oplogInitialFindMaxSeconds" : 60,
        "oplogRetriedFindMaxSeconds" : 2,
        "oplogTruncationPointSizeMB" : 0,
        "opportunisticSecondaryTargeting" : false,
        "orphanCleanupDelaySecs" : 900,
        "periodicNoopIntervalSecs" : 10,
        "priorityTakeoverFreshnessWindowSeconds" : 2,
        "quiet" : false,
        "rangeDeleterBatchDelayMS" : 20,
        "rangeDeleterBatchSize" : 0,
        "recoverFromOplogAsStandalone" : false,
        "recoverToOplogTimestamp" : "",
        "replBatchLimitBytes" : 104857600,
        "replBatchLimitOperations" : 5000,
        "replElectionTimeoutOffsetLimitFraction" : 0.15,
        "replWriterMinThreadCount" : 0,
        "replWriterThreadCount" : 16,
        "reportOpWriteConcernCountersInServerStatus" : false,
        "reservedServiceExecutorRecursionLimit" : 8,
        "rewriteStateChangeErrors" : true,
        "roleGraphInvalidationIsFatal" : false,
        "rollbackRemoteOplogQueryBatchSize" : 2000,
        "rollbackTimeLimitSecs" : 86400,
        "saslHostName" : "localhost.localdomain",
        "saslServiceName" : "mongodb",
        "saslauthdPath" : "",
        "scramIterationCount" : 10000,
        "scramSHA256IterationCount" : 15000,
        "scriptingEngineInterruptIntervalMS" : 1000,
        "shardedConnPoolIdleTimeoutMinutes" : 2147483647,
        "shardedIndexConsistencyCheckIntervalMS" : 600000,
        "skipCorruptDocumentsWhenCloning" : false,
        "skipShardingConfigurationChecks" : false,
        "skipShellCursorFinalize" : false,
        "snapshotWindowAdditiveIncreaseSeconds" : 2,
        "snapshotWindowMultiplicativeDecrease" : 0.75,
        "sslMode" : "disabled",
        "sslWithholdClientCertificate" : false,
        "startupAuthSchemaValidation" : true,
        "startupRecoveryForRestore" : false,
        "storeFindAndModifyImagesInSideCollection" : false,
        "suppressNoTLSPeerCertificateWarning" : false,
        "syncdelay" : 60,
        "synchronousServiceExecutorRecursionLimit" : 8,
        "takeUnstableCheckpointOnShutdown" : false,
        "taskExecutorPoolSize" : 1,
        "tcmallocAggressiveMemoryDecommit" : 1,
        "tcmallocMaxTotalThreadCacheBytes" : NumberLong(1073741824),
        "tcmallocReleaseRate" : 1,
        "testingSnapshotBehaviorInIsolation" : false,
        "tlsCATrusts" : null,
        "tlsMode" : "disabled",
        "tlsOCSPVerifyTimeoutSecs" : 5,
        "tlsWithholdClientCertificate" : false,
        "traceExceptions" : false,
        "traceWriteConflictExceptions" : false,
        "trafficRecordingDirectory" : "",
        "transactionLifetimeLimitSeconds" : 60,
        "transactionSizeLimitBytes" : NumberLong("9223372036854775807"),
        "ttlMonitorEnabled" : true,
        "ttlMonitorSleepSecs" : 60,
        "useReadOnceCursorsForIndexBuilds" : true,
        "waitForSecondaryBeforeNoopWriteMS" : 10,
        "waitForStepDownOnNonCommandShutdown" : true,
        "watchdogPeriodSeconds" : -1,
        "wiredTigerConcurrentReadTransactions" : 128,
        "wiredTigerConcurrentWriteTransactions" : 128,
        "wiredTigerCursorCacheSize" : -100,
        "wiredTigerEngineRuntimeConfig" : "",
        "wiredTigerFileHandleCloseIdleTime" : 100000,
        "wiredTigerFileHandleCloseMinimum" : 250,
        "wiredTigerFileHandleCloseScanInterval" : 10,
        "wiredTigerMaxCacheOverflowSizeGB" : 0,
        "wiredTigerSessionCloseIdleTimeSecs" : 300,
        "wiredTigerSkipTableLoggingChecksOnStartup" : false,
        "writePeriodicNoops" : true,
        "ok" : 1,
        "$clusterTime" : {
                "clusterTime" : Timestamp(1729847329, 1),
                "signature" : {
                        "hash" : BinData(0,"moIf1x75pVCHdhgeq4/kFmGWrU4="),
                        "keyId" : NumberLong("7399092378755137537")
                }
        },
        "operationTime" : Timestamp(1729847329, 1)
}
restcloud1:SECONDARY> 

标签:10,false,mongodb,verbosity,getParameter,NumberLong,参数,true,104857600
From: https://www.cnblogs.com/hsjz-xinyuan/p/18502934

相关文章

  • MongoDB配置文件详解--转
    一配置文件说明MongoDB有两种配置文件格式,分别是:3.2版官方yaml配置文件选项参考用=号的常规格式类似my.conf等常规配置的文件yaml语法的新格式mongodb3.x版本后就是要yaml语法格式的配置文件,下面是yaml配置文件格式如下:切记yaml只能使用空格,不支持tab键,切记配置举例配置......
  • modsecurity: 规则例子: 根据参数进行判断/规则的通用格式
    一,根据参数的值进行判断:1,对所有参数进行判断规则:SecRuleARGS"@rxattack""phase:1,log,deny,id:1"测试:http://a.b.com/index.html?name=attack2,根据变量名进行判断规则:判断name变量中是否包含adminSecRuleARGS:name"@rxadmin""phase:1,log,deny,id:2012"测......
  • 寄生参数提取 Parasitic extraction
    在EDA中,寄生参数提取(寄生析出)是在设计设备和电子电路要求的线路相互连接着两者之间的寄生效应的计算,诸如寄生电容、寄生电阻、寄生电感等寄生效应的计算,一般地称之为寄生设备,寄生元件或者简称为寄生参量(寄生效应)。寄生参数提取的主要目的是创建电路的一个精确模拟模型,这样,详细的......
  • Visual Studio 2022工作原理及相关配置参数(干货满满)——C++
    最近工作有点忙,毕业也没多久,确实在企业和学校还是有很大的差距的,这段时间学到了很多很多,也没时间顾及博客了,刚好趁着这个1024稍微放慢脚步,总结总结。最近用VisualStudio比较频繁,也学到了很多相关的内容,借此博文简单记录一下,全是个人理解,若有地方理解有误还请各位大佬评论......
  • MongoDB-Plus
    MongoDB-Plus是一款功能强大的数据库工具,它基于MongoDB,提供了更丰富的功能和更便捷的操作方式。以下是一篇关于MongoDB-Plus轻松上手的详细指南,旨在帮助初学者快速掌握其安装、配置和基础操作。一、MongoDB-Plus概述MongoDB是一款由C++编写的分布式文档数据库,自2007年发......
  • MongoDB-Plus概述
    MongoDB-Plus是一款功能强大的数据库工具,它基于MongoDB,提供了更丰富的功能和更便捷的操作方式。以下是一篇关于MongoDB-Plus轻松上手的详细指南,旨在帮助初学者快速掌握其安装、配置和基础操作。一、MongoDB-Plus概述MongoDB是一款由C++编写的分布式文档数据库,自2007年发......
  • Day10 函数基础+函数三种定义形式 + 函数的返回值、对象和参数 + 可变长参数
    目录0上节课复习0.1文件是什么0.2操作文件的步骤0.3open0.4指针操作0.5文件的复制1函数基础1.1函数的作用1.2函数的定义形式1.3函数定义的两个阶段2定义函数的三种形式2.1无参函数2.2有参函数2.3空函数3函数的返回值4函数对象5函数参数的应用5.1函数定义分为两个......
  • 【WOA-CNN-LSTM】基于鲸鱼算法优化深度学习预测模型的超参数研究(Matlab代码实现)
     ......
  • python、JavaScript 、JAVA等实例代码演示教你如何免费获取股票数据(实时数据、历史数
    ​近一两年来,股票量化分析逐渐受到广泛关注。而作为这一领域的初学者,首先需要面对的挑战就是如何获取全面且准确的股票数据。因为无论是实时交易数据、历史交易记录、财务数据还是基本面信息,这些数据都是我们进行量化分析时不可或缺的宝贵资源。我们的核心任务是从这些数据......
  • GO:可变长参数和切片作为函数参数
    在Go语言中,可变函数参数(可变长参数)和切片作为函数参数是两个不同的概念,虽然它们都能处理多个元素,但它们的用途和处理方式有所不同。以下是它们之间的详细区别:1.可变函数参数(VariadicFunctionParameters)可变参数函数可以接受不定数量的参数,使用...运算符来定义。这些参数......