Code Monkey home page Code Monkey logo

mongodb-cluster-tls's Introduction

Social-Contract

MongoDB-Cluster-TLS

MongoDB-Cluster-TLS Β· GitHub license TLS MongoDB Docker LinkedIn Telegram

This repository contains the configuration for deploying a NoSQL cluster of a MongoDB database with sharding and replication. Connections between all shards in a replica are authenticated using x509 certificates and communicate with each other over a TLS connection. Communication between replicas occurs in a similar way. Communications with Config Server and MongoS are protected in a similar way. The client side connection to MongoS is protected in a similar way.

This project automatically deploys a MongoDB cluster in Docker containers, creates its own certificate authority, generates and distributes authentication keys and keys for a TLS connection for each element of the MongoDB cluster, as well as for a client that will connect to MongoS. The cluster consists of a MongoS router, three Config Server, three replicas, each with 3 shards.

The general scheme of the MongoDB cluster is shown in the image:

πŸ’» Getting Started

Step 1

  1. Go to home directory and clone repository from github: cd ~ && git clone https://[email protected]/SergeyIvanovDevelop/MongoDB-Cluster-TLS

Step 2

  1. Go to the directory of the downloaded repository: cd ~/MongoDB-Cluster-TLS

Step 3

  1. You must have installed openssl, docker, docker-compose and MongoDB.

Step 4

  1. You need to build Docker images/containers and generate keys: ./run_all.sh build

Step 5

  1. You need to recreate/run Docker containers: ./run_all.sh run

Step 6

  1. Check the connection from the client with MongoS: ./connect_tls_to_mongos.sh

If you manage to enter the MongoDB command line, then everything is done correctly and the cluster is functioning correctly.

Mongodb logs from Docker containers can be viewed in the shared folder SHARE_WITH_ALL_DOCKER_CONTAINERS.

Note: Since this project is a demo, it was decided to put the test generated private keys in the github repository as well (of course, you can’t upload non-test keys) to visualize the whole picture to the person who will use this project for their personal developments

πŸ“‘ Licence

MongoDB-Cluster-TLS is CC BY-NC-SA 3.0 licensed.

mongodb-cluster-tls's People

Contributors

sergeyivanovdevelop avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.