Wednesday, September 15, 2021

BCryptHash could not be located - MongoDB

 When you try to start mongodb using "mongod.exe" you might get this error relating to 'BCryptHash"

This error comes cause of mongodb version does not support to your windows or OS of the machine. If you are using windows server, check whether it is compatible with your server version

you  can find the compatibility with below link

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#platform-support

 

Import certificate to java Key store

 you can use keytool  to install a certificate to keystore. This is needed as eg: when you access a details from Jira site you need to install certificate of jira site to your local java key store.

Let's  say you need to extract details from your Jira production server.

1. save the certificate of the site via browser. you can click the lock sign left with the address bar.


 after that Click Certificate

Go to "Details" tab 

and Click "Copy to File"

let's assume you save the certificate as "jiraProd.cer". Note: cer extension will  automatically given when saving.

2. install certificate use below command

keytool -import -alias jiraProd -keystore "C:\SW\openlogic-openjdk-11\lib\security\cacerts" -file C:\SW\Certs\jiraProd.cer

keytool - tool use to import certicate

alias name given as "jiraProd " . you can verify your certificate after installation by this name

-alias jiraProd   

path to the keysore file

-keystore "C:\SW\openlogic-openjdk-11\lib\security\cacerts"     

 your certificate file or path to certificate file

-file C:\SW\Certs\jiraProd.cer

Install MongoDB in ubuntu

 when you take a specific version of MongoDB, it does not support all the operating systems as a whole.

1. So we need to check the compatibility before.

2. Once find out the correct version suitable for your OS, you can start installing


Below are short steps to install mongo in Ubuntu 18.04 Bionic version.

1. Import the public key used by the package management system.

wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -


2. Create a list file for MongoDB

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list

3. Reload local package database

sudo apt-get update

4.Install the MongoDB packages

sudo apt-get install -y mongodb-org

5. Start MongoDB service

 before start service, check whether linux use "systemd" or "init" --> run below

ps --no-headers -o comm 1

to run mongodb

sudo systemctl start mongod

6. Add mondb service to start at restart

sudo systemctl enable mongod


For more info, you can follow

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/