0% found this document useful (0 votes)
12 views13 pages

BDCN Unit 2 Learning Outcome 2

Un proyecto de Base de datos en la nube

Uploaded by

humberto739508
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views13 pages

BDCN Unit 2 Learning Outcome 2

Un proyecto de Base de datos en la nube

Uploaded by

humberto739508
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

LEARNING OUTCOME:

“INSTALLATION AND CONFIGURATION OF NOSQL


SERVERS”

TÉCNICO SUPERIOR UNIVERSITARIO EN


TECNOLOGÍAS DE LA INFORMACIÓN
AREA: DESARROLLO DE SOFTWARE
MULTIPLATAFORMA
PRESENTS:

HUMBERTO MISAEL ARAGUZ CRUZ

CT. REYNOSA, TAMAULIPAS JUNE 2024.


Table of contents

Subject Page

Table of contents .................................................................................................. i

Index of figures ................................................................................................... iii

Introduction ......................................................................................................... 1

MongoDB configuration ...................................................................................... 1

Installation ....................................................................................................... 1

Configuration file (mongod.conf) ..................................................................... 1

Starting MongoDB ........................................................................................... 2

User access configuration ................................................................................... 3

Creating users ................................................................................................. 3

Authentication.................................................................................................. 3

Assigning and revoking privileges ....................................................................... 4

Assigning roles ................................................................................................ 4

Revoking roles................................................................................................. 5

Activating and configuring database monitoring ................................................. 5

MongoDB monitoring tools .............................................................................. 5

Enabling profiling ............................................................................................. 5

Monitoring with MMS (MongoDB Management Service) ................................. 6

Cluster configuration ........................................................................................... 6

Setting up a sharded cluster ............................................................................ 6

Steps ............................................................................................................... 6

i
Performance tests ............................................................................................... 8

Benchmarking tools: ........................................................................................ 8

Example YCSB usage ..................................................................................... 8

Metrics to Consider ......................................................................................... 9

Conclusion .......................................................................................................... 9

ii
Index of figures

Figure Page

Figure 1 Configuration Example.......................................................................... 2


Figure 2 Starting MongoDB ................................................................................ 2
Figure 3 Create a new user ................................................................................ 3
Figure 4 Enable authentication ........................................................................... 4
Figure 5 Connecting to MongoDB Shell as an admin ......................................... 4
Figure 6 Giving a role.......................................................................................... 4
Figure 7 Revoking a role ..................................................................................... 5
Figure 8 Set profiling level .................................................................................. 6
Figure 9 Step 1 ................................................................................................... 7
Figure 10 Step 2 ................................................................................................. 7
Figure 11 Step 3 ................................................................................................. 7
Figure 12 Step 4 ................................................................................................. 7
Figure 13 Step 5 ................................................................................................. 8
Figure 14 Step 6 ................................................................................................. 8
Figure 15 Loading data ....................................................................................... 9
Figure 16 Run workload ...................................................................................... 9

iii
Introduction

NoSQL databases have gained popularity due to their flexibility, scalability, and
ability to handle large volumes of unstructured data. This report focuses on the
installation, configuration, and performance testing of a NoSQL database server,
specifically MongoDB, which is a widely used NoSQL database.

MongoDB configuration

Installation

• Download MongoDB from the official website or use a package manager.


• Follow the installation instructions specific to your operating system.

Configuration file (mongod.conf)

• The main configuration file for MongoDB is mongod.conf.


• Common configurations include setting the bindIp, port, storage, and
systemLog options.
• Example configuration:

1
storage:

dbPath: /var/lib/mongo
systemLog:

destination: file

path: /var/log/mongodb/mongod.log

logAppend: true

net:

bindIp: 127.0.0.1

port: 27017

Figure 1 Configuration Example

Starting MongoDB

Start MongoDB using the command:

mongod --config /etc/mongod.conf

Figure 2 Starting MongoDB

2
User access configuration

Creating users

1. Access the MongoDB shell:

• mongo

2. Switch to the “admin” database:

• use admin

3. Create a new user with specific roles:

Figure 3 Create a new user

Authentication

Enable authentication by adding “security.authorization” to “mongod.conf”:

3
Figure 4 Enable authentication

Restart MongoDB to apply changes.

Assigning and revoking privileges

Assigning roles

Connect to MongoDB shell as an admin:

Figure 5 Connecting to MongoDB Shell as an admin

Grant a role to a user:

Figure 6 Giving a role

4
Revoking roles

Revoke a role from a user:

Figure 7 Revoking a role

Activating and configuring database monitoring

MongoDB monitoring tools

• mongostat: Provides real-time statistics of MongoDB server.


• mongotop: Shows the time a MongoDB instance spends reading and writing
data.

Enabling profiling

Set profiling level for a database:

5
Figure 8 Set profiling level

Monitoring with MMS (MongoDB Management Service)

• Create an account on MongoDB Atlas (cloud-based).


• Deploy and monitor your MongoDB instances.

Cluster configuration

Setting up a sharded cluster

Components:

• Shard Servers
• Config Servers
• Query Routers (mongos)

Steps

Start Config Servers:

6
Figure 9 Step 1

Initiate Config Server Replica Set:

Figure 10 Step 2

Start Shard Servers with replica sets:

Figure 11 Step 3

Initiate Shard Replica Set:

Figure 12 Step 4

Start Query Routers:

7
Figure 13 Step 5

Add Shards to Cluster:

Figure 14 Step 6

Performance tests

Benchmarking tools:

• sysbench: A versatile benchmarking tool that can be used for MongoDB.


• YCSB (Yahoo! Cloud Serving Benchmark): Specifically designed for NoSQL
databases.

Example YCSB usage

Load data:

8
Figure 15 Loading data

Run workload:

Figure 16 Run workload

Metrics to Consider

• Throughput (operations per second)


• Latency (average, min, max)
• Resource Utilization (CPU, Memory)

Conclusion

The successful installation and configuration of a NoSQL database, such as


MongoDB, involve several critical steps including setting up user access,
managing privileges, enabling monitoring, configuring for high availability with
clusters, and performing thorough performance testing. By following the
procedures outlined in this report, an optimized and secure NoSQL database
environment can be established, capable of handling large-scale data processing
and storage requirements.

You might also like