Skip to content

Commit 5a87f0f

Browse files
committed
MongoDB Solution
1 parent cb5b8bc commit 5a87f0f

File tree

4 files changed

+48
-3
lines changed

4 files changed

+48
-3
lines changed
81.1 KB
Loading

docs/.vuepress/sidebar-menus/learning.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,10 @@ export default [{
240240
children: [
241241
{ link: '/learning/solutions/database-management/index.md', text: 'Solution Summary' },
242242
{ link: '/learning/solutions/database-management/db-and-autodiag.md', text: 'Databases + Auto Diagnostics' },
243-
{ link: '/learning/solutions/database-management/postgres-reindex.md', text: 'Reindex PostgreSQL Database' },
244-
{ link: '/learning/solutions/database-management/postgres-backup-restore.md', text: 'Backup and Restore PostgreSQL' },
245-
{ link: '/learning/solutions/database-management/postgres-storedprocedure.md', text: 'Executing PostgreSQL Stored Procedures' },
243+
{ link: '/learning/solutions/database-management/postgres-reindex.md', text: 'PostgreSQL Reindex Database' },
244+
{ link: '/learning/solutions/database-management/postgres-backup-restore.md', text: 'PostgreSQL Backup and Restore' },
245+
{ link: '/learning/solutions/database-management/postgres-storedprocedure.md', text: 'PostgreSQL Executing Stored Procedures' },
246+
{ link: '/learning/solutions/database-management/mongo-example.md', text: 'MongoDB Executing Commands' },
246247
]
247248
},
248249
{

docs/learning/solutions/database-management/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ To see example content listed below check out the [Getting Started with Solution
2222
| <img src="/assets/img/postgres-logo.png" width="30" height="30"> [Postgres - Backup and Restore](/learning/solutions/database-management/postgres-backup-restore.md) |
2323
| <img src="/assets/img/postgres-logo.png" width="30" height="30"> [Postgres - Reindex a database](/learning/solutions/database-management/postgres-reindex.md) |
2424
| <img src="/assets/img/postgres-logo.png" width="30" height="30"> [Postgres - Execute a Stored Procedure](/learning/solutions/database-management/postgres-storedprocedure.md) |
25+
| <img src="/assets/img/mongodb-logo.png" width="30" height="30"> [MongoDB - Build an Example Database](/learning/solutions/database-management/postgres-storedprocedure.md) |
2526

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# MongoDB - Build an Example Database
2+
3+
This solution demonstrates how to use the MongoDB plugin in Rundeck through a practical example job. The example creates a sample database structure that you can use to test and learn MongoDB operations within Rundeck.
4+
5+
## Pre-requisites & Environment Setup
6+
7+
- Environment setup with active Enterprise Runner
8+
- MongoDB installed and accessible from your Enterprise Runner
9+
- MongoDB user with appropriate permissions for database operations
10+
- Password stored in KeyStorage (default path: keys/mongodb)
11+
- Be sure to select a runner before starting the job. No Runners are selected by default.
12+
13+
## MongoDB Plugin Overview
14+
15+
The MongoDB plugin allows you to execute MongoDB commands directly from Rundeck jobs. Each step in the job demonstrates different capabilities of the plugin:
16+
17+
### Key Plugin Parameters
18+
19+
For specific docs on these parameters check out the [Plugin documentation](/manual/jobs/job-plugins/workflow-steps/mongodb.md). The list below explains how the default job definition is configured.
20+
21+
- Database Deployment: Default "MongoDB". If you are using Atlas this will need to be changed.
22+
- MongoDB Server: Default "mongodb". The runner will use this DNS name to connect to the MongoDB Server. Adjust for your environment or ensure "mongodb" resolves to the host you want to connect to.
23+
- Database Name: Default "ecommerce_db".
24+
- Username: Default "admin". If you need to use a different user change this value
25+
- Password from Key Storage: Default "keys/mongodb". If the path to your stored MongoDB password in KeyStorage is different use the selection tool to pick it.
26+
- MongoDB Command: The MongoDB command the step will execute
27+
28+
## Example Job Structure
29+
30+
The example job demonstrates these operations in sequence, creating a sample e-commerce database:
31+
32+
1. Database cleanup/creation
33+
2. Collection creation
34+
3. Sample data insertion
35+
4. Index creation
36+
5. Verification query
37+
38+
## Troubleshooting
39+
40+
Common issues and their solutions:
41+
42+
- **Connection Failures:** Verify MongoDB host accessibility from the Enterprise Runner
43+
- **Authentication Errors:** Check user permissions and KeyStorage path

0 commit comments

Comments
 (0)