Skip to content

Commit 5734a58

Browse files
committed
Update MongoDB Learning Path
1 parent 517bbce commit 5734a58

File tree

3 files changed

+46
-42
lines changed

3 files changed

+46
-42
lines changed

content/learning-paths/servers-and-cloud-computing/mongodb/_index.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
title: Analyze the performance of MongoDB on Arm servers
33

4-
draft: true
5-
cascade:
6-
draft: true
7-
84
author_primary: Pareena Verma
95

106
minutes_to_complete: 30
@@ -15,7 +11,7 @@ learning_objectives:
1511
- Measure and compare the performance of MongoDB on Arm versus other architectures with Yahoo Cloud Serving Benchmark (YCSB).
1612

1713
prerequisites:
18-
- An Arm based instance from a cloud service provider. The recommended YCSB configuration requires 3 Arm servers.
14+
- An Arm based instance from a cloud service provider.
1915

2016
armips:
2117
- Neoverse

content/learning-paths/servers-and-cloud-computing/mongodb/automate_setup_pulumi.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ title: "Automate MongoDB Performance Benchmarking Infrastructure Setup with Pulu
44

55
weight: 8 # (intro is 1), 2 is first, 3 is second, etc.
66

7-
draft: true
8-
97
# Do not modify these elements
108
layout: "learningpathall"
119
---

content/learning-paths/servers-and-cloud-computing/mongodb/replica.md

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# User change
33
title: "Run YCSB using a 3 node replica set"
44

5+
draft: true
6+
57
weight: 5 # (intro is 1), 2 is first, 3 is second, etc.
68

79
# Do not modify these elements
@@ -10,7 +12,7 @@ layout: "learningpathall"
1012

1113
The recommended MongoDB YCSB test setup is a relica set containing three nodes of equal size. The primary node is the node you send the YCSB traffic to and the others are secondary nodes.
1214

13-
## What is a replica Set?
15+
## What is a replica set?
1416

1517
A replica set is a group of instances that maintain the same data set. A replica set contains many nodes, but 3 nodes are used for testing.
1618

@@ -28,6 +30,48 @@ Install MongoDB on each node using the previously provided instructions.
2830

2931
Select 1 instance as the primary node and install YCSB on the instance.
3032

33+
## Initialize the replica set
34+
35+
1. Set variables with the IP addresses of each node:
36+
37+
```bash
38+
PRIMARY_NODE_IP="<primary-node-ip>"
39+
SECONDARY_NODE1_IP="<secondary-node1-ip>"
40+
SECONDARY_NODE2_IP="<secondary-node2-ip>"
41+
```
42+
43+
2. Connect to the primary node using the MongoDB shell:
44+
45+
```bash
46+
mongosh --host <primary-node-ip>:27017
47+
```
48+
49+
3. Initialize the replica set with the following command:
50+
51+
```bash
52+
PRIMARY_NODE_IP="<primary-node-ip>"
53+
SECONDARY_NODE1_IP="<secondary-node1-ip>"
54+
SECONDARY_NODE2_IP="<secondary-node2-ip>"
55+
56+
mongosh --host $PRIMARY_NODE_IP:27017 <<EOF
57+
rs.initiate({
58+
_id: "rs0",
59+
members: [
60+
{ _id: 0, host: "$PRIMARY_NODE_IP:27017" },
61+
{ _id: 1, host: "$SECONDARY_NODE1_IP:27017" },
62+
{ _id: 2, host: "$SECONDARY_NODE2_IP:27017" }
63+
]
64+
})
65+
EOF
66+
```
67+
68+
3. Verify the replica set status:
69+
70+
```bash
71+
mongosh --host $PRIMARY_NODE_IP:27017 <<EOF
72+
rs.status()
73+
EOF
74+
```
3175
3276
## Modify the MongoDB configuration
3377
@@ -91,40 +135,6 @@ setParameter:
91135
92136
If you want to use encryption you will need to add the security and keyFile to your configuration. As well as change some of the parameters in the `mongod.conf` file.
93137
94-
## Initialize the replica set
95-
96-
1. Connect to the primary node using the MongoDB shell:
97-
98-
```bash
99-
mongo --host <primary-node-ip>:27017
100-
```
101-
102-
2. Initialize the replica set with the following command:
103-
104-
```bash
105-
PRIMARY_NODE_IP="<primary-node-ip>"
106-
SECONDARY_NODE1_IP="<secondary-node1-ip>"
107-
SECONDARY_NODE2_IP="<secondary-node2-ip>"
108-
109-
mongo --host $PRIMARY_NODE_IP:27017 <<EOF
110-
rs.initiate({
111-
_id: "rs0",
112-
members: [
113-
{ _id: 0, host: "$PRIMARY_NODE_IP:27017" },
114-
{ _id: 1, host: "$SECONDARY_NODE1_IP:27017" },
115-
{ _id: 2, host: "$SECONDARY_NODE2_IP:27017" }
116-
]
117-
})
118-
EOF
119-
```
120-
121-
3. Verify the replica set status:
122-
123-
```bash
124-
mongo --host $PRIMARY_NODE_IP:27017 <<EOF
125-
rs.status()
126-
EOF
127-
```
128138
129139
## Recommended Tests on MongoDB
130140

0 commit comments

Comments
 (0)