- In ChromeOS, launch the Terminal app (which opens a Shell inside the 'Penguin' Linux container inside the 'Termina' Linux VM)
- Run the following commands which are documented in the MongoDB Manual page on installing MongoDB Enterprise on Debian (following the manual's tab instructions titled “Debian 9 "Stretch”):
echo "deb http://repo.mongodb.com/apt/debian stretch/mongodb-enterprise/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
sudo apt-get update
sudo apt-get install -y mongodb-enterprise
- Start a MongoDB database instance running:
mongod --dbpath ~/data
- Launch a second Terminal window and then run the Mongo Shell against this database and perform a quick database insert and query test:
db.mycoll.insert({a:1})
db.mycoll.find()
db.mycoll.drop()
exit
- Install Python 3 and the PIP Python package manager (using Anaconda) and then install the MongoDB Python driver (PyMongo):
bash Anaconda3-*-Linux-x86_64.sh
source ~/.bashrc
python --version
pip --version
pip install --user pymongo
- Test PyMongo by running a small ‘payments data generator’ Python script pulled down from a GitHub repository (this should insert records into the MongoDB local database’s “fs.payments” collection; after letting it run for a minute, continuously inserting new records, press Ctrl-C to stop it):
cd PaymentsWriteReadConcerns/
./payments-records-loader.py -p 1
- Download MongoDB Compass (use the Ubuntu 64-bit 14.04+ version), install and run it against the 'localhost' MongoDB database and inspect the contents of the “fs.payments” collection:
sudo apt install ./mongodb-compass_*_amd64.deb
mongodb-compass
Song for today: Sun. Tears. Red by Jambinai
1 comment:
Just tested on latest version of ChromeOS & Linux it bundles at of 31-Oct-2020. This version now uses Debian 10 (Buster).
As a result, the changes to installation are:
* Follow this for installing MongoDB: https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-debian/ (choose Debian 10 "Buster" tab)
* Python3 is already installed, to see version run: $ python3 --version
* To install pip run: $ sudo apt install python3-pip
* To see pip version run: $ pip3 --version
* To install PyMongo run: $ pip3 install --user pymongo
Post a Comment