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…

Configuring lbaas in OpenStack

My scenario: Openstack enviornment is configured on 3 nodes with CentOS 7 & OpenStack Juno. srv1 -> Controller node, Compute, Neutron Server, Cinder srv2-> Compute Node srv3-> Neutron Network Node, Compute Node Virtual Architecture of Load Balancer as a Service (lbaas) : Steps: 1. Install haproxy on all nodes as it is used as loadbalancer…

Troubleshoot Yum Python grabber.py error in CentOS7

To troubleshoot Yum Python grabber.py error in CentOS7:   In CentOS 7.0, you will get errors for grabber.py while running “yum update” command. Please follow the following steps to resolve this issue till next update. 1. Open /usr/lib/python2.7/site-packages/urlgrabber/grabber.py in preferable editor vi /usr/lib/python2.7/site-packages/urlgrabber/grabber.py 2. Go to line number 1510. Below command is for VI editor…

Change name of Network Interface in CentOS7

1. Open /etc/default/grub vi /etc/default/grub 2. Add net.ifnames=0 biosdevname=0 to GRUB_CMDLINE_LINUX. So final line may look like below: GRUB_CMDLINE_LINUX=”vconsole.keymap=us crashkernel=auto vconsole.font=latarcyrheb-sun16 rhgb quiet net.ifnames=0 biosdevname=0″ 3. grub2-mkconfig -o /boot/grub2/grub.cfg 4. rename /etc/sysconfig/network-scripts/ifcfg-en**** to /etc/syconfig/network-scripts/ifcfg-eth0 5. In ifcfg-eth0 file Change NAME=en*** to NAME=eth0 6. reboot

Configure AutoScaling using OpenNebula 4.8 & Flow

Internet Gateway: 192.168.50.1 Frontend & Host1 IP: 192.168.50.2 – OpenNebula-Server, OneFlow, Sunstone, OpenNebula-Node Host2 IP: 192.168.50.3 – OpenNebula-Node In Sunstone Interface: A. Create 2 Virtual Networks: Public Network: 192.168.50.0/24 – StartIP: 192.168.50.100 Private Network: 10.0.0.0/24 – StartIP: 10.0.0.10 Use ebtables Create 2 Reserved Private Networks RouterPrivateNetwork: 10.0.0.10 IP Size: 1 -> This will ensure one…

Setting up KVM Virtual Machine using CLI

KVM is Virtualization Solution for Linux. Using KVM, one can run multiple virtual machines running unmodified Linux or Windows images. Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc. KVM uses the Linux kernel as a bare metal hypervisor. A host running KVM is actually running a Linux kernel and…

Pluggable Authentication Module (PAM)

Please note these notes are based on CentOS/RHEL 5 – What is PAM ? The glue between authentication methods [eg one-time pwds, kerberos, smart cards] and applications requiring authentication services [eg. ftpd, sshd, imapd] etc It is another layer on 1st-Level defense in Linux. – The 4 directories we are concerned with: /lib/libpam*      [3 files…