Skip to main content

Posts

Showing posts from September, 2018

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