Feeds:
Posts
Comments

Archive for November, 2016

What is Keepalived ?

Keepalived is a routing software written in C. The main goal of this project is to provide simple and robust facilities for loadbalancing and high-availability to Linux system and Linux based infrastructures. Loadbalancing framework relies on well-known and widely used Linux Virtual Server (IPVS) kernel module providing Layer4 loadbalancing. Keepalived implements a set of checkers to dynamically and adaptively maintain and manage loadbalanced server pool according their health. On the other hand high-availability is achieved by VRRP protocol. VRRP is a fundamental brick for router failover.

Visit here for more details : http://www.keepalived.org/

Pre-requirements

  1. Additional Packages required to build/compile keepalived from sourcesudo apt-get install build-essential libssl-dev keepalived psmisc
  2. Move Installed keepalivedmv /usr/sbin/keepalived /usr/sbin/keepalived.orig
  3. Change keepalived service script:

    vi /etc/init.d/keepalived

    Modify the path: “DAEMON=/usr/sbin/keepalived” to “DAEMON=/usr/local/sbin/keepalived”

  4. Need Additional 1 Virtual IP(VIP) address on top of existing IP

Download Source Code

sudo apt-get install wget

wget wget http://www.keepalived.org/software/keepalived-1.2.13.tar.gz

tar -zxvf keepalived-1.2.13.tar.gz

Build and Install from Source Code

cd keepalived-1.2.13
./configure
make
make install
keepalived -v
Keepalived v1.2.13 (11/30,2016)

Start Keepalived

/etc/init.d/keepalived start

Or

service keepalived start/restart/stop

Error :

Nov 30 15:25:39 node-2 Keepalived[14392]: Starting Keepalived v1.2.13 (11/30,2016)
Nov 30 15:25:39 node-2 Keepalived[14393]: Starting Healthcheck child process, pid=14395
Nov 30 15:25:39 node-2 Keepalived[14393]: Starting VRRP child process, pid=14396
Nov 30 15:25:39 node-2 Keepalived_healthcheckers[14395]: Initializing ipvs 2.6
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Registering Kernel netlink reflector
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Registering Kernel netlink command channel
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Registering gratuitous ARP shared channel
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Opening file ‘/etc/keepalived/keepalived.conf’.
Nov 30 15:25:39 node-2 modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file ‘/lib/modules/3.19.0-26-generic/modules.dep.bin’
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Configuration is using : 63166 Bytes
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: Using LinkWatch kernel netlink reflector…
Nov 30 15:25:39 node-2 Keepalived_vrrp[14396]: VRRP_Instance(V1) Entering BACKUP STATE
Nov 30 15:25:39 node-2 Keepalived_healthcheckers[14395]: IPVS: Can’t initialize ipvs: Protocol not available
Nov 30 15:25:39 node-2 Keepalived[14393]: Healthcheck child process(14395) died: Respawning

Solution:

sudo modprobe ip_vs

service keepalived restart

Further Details will be updated, stay tuned.

 

 

Read Full Post »

Install MySQL 5.6.x

I have installed Ubuntu 14.10 server x64 on my server. After the installation I installed MySQL Server 5.6.34

sudo apt-get install mysql-server-5.6 mysql-client-5.6 mysql-client-core-5.6

Installation was successful but I noticed the following issues with MySQL-5.6. Using sudo service mysql start and sudo service mysql stop the database starts and stops correctly. But when I use sudo /etc/init.d/mysql stop the database service stops and than it gets spawn again automatically without any user input. Using ps -A | grep mysql I noticed that the spawn gets a new PID.

Have you noticed this issue with mysql. For the same reason mysqladmin -u root -p shutdown does the same thing as sudo /etc/init.d/mysql stop

 

Solution

sudo stop mysql

That’s it. Mysql process stopped without any error.

Sources:

http://www.itfromscratch.com/how-to-stop-the-percona-mysql-server/
http://askubuntu.com/questions/399537/mysql-script-does-not-stop-reboots-mysql

 

திருக்குறள் :: பொருட்பால் :: அரசியல் :: அறிவுடைமை: 423

எப்பொருள் யார்யார்வாய்க் கேட்பினும் அப்பொருள்
மெய்ப்பொருள் காண்ப தறிவு.

எந்தவொரு பொருள்குறித்து எவர் எதைச் சொன்னாலும், அதை அப்படியே நம்பி ஏற்றுக் கொள்ளாமல் உண்மை எது என்பதை ஆராய்ந்து தெளிவதுதான் அறிவுடைமையாகும்.

 

Read Full Post »

What is Nginx ?

nginx [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, originally written by Igor Sysoev. For a long time, it has been running on many heavily loaded Russian sites including Yandex, Mail.Ru, VK, and Rambler. According to Netcraft, nginx served or proxied 27.80% busiest sites in October 2016. Here are some of the success stories: Netflix, WordPress.com, FastMail.FM.

The sources and documentation are distributed under the 2-clause BSD-like license.

Community website here.

Commercial support is available from Nginx, Inc.

How to Install Nginx from Ubuntu repository ?

sudo apt-get install nginx
nginx -v
nginx version: nginx/1.4.6

Here 1.4.6 is very old and stable release of Nginx. So then how to install the latest version.

Install Nginx Version 1.9.x/1.10.x/1.11.x:

Add repository URLs to “/etc/apt/sources.list.d/nginx.list”
deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx
debsrc http://nginx.org/packages/mainline/ubuntu/ trusty nginx

Now add nginx signing key

wget q O http://nginx.org/keys/nginx_signing.key | sudo aptkey add

Update your system to latest package in nginx repos
sudo apt-get update
Install latest nginx
sudo apt-get install nginx
Now you can see v1.11.5 has been installed on you machine
nginx -v
nginx version: nginx/1.11.5

Read Full Post »