Skip to content

Update README.md #1863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,21 @@ See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/
## Usage
1. Generic requirements
- MR_CONFIG_DIR variable has to be set to a directory, where configuration and log files are/will be stored
- JDK 21 (it can be Oracle or OpenJDK)
- Oracle JDK can be downloaded from the following link: https://www.oracle.com/java/technologies/downloads/#java21
- OpenJDK is usually available in a Linux packates repository, but also can be downloaded and installed independly from the following link: https://openjdk.org/

1.MDBExtractor
requirements:
- Source MongoDB instance up and running
- Profiling at the MongoDB instance
- to extract data from traditional Mongod log file, there is need to enable logging so called slow operations at the Mongod instance level. It can be done by executing the following command:

db.setProfilingLevel(0, -1)
db.setProfilingLevel(0, -1)
- to extract data from db.system.profile collection or its dump there is need to enable traditional profiling, by executing the following command:

db.setProfilingLevel(2)

- The following configuration file $MR_CONFIG_DIR/MDBExtractConfig.json needs to be existing with the following parameters

OUTPUT_DIR : optional; points to directory where output files will be created;
Expand All @@ -41,6 +48,12 @@ See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/
INPUT_FILE : optional; points to an input log file generated by a MongoDB Instance with profiling enabled
if this parameter is not set, then MDBExtractor will read data from standard input

INPUT_FILE_FORMAT : optional; provides information about from which file the data will be read. It accepts two values
MONGO_LOG : in that case Extractor will be reading data from traditional Mongod log file. Profiling needs to be set to (0,-1)
MONGO_PROFILE : in that case Extractor will be reading data from dump of db.system.profile collection. Profiling needs to be set to (2)

INPUT_CONNECT_STRING : optional; if set then it points to a MongoDB instance, from which input data will be read directly. Profiling needs to be set to (2). When this parameter is set, then INPUT_FILE and INPUT_FILE_FORMAT cannot be set.

COMMANDS_LOGGING : optional; default value "true", if set to "true" then every command found by the extractor will be
additional logged with console.log(...). Useful, when output will be processed by mongosh tool, which
has limited capabilities related to error reporting. When set to "false" only commands will be reported.
Expand Down