Quick links | Ubuntu 22.04 | Connect to MongoDB | Work with mongo | Import and restore
MongoDB backup methods from official documentation:
Back Up with Atlas MongoDB Atlas, the hosted MongoDB service option in the cloud. Back Up with MongoDB Cloud Manager or Ops Manager: https://www.mongodb.com/docs/manual/core/backups/#mms https://www.mongodb.com/docs/manual/core/backups/#ops-manager With Ops Manager, MongoDB subscribers can install and run the same core software that powers MongoDB Cloud Manager on their own infrastructure. Back Up by Copying Underlying Data Files Back Up with Filesystem Snapshots Back Up with cp or rsync Back Up with mongodump Let’s consider back up with mongodump!
Quick links | Ubuntu 22.04 | Mongo import | Mongo export
Prepare a mongo server instance:
1 2 3 docker run --rm --name mongo -d mongo:6 docker exec -it -w /root mongo bash apt update && apt -y install curl less jq We are in the container, so all command will run from root!
Import MongoDB is one of the most popular NoSQL database engines. For our test we can take the most popularsample MongoDB database about restaurants:
| Windows Server 2019
Run Powershell as an administator and generate private and public keys 1 ssh-keygen -trsa -b2048 Check that files exists 1 ls $env:USERPROFILE\.ssh Add public key 1 type $env:USERPROFILE\.ssh\id_rsa.pub | ssh root@192.168.131.10 "cat >> .ssh/authorized_keys" Check connect without password 1 ssh root@192.168.131.10 Check that commands are runned 1 ssh root@192.168.131.10 "cat /etc/*release" Put the file into /tmp 1 scp "$env:USERPROFILE\.ssh\id_rsa.pub" "root@192.168.131.10:/tmp/" Put several files into /tmp 1 2 3 scp -r "C:\tmp" "root@192.
Quick links | Windows
Download zss-file nssm from http://nssm.cc/download, unpack it into C:\nssm Run C:\nssm\win64\nssm.exe and choose, any binary, for example traefik.exe Open these ports in windows firewall Powershell commands for widnows firewall
1 2 3 4 5 6 7 New-NetFirewallRule -Name 'tcp80' -DisplayName 'tcp80' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 80 New-NetFirewallRule -Name 'tcp443' -DisplayName 'tcp443' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 443 Get-NetFirewallRule -DisplayName tcp80 Get-NetFirewallRule -Name tcp80 Get-NetFirewallPortFilter | Where-Object -Property LocalPort -EQ 80 Remove-NetFirewallRule -Name tcp80
Quick links | Centos 7.9
Ok, let’s start with linux. I’m using a bin file, so I want to check using traefik’s options in yaml files. Get a binary and run it:
1 2 3 4 5 6 7 8 curl -LO https://github.com/traefik/traefik/releases/download/v2.9.8/traefik_v2.9.8_linux_amd64.tar.gz tar -zxf traefik_v2.9.8_linux_amd64.tar.gz traefik ./traefik version Version: 2.9.8 Codename: banon Go version: go1.19.6 Built: 2023-02-15T15:23:25Z OS/Arch: linux/amd64 Traefik releases
Disable selinux:
1 2 3 4 5 getenforce Enforcing sudo setenforce 0 grep SELINUX= /etc/sysconfig/selinux | grep -v "^#" SELINUX=disabled Install nginx and apache.
Quick links | Docker | Linux | Minica | API
Run for Windows: Minio wrote on golang, so we need only get binary file and run it, according official docs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 .\minio.exe server C:\minio --console-address :9001 Formatting 1st pool, 1 set(s), 1 drives per set. WARNING: Host local has more than 0 drives of set.