Posts

KVM & Qemu

QEMU is a powerful emulator, which means that it can emulate a variety of processor types. Xen uses QEMU for HVM guests, more specifically for the HVM guest's device model. The Xen-specific QEMU is called qemu-dm (short for QEMU device model) QEMU uses emulation; KVM uses processor extensions (intel-VT) for virtualization. Both Xen and KVM merge their various functionality to upstream QEMU, that way upstream QEMU can be used directly to accomplish Xen device model emulation, etc. Xen is unique in that it has paravirtualized guests that don't require hardware virtualization. Both Xen and KVM have paravirtualized device drivers that can run on top of the HVM guests. The QEMU hypervisor is very similar to the KVM hypervisor. Both are controlled through libvirt, both support the same feature set, and all virtual machine images that are compatible with KVM are also compatible with QEMU. The main difference is that QEMU does not support native virtualization. Consequently, QEMU has ...

Packet Drop issue

Packet drops can happen at two layers. one at the NIC level or at the Network stack level. 1. Nic level:-  Check 'ifconfig' output. RX packets:297126179 errors:0 dropped:3981 overruns:0 frame:0 TX packets:233589229 errors:0 dropped:0 overruns:0 carrier:0 That means packets drops at the NIC level. These are most likely caused by exhaustion of the RX ring buffer. Increase the size of the Ethernet device ring buffer. First inspect the output of "ethtool -g eth0". If the "Pre-set maximums" are more than the what's listed in the current hardware settings it's recommend to increase this number. As an example: # ethtool -g eth0 Ring parameters for eth0: Pre-set maximums: RX: 1020 RX Mini: 0 RX Jumbo: 16320 TX: 255 Current hardware settings: RX: 255 RX Mini: 0 RX Jumbo: 0 TX: 255 To increase the RX ring buffer to 4080 you would run "ethtool -G eth0 rx 1020". 2. Network stack level:- Need  to tweak sysctl kernel...

Active vs Passive ftp

Active and passive are the two modes that FTP can run in. FTP uses two channels between client and server, the command channel and the data channel, which are actually separate TCP connections. The command channel is for commands and responses, the data channel is for actually transferring files. It's a nifty way of sending commands to the server without having to wait for the current data transfer to finish. In active mode, the client establishes the command channel (from client port X to server port 21 (b) ) but the server establishes the data channel (from server port 20 (b) to client port Y , where Y has been supplied by the client). In passive mode, the client establishes both channels. In that case, the server tells the client which port should be used for the data channel. Passive mode is generally used in situations where the FTP server is not able to establish the data channel. One of the major reasons for this is network firewalls. While you may have...

Create a simple webserver container on Docker

1. Start the container with a shell, #docker run -i -t -p 8080:80 214a4932132a /bin/bash Mapped the host port 8080 to container port 80, so that you can access the container webserver contents through apache. [It is similar as DNAT] 2. Install the web server package inside the container, At first, the containers have only internal IP addresses. To access the Internet, SNAT (Source Network Address Translation, also known as IP masquerading) should be configured on theHardware Node. [root@proxy ~]# iptables -t nat -A POSTROUTING -s 172.17.0.0/24 -o eth0 -j SNAT --to 31.x.x.x 172.17.0.0 - Container's ip range 31.x.x.x - Host public IP Now you can able to access the internet from container, then we can install the apache server. [root@c576532e21ab /]# yum install httpd -y 3. Create a custom content in document root, [root@c576532e21ab /]# echo "Hello world" > /var/www/html/index.html 4. Test the web server, We cant start the httpd service through ...

Install and Configure the Docker on Centos

We are going to install and configure the Docker on Centos 1. Enable the epel repository. 2. yum install docker-io 3. Start the docker daemon [root@proxy ~]# service docker start Starting cgconfig service:                                 [  OK  ] Starting docker:                                       [  OK  ] [root@proxy ~]# chkconfig docker on 4. Download any public container images and store them in a local repository, [root@proxy ~]# docker pull ubuntu ubuntu:latest: The image you are pulling has been verified 511136ea3c5a: Pull complete f3c84ac3a053: Pull complete a1a958a24818: Pull complete 9fec74352904: ...

How to install and configure GlusterFS server on centos

We are going to setup glusterfs storage server with four nodes. 1. On all of your four nodes install the glusterfs and xfs packages, wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo yum install glusterfs-server xfsprogs chkconfig glusterd on service glusterd start 2. On all of your cluster nodescreate a new 2Gb LV called brick1 in vgsrv VG and format this LV with an XFS filesystem with 512byte inodes. lvcreate -L 2G -n brick1 vgsrv mkfs.xfs -i size=512 /dev/vgsrv/brick1 mkdir /server1_export1 echo "/dev/vgsrv/brick1 /server1_export1 xfs defaults 0 1" >> /etc/fstab mount -a 3. From server1, add the other three nodes as trusted peers. [root@proxy ~]# gluster peer probe server2{ip} [root@proxy ~]# gluster peer probe server3{ip} [root@proxy ~]# gluster peer probe server4{ip} [root@proxy ~]# gluster peer status Number of Peers: 3 Hostname: server2 Uuid: a381532b-81a0-41c7-9adb-cd29f9f38158 State: Peer in Cluster (C...

Create XFS filesystem on Centos

Server : Test1 Step 1: ------------ Create two logical volumes with size 2Gb & 512MB respectively. [root@sara2 ~]# lvcreate -n xfsdata -L 2G vgsrv -->xfs filesystem   Logical volume "xfsdata" created [root@sara2 ~]# lvcreate -n xfsjournal -L 512M vgsrv -->external journal setup   Logical volume "xfsjournal" created [root@sara2 ~]# yum install xfsprogs Create a new xfs filesystem with external journal. [root@sara2 ~]# mkfs -t xfs -l logdev=/dev/vgsrv/xfsjournal /dev/vgsrv/xfsdata meta-data=/dev/vgsrv/xfsdata     isize=256    agcount=4, agsize=131072 blks          =                       sectsz=512   attr=2, projid32bit=0 data     =                  ...