Monitor Containers using cAdvisor

Hi Techrunnr, This document deals with the we looked into how we can use the API built into our containers to gain an insight to what resources our containers are running. Here we are using cAdvisor (Container Advisor) from google to collect the metrics of our containers. cAdvisor running daemon that collects, aggregates, processes, and exports information about running containers cAdvisor written in go language, we can compile our own binary file as well as already compiled file in container, which is already available in Google docker hub Once installation…

Read More

Clear Mysql ibdata1

Hi Techrunnr, this document deals with How to shrink ibdata1 file in /var/lib/mysql/. By default ibdata1 file in /var/lib/mysql/ normally consists of 4 types of data Table Data Table Indexes MVCC (Multi versioning Concurrency Control) Data Table Metadata Follow the below steps to shrink the ibdata1 Take the dump of all the databases Stop mysql service Now we will remove the ibdata1, ib_logfile0, ib_logfile1 Add the below content to the my.cnf file Start the mysql service ibdata1 contains table information, so we have deleted this file, so databases will be…

Read More

Ansible playbook for MongoDB Replication setup on CentOS7

Hi Techrunnr, this post is regarding mongoDB installation and replica setup with HA using ansible on CentOS7 Prerequisites: 3 servers with CentOS7 operating system Deploy 3 servers in 3 different AZ Python on 3 nodes Ansible on execution server Enable Security groups on each server to communicate with each other Create 3 servers on different AZ Lets say server A <IP1>, server B <IP2>, server C <IP3>, make sure that security groups are enable to allow traffic from each other Edit the /etc/hosts file in 3 nodes, add the IP…

Read More

Copy s3 bucket contents to another

Hi Techrunnr, this post is regarding copy the contents of s3 bucket to another using aws cli, let’s say we have some contents in bucket1, we want to take daily basis backup to another bucket and we want to maintain a directory structure as month and day basis, so here we go prerequisites: AWS CLI installed AWS Access key and secret key and your account should be able to access both the bucket Login to aws account using below commands: We will create folder with today’s date in the script…

Read More

dockerisation of monogdb replica and HA

Hi Techrunnr, this document is related dockerising mongodb with replication setup and HA HA (High availability) refers to improvement of system and app availability by minimising the down time for usual maintenance of system and as well as application and system crash (unplanned). This post specifically talk about the mongoDB replication setup and HA with docker, this is a master-salve architecture Master: The master node can both read and write data. When handling modified data, the op-log will synchronise the updates to all the connected slave nodes. Slave: The slave node…

Read More

reset mongodb password

  Hi Techrunnr, this document deals with reset password and authentication setup of mongoDB, this document helps you to work with when you forget mongodb user (include super user too) credentials For MongoDB authentication setup please go through the our blog link: https://www.techrunnr.com/mongodb-create-user-authentication-setup-and-mongo-dump/ To reset the mongodb authentication setup, first we need to edit the mongod.conf file, authentication setup block looks like as shown below Now we need to disable this authentication setup Restart the mongod service Now login to mongodb, and create a super user or else a normal…

Read More

htpasswd with Nginx

nginx

  Hi All, this document deals with the web page security using  Prerequisites we use this is found in the apache- package Now we create a password file, for the first time we need to use -C option to create the specified file, We mention the user name at the end of the command, it will prompt to enter password If you want to add another new user then remove -c Now we are going to mention the file into the configuration, mention the file location as show below (In…

Read More

Grafana reverse proxy setup with Nginx

Hi Techrunnr, this document deals with Grafana reverse proxy setup  Prerequisites Check the Nginx status Now we are going to edit the configuration file (/etc/nginx/nginx) to the reverse proxy, Remember that Grafana runs on port number: 3000, set up reverse proxy add below lines to the file Now start the , and open to http://localhost:3000 It should be straight forward to and running behind , but you need make some changes in the serverdomain block in configuration file (/etc//grafana.ini) Restart the   Now start the Service (If already service is…

Read More

mail catcher reverse proxy with Nginx

Hi All, this document deals with how to set up mail catcher reverse proxy with Nginx. Prerequisites Nginx mailcatcher If Not installed please go through our blog for mailcatcher: https://www.techrunnr.com/?s=mailcatcher, For Nginx: https://www.techrunnr.com/nginx-source-installation-in-centos/ Now start the mailcatcher service mailcatcher listens 1080(http), 1025(smtp) port number For mailcatcher GUI mode, open your browser and http://<IP>:1080 Setup Nginx as a reverse proxy for mailcatcher, Go to Nginx conf file (/etc/nginx/nginx.conf) to add below content to the conf file Restart the Nginx service To verify the mailcatcher reverse proxy configuration with the nginx, Go…

Read More

MongoDb Authentication Setup and Mongo Dump

Hi All, this document deals with how to set up MongoDB authentication and perform MongoDB dumps.  Prerequisites MongoDB, If MongoDB is not installed please go through our blog https://www.techrunnr.com/how-to-install-mongodb-in-ubuntu-16-04/ check the status of the MongoDB If the service is down, bring it up starting mongodb service For authentication setup we need to create user and passwords for MongoDB, so connect to the mongo shell connect to the admin DB and then Create a user and password It will give an output as shown below Authentication Setup. Go to mongod.conf (/etc/mongod.conf)…

Read More