This will guide you through setting up a replica set in a docker environment using.
- Docker Compose
- MongoDB Replica Sets
- Mongoose
- Mongoose Transactions
Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!
| # Create .NET Framework 4.0 32-bit hive and enable strong TLS encryption | |
| New-Item 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -Force | Out-Null | |
| New-ItemProperty -path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -name 'SystemDefaultTlsVersions' -value '1' -PropertyType 'DWord' -Force | Out-Null | |
| New-ItemProperty -path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -name 'SchUseStrongCrypto' -value '1' -PropertyType 'DWord' -Force | Out-Null | |
| # Create .NET Framework 4.0 64-bit hive and enable strong TLS encryption | |
| New-Item 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -Force | Out-Null | |
| New-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -name 'SystemDefaultTlsVersions' -value '1' -PropertyType 'DWord' -Force | Out-Null | |
| New-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -name 'SchUseStrongCrypto' -value '1' -PropertyType 'DWord' -Force | Out-Null | |
| # Create SCHANNEL Server hive (listenting to TLS connections |
This will guide you through setting up a replica set in a docker environment using.
Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!
| version: "3" | |
| services: | |
| mongo1: | |
| hostname: mongo1 | |
| container_name: localmongo1 | |
| image: mongo:4.0-xenial | |
| expose: | |
| - 27017 | |
| ports: | |
| - 27011:27017 |
#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.
To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.
##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application
| .PHONY: help | |
| help: | |
| @printf "%s\n" "Useful targets:" | |
| @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m make %-15s\033[0m %s\n", $$1, $$2}' | |
| .PHONY: db-reset | |
| db-reset: ## Reset the database | |
| docker-compose exec web flask db reset --with-testdb | |
| .PHONY: routes |
| --- | |
| - name: Creating a Volume | |
| hosts: localhost | |
| become: yes | |
| tasks: | |
| - name: Creating a Volume | |
| ec2_vol: | |
| aws_access_key: "{{ lookup('env', 'AWS_ACCESS_KEY_ID') }}" | |
| aws_secret_key: "{{ lookup('env', 'AWS_SECRET_ACCESS_KEY') }}" | |
| instance: '<instance-id>' |
| #!/bin/bash | |
| USER=${1:-sebble} | |
| STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-) | |
| PAGES=$((658/100+1)) | |
| echo You have $STARS starred repositories. | |
| echo |