Skip to main content

Posts

AWS READ REPLICA VS MULTI-AZ

We all aware about Multi AZ and read replica RDS services offered by AWS. Did you ever had a confusion when to use it or where to use it? In this article let me explain the major difference between the two. Read Replica: Read replica feature of rds will provide high performance and durability to rds databases. The main benefits of using read replica are: High performance: As the read replica will allows the read queries to be distributed among them it will helps to improve the performance. If our application produces lots of database look-ups for reporting purposes, it may make sense to pass some of those reads to a slave server, allowing our master to stay in performance. Suppose we have an e-commerce website and it can have large number of read queries.In such cases having read replica will be greatly useful since it will help to distribute the read queries. High Availability: As we have multiple read instances the availability will be automatically high. So along with

AWS ELASTIC FILE SHARE

Amazon elastic file share is a cloud service provided by amazon for simple, scalable and elastic system for file storage.It supports NFS 4 file system. Elastic file share which is a block based storage is able to shrink and expand automatically.We can use it for sharing a common content over two or more virtual machines. In this article we will show you how to mount html directory of two ec2 instances to a elastic share. First we will create an elastic file share.For that select EFS from aws dashboard. Next step is to configure file system access . Here select the VPC we want. Also select the subnets. Here we are going with default one.Click Next. Next one is   configure optional settings . Here give name of efs share.Under performance mode there will be two options General purpose and Max i/o . Max i/o is for file share to which large number of i/o'ps. Here we will go with general purpose. Under performance mode there will be bursting and provisioned. Provisioned is for max

AWS RDS : ENCRYPTING AN EXISTING RDS DATABASE

Consider we have an mysql RDS instance running in aws cloud. Suppose if we want to encrypt it we cannot directly do so.The best method is as follows: 1) Take a snap shot of the running RDS instance 2) Create a copy of it 3) Load a new  encrypted RDS instance from the new snap shot taken Here we have a RDS instance named mydevdb001. First we will take a snap shot of that instance.For that from Instance Actions > Take snapshot Now give the name of snapshot(Here we gave it as snap1) and click Take snapshot and our new snap shot will be created.After it is created from Actions select Copy snapshot . It will pop up to a new window. Here we can give the region to which we want to copy the snap shot , name and target group .Here we are copying to same region and we are giving name as snap2. Also here we will get options for enabling encryption. Just enable that. Also we can select our master key for encryption. Here we are going with default one. Then click

JENKINS: DEPLOYING WAR FILE TO TOMCAT

Assume we have tomcat installed and running on our server. Also assume that jenkins is installed and we have a job ready or preparing artifact. We assume that copy artifact and deploy to container plugin is already installed.Otherwise install it from Manage jenkins > Manage plugins. First of all we will create a user role in tomcat for jenkins to access.For that open tomcat-users.xml file and make following changes. #vi /opt/tomcat/conf/tomcat-users.xml Now restart tomcat service. #service tomcat restart Now open jenkins. We will create a new job to copy the war file that we already prepared and deploy it in tomcat server. Here our first job is packaging job where we had build and created a war file from source code. Now we will create another job named deploy job to deploy it to tomcat container. Under build section select Copy artifacts from another project . Now give our previous project name which is packaging job.Under Artifact to copy give **/*.war which means

JENKINS : CONTINUOUS INSPECTION USING CHECK STYLE

Check style is a code static analysis tool to help programmers to write java code and to evaluate coding standard such as > Avoid multiple blank lines > Removing unused variables > Enforcing correct indentations etc Assume we have configured a maven-project to build our code.Along with this we will include checkstyle for continuous inspection. First we have to install checkstyle plugin.From Manage Jenkins > Manage plugins. Now select checkstyle plugin and install it. Now go to our project maven-new. Under build action, along with clean package we will include checkstyle:checkstyle. Under post build step select publish checklist analytic result and leave the blank space, then the default **/checkstyle-result.xml is used.Then click save.  Now build our project.We can see a new checkstyle warning tab came on left. Now under warnings we can see many warnings.we have to fix this.  Under categories we can see various warnings.First we will fix warni

CREATING EC2 INSTANCE UNDER NEW VPC AND SUBNET USING ANSIBLE

Managing aws resources using Ansible is efficient and reliable. In this document we will create an ec2 instance using Ansible under a new vpc and subnet. For that we will do the following 1) Creating a VPC 2)Creating a subnet 3)Creating an internet gateway and routing table for vpc 3)Creating a security group 4)Creating an ec2 instance Our directory structure for ansible playbook is as follows Here we have an aws role which will execute creating of a new ec2 instance under new vpc and subnet. The main.yaml file under tasks is as follows: Here in our playbook first we will create a VPC.We will specify region,name,cidr-block over here.We will register it as my_vpc. On next step we will save its id which we will use while creating subnet. Similarly we create Internet gateway and routing table to that vpc. Then we will create a n security group allowing traffic through certain ports.Next we created a ssh key pair for our ec2 instance and saved the private key i

AWS RDS: CREATING AN RDS INSTANCE

Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud.In this article we will explain about creating a mysql database using aws RDS. From AWS RDS dashboard click on instances > Then click on Launch DB instances. First we need to select engine.Here we will go with Mysql engine.Then click next.On the next window appears we will select our use case.We will go with Production-Mysql and click next. On the next window that appears we can select various options such as mysql version ,instance class,storage type,size multi-az deployment and so on.Here we selecting t2-micro as size, storage type as general purpose SSD and mysql version as mysql 5.6.39.Also we are not going with multi-AZ deployment.We can also see estimated cost over here. Under settings we can give the db identifier name.Also we can give username and password for it. Under network and security give the details about subn