Thursday, May 28, 2020

How To Install WiredTiger Command Line Tool To Fix MongoDB Collections

If you use MongoDB database and have had issue with corrupted WiredTiger collection (table) you may need to download and install WiredTiger command line tool to repair / salvage / verify etc... your MongoDB Collection file.

This guide will help you install 'wt' (wiredtiger) command line utility tool for using it with MongoDB database.

STEP 1 - UPDATE YOUR APT

sudo apt-get update

STEP 2 - DOWNLOAD SOURCE FILE + EXTRACT IT

wget http://source.wiredtiger.com/releases/wiredtiger-2.7.0.tar.bz2
tar xvf wiredtiger-2.7.0.tar.bz2

STEP 3 - INSTALL GOOGLE SNAPPY (LIBRARY FILES)

apt-get install libsnappy-dev build-essential

STEP 4 - COMPILE AND MAKE 'wt' 

./configure --enable-snappy && make


STEP 5 - TEST 'wt'

after you are done with all the steps, you should be able to just execute 'wt' by typing the following command and should see results similar to below:

root@testserver:/usr/local/src/wiredtiger-2.7.0# ./wt
WiredTiger Data Engine (version 2.7) global options:
 -C wiredtiger_open configuration
 -h database directory
 -L turn logging off for debug-mode
 -R run recovery if configured
 -V display library version and exit
 -v verbose
commands:
 backup   database backup
 compact   compact an object
 copyright copyright information
 create   create an object
 drop   drop an object
 dump   dump an object
 list   list database objects
 load   load an object
 loadtext   load an object from a text file
 printlog  display the database log
 read   read values from an object
 rename   rename an object
 salvage   salvage a file
 stat   display statistics for an object
 upgrade   upgrade an object
 verify   verify an object
 write   write values to an object





No comments:

Post a Comment