MongoDB - How to use setParameter inside a configuration file - mongodb

I'm trying to set a custom value for the logLevel parameter to my MongoDB installation. The standard way to do it seems to pass a --setParameter argument to the mongod.exe executable.
But I read the Configuration File Options page, and it indicates that it is possible to include the setParameter within a configuration file.
What's the syntax in this case?

As of MongoDB 2.4, there are now version-specific online manuals for MongoDB. If you look at the navigation at the top left of the page, you should see a dropdown with available manual versions (eg. "2.4 (current)" or "2.2"). The default manual matches the current stable production release.
The setParameter configuration syntax is new to 2.4 (and noted as such in the 2.4 manual).
The historical syntax for setting logLevel/verbosity is to use an increasing number of vs (for verbosity, aka --verbose). So v is loglevel 1, vv is loglevel 2, and so on.
This config setting will work in MongoDB 2.2 and older versions as well as MongoDB 2.4:
// Set verbosity to logLevel 3:
vvv = true
In general you won't want to set a logLevel higher than 1 unless trying to collect information for troubleshooting purposes. The normal level of logging verboseness is 0; higher levels can generate a lot of logging details.

Related

How to add changes for NO ENCRYPT DB2 option to db2RestoreStruct

I am trying to restore encrypted DB to non-encryped DB. I made changes by setting piDbEncOpts to SQL_ENCRYPT_DB_NO but still restore is being failed. Is there db2 sample code is there where I can check how to set "NO Encrypt" option in DB2. I am adding with below code snippet.
db2RestoreStruct->piDbEncOpts->encryptDb = SQL_ENCRYPT_DB_NO
The 'C' API named db2Restore will restore an encrypted-image to a unencrypted database , when used correctly.
You can use a modified version of IBM's samples files: dbrestore.sqc and related files, to see how to do it.
Depending on your 'C' compiler version and settings you might get a lot of warnings from IBM's code, because IBM does not appear to maintain the code of their samples as the years pass. However, you do not need to run IBM's sample code, you can study it to understand how to fix your own C code.
If installed, the samples component must match your Db2-server version+fixpack , and you must use the C include files that come with your Db2-server version+fixpack to get the relevant definitions.
The modifications to IBM's samples code include:
When using the db2Restore API ensure its first argument has a value that is compatible with your server Db2-version-and-fixpack to access the required functionality. If you specify the wrong version number for the first argument, for example a version of Db2 that did not support this functionality, then the API will fail. For example, on my Db2-LUW v11.1.4.6, I used the predefined db2Version1113 , like this:
db2Restore(db2Version1113, &restoreStruct, &sqlca);
When setting the restore iOptions field: enable the flag DB2RESTORE_NOENCRYPT, for example, in IBM's example, include the additional flag: restoreStruct.iOptions = DB2RESTORE_OFFLINE | DB2RESTORE_DB | DB2RESTORE_NODATALINK | DB2RESTORE_NOROLLFWD | DB2RESTORE_NOENCRYPT;
Ensure the restoredDbAlias differs from the encrypted-backup alias name.
I tested with Db2 v11.1.4.6 (db2Version1113 in the API) with gcc 9.3.
I also tested with Db2 v11.5 (db2Version11500 in the API) with gcc 9.3.

Quarkus 2.0 mongodb with devServices option

I have quarkus2.0 application running with mongodb database.
To run my tests, I am depending on devServices option if I am not configuring quarkus.mongodb.connection-string for test profile Quarkus will start mongod docker container for tests.
Issue I have how to pass mongodb connection string options (ex: uuidRepresentation=standard). I am using uuidRepresentation=standard option for application.
Connection-String format as per below:
mongodb://username:password#localhost:27017/dbname?authSource=admin&uuidRepresentation=standard
Have you tried the property 'quarkus.mongodb.devservices.properties' ?
I did not try it but sound like the way to go for your use case. It's avaiable on the 2.1.0 (at least, did not check with 2.0)
Yaml configuration example:
"%dev":
quarkus:
mongodb:
devservices:
properties:
uuidRepresentation: standard

gfsh echo --string=${SYS_USER} couldn't obtain the current value of the existing variable

Useful gfsh Shell Variables says gfsh>echo --string=${VARIABLE} could obtain the current value of the existing variable. But in my environment it couldn't.
e.g.:
echo --string=${SYS_USER} displayed ${SYS_USER}
gfsh>echo --string=$* could display a list of all gfsh shell variables and their current values in my environment(Apache Geode 1.5.0).
I encountered the same issue with Geode 1.6 and GemFire 9.x (multiple versions). EchoCommand.java has $* coded as a special case, but does not cover the other cases. I submitted JIRA GEODE-5531.

How to check the current configuration of MongoDB

I've found documentation for the different configuration options, but how can I check which options are being used on a live system?
Is there a way to see which options were set, or at minimum which configuration file is being used?
Found the answer: https://stackoverflow.com/a/9361047/947305
There's a getCmdLineOpts command in the mongo shell. Run the following:
db._adminCommand( {getCmdLineOpts: 1})
to get live settings, you can use
db.adminCommand({getParameter:"*"})
previously called _adminCommand with underscore in front, so if you
have old mongo running, try that one.
https://docs.mongodb.com/manual/reference/command/getParameter/
To know the current configuration file, you can try:
cat(db._adminCommand({getCmdLineOpts: 1}).parsed.config);
The method returns with output relative to the current shell session
and does not impact the server.

Cannot get Glassfish to log my apps debuug level logs

I am using commons-logging swith the following commons-logging.properties:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
I have set my app logger to FINEST in GF4 ui management console but it only logs INFO messages. Any ideas why?
Also where is it more appropriate to set my log levels, under server-config or default-config?
Thanks
I managed to find the answer in Oracle's documentation. GF3 (and apparently GF4) set the min level to the root level to INFO. The global log settings must be changed in GF props file: logging.properties which is usually under the domain/conf directory
http://docs.oracle.com/cd/E19798-01/821-1751/ghmep/index.html