I'm trying to teach myself more Mongo, so here's my quick notes on how I installed it, configured it and run a benchmark using YSCB (Yahoo! Cloud System Benchmark).

Installing Mongo:

1. Add the Mongo repository file /etc/yum.repos.d/mongodb-org-3.4.repo:

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

2. Install Mongo:

yum -y install mongodb-org

3. Check that the system limits are adjusted in /etc/systemd/system/multi-user.target.wants/mongod.service with:

grep Limit /etc/systemd/system/multi-user.target.wants/mongod.service

Sample output:

LimitFSIZE=infinity
LimitCPU=infinity
LimitAS=infinity
LimitNOFILE=64000
LimitNPROC=64000

Mongo's recommendations are here: docs.mongodb.com/manual/reference/ulimit/ - scroll down to: "Linux distributions using systemd"

4. Enable and start Mongo:

systemctl enable mongod
systemctl start mongod

Installing YSCB (Yahoo! Cloud System Benchmark):

YSCB requires Java. Let's install it:

1. Download Java:

yum -y install java-1.8.0-openjdk

2. Set up the necessary paths for Java:

cd /tmp
java=`find /usr/lib/jvm/ja*/j* -maxdepth 0 -type d`
export JAVA_HOME=/usr/lib/jvm$java
export PATH=$PATH:$JAVA_HOME/bin/

3. Download YSCB:

cd /tmp
curl -O --location https://github.com/brianfrankcooper/YCSB/releases/download/0.12.0/ycsb-0.12.0.tar.gz
tar xfvz ycsb-0.12.0.tar.gz
cd ycsb-0.12.0

4. Load the data to prepare for the test - the default is only for 1000 records:

./bin/ycsb load mongodb-async -s -P workloads/workloada

5. Run the actual test:

./bin/ycsb run mongodb-async -s -P workloads/workloada

6. Cleanup before running another test:

mongo ycsb --eval "db.dropDatabase()"

7. Run a test with more data - the `workloada` above only uses 1000 records - this one has 100k records - load the data first:

./bin/ycsb load mongodb -s -P workloads/workloada -p recordcount=100000 -threads 8

8. Run the actual test, with 100k operations and 2 threads:

./bin/ycsb run mongodb-async -s -P workloads/workloada -p operationcount=100000 -threads 2

9. Don't forget to clean up:

mongo ycsb --eval "db.dropDatabase()"

SOURCES: