Monitoring Kafka, Storm, Zookeeper with Icinga2

Steps to monitor Kafka & Storm: – open JMX port for kafka and storm – To open JMX port in Kafka : a. Add below line to $KAFKA_HOME/bin/kafka-run-class.sh KAFKA_JMX_OPTS=”-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=xxx.xxx” b. Add below line to $KAFKA_HOME/bin/kafka-server-start.sh export JMX_PORT=${JMX_PORT:-2999} c. Restart kafka $KAFKA_HOME/bin/kafka-server-stop.sh $KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties – To open JMX port in Storm: a. Add […]

Continue reading →

Bare Metal Provisioning of Linux (Proxmox) using FAI

By Neelesh Gurjar What is Remote unattended installation? Remote unattended installation means installation of remote server without any human interference. This process is very useful for bare metal provisioning, automated installation on multiple servers, etc. What is Proxmox? Proxmox is debian based OS, which provides Virtualization Platform like VMware. https://www.proxmox.com/en/ What is FAI? FAI is […]

Continue reading →

Migrate Linux VMs from XEN (SolusVM) to KVM (Proxmox)

Migrating CentOS Linux installed Xen instance to KVM is really tricky. This note contains one of the way to migrate. Here I have used SolusVM for Xen based instances and Proxmox for KVM based instances. PS: This will work with Linux Only. For eg. I have used CentOS6 linux Here are the steps to migrate: […]

Continue reading →

Setting up Self Healing Tomcat

This note contains step to configure Self Healing environment for Tomcat. We will configure Daemontools to monitor Tomcat service and if tomcat crashes, DT will start it automatically. Daemontool will make sure that tomcat service is running. OS -> CentOS-7 64bit Tomcat Version -> 8 Install Daemontools git clone https://github.com/kteru/daemontools-rpm.git cd /root/daemontools-rpm wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz On […]

Continue reading →

Configuring SSL in Tomcat & AWS Elastic Load Balancer (ELB)

Steps to configure SSL in Tomcat & integrate it with AWS Elastic Load Balancer (ELB) 1. Create Keystore using keytool.2. Generate Certificate Signing Request (CSR)3. Get RootCertificate, Intermidiate Certificate & Public Certificate. 4. Import above certificates in keystore 5. Configure keystore in tomcat 6. Integrate SSL certificate with AWS ELB – – Generate RSA Private […]

Continue reading →

Configure Elastic IP Failover between EC2 instances in AWS

Configuring Failover cluster between 2 EC2 instances is bit tricky or not possible. We can achieve Failover between 2 EC2 by configuring Elastic IP Failover. In AWS we can associate Elastic IP to an EC2 instance. Using this Elastic IP we can connect to the associated instance using terminal. We can configure Failover to EIP […]

Continue reading →

Configure MySQL Master-Master replication

Server1: 10.0.0.1Server2: 10.0.0.2Both have same version of Mysql server installed Steps to configure MySQL Master-Master replication: On Server1:1. Enable server listens on all Network Interfaces, also enable binary logs and other mysql config:You should have below entries in /etc/my.cnf auto_increment_increment = 2 auto_increment_offset = 1 bind-address=0.0.0.0 log-bin=mysql-bin-log binlog-do-db=<dbName> expire_logs_days=2 max_binlog_size=100M innodb_flush_log_at_trx_commit=1 sync_binlog=1 server-id=12. Restart mysql […]

Continue reading →

MySQL incremental backup on S3 Storage bucket

Steps to take incremental backup of MySQL database and upload it on S3 bucket: 1. Enable binary loging in mysql for our database. Added below entries in /etc/my.cnf under [mysqld] log-bin=mysql-bin-log binlog-do-db=Database_name expire_logs_days=2 max_binlog_size=100M 2. Restart mysql server systemctl restart mysqld 3. Installed s3cmd & configured it yum install s3cmd s3cmd –configure Enter AWS access_key […]

Continue reading →

Basic steps to Secure Tomcat 8

1. Change Server Header Response In server.xml <Connector port=”80″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ redirectPort=”8443″ server=”<WhatEverYouWant2Show>”/> 2. Undeployed below applications – / -> Root app which displays Tomcat Welcome page – /docs -> which shows Tomcat documentation on http://ip/docs – /examples -> It shows Tomcat examples page on http://ip/examples 3. Restrict access to manager and host-manager apps. – […]

Continue reading →

Script to Kill MySQL Sleeping Processes

Create Script /bin/mysql_kill_sleepProc.sh #!/bin/bash echo ” ” echo ‘###########################################’ date mysqladmin -u root –password=<mysqlPassword> processlist|grep Sleep for i in `mysqladmin -u root –password=<MysqlPASSWORD> processlist|grep Sleep|awk ‘{print $2}’`; do mysqladmin -u root –password=<MysqlPASSWORD> kill $i; done > /dev/null 2>&1 wc=`echo $?` if test $wc == 0 then echo “Mysql sleeping queries killed succesfully” else echo “Command […]

Continue reading →