Posts

Showing posts from April, 2014

Routing Concept1

Sometimes you have more than one router in your network, and want different  containers  to use different routers. Other times you may have a single HN with IP addresses on different networks and want to assign containers addresses from those networks. Lets say you have a HN with an IP address in network 192.168.100.0/24 (192.168.100.10) and an IP address in 192.168.200.0 (192.168.200.10). Maybe those addresses are on different VLANs. Maybe one is an internal network and the other faces the wider internet. Maybe you have 10 different networks assigned to the HN. It does not matter as long as there is a gateway on each of those networks. In our example we will assume the gateways are 192.168.100.1 and 192.168.200.1. You want any container assigned an address in the 192.168.100.0/24 network to use 192.168.100.1 and any container assigned an address in the 192.168.200.0/24 network to use 192.168.200.1. By default the network traffic coming from a container will use the default gatew

Tracing a program

Suppose some program on your system refuses to work or it works, but much slower then you've expected.  One way is to use strace program to follow system calls performed by given process.   Use of strace Commonly to use strace you should give the following command: strace -o strace.out -ff touch /tmp/file Here -o strace.out option means that strace program will output all information to the file named strace.out ; -ff means to strace the forked children of the program. Child straces outputs will be placed to strace.out.PID files, where PID is a pid of the child. If you want all the output to a single file, use -f argument instead (i.e. single f not double). touch /tmp/file is the program with arguments which is to be straced.   Strace results So this is what we have in strace.out : execve("/usr/bin/touch", ["touch", "/tmp/file"], [/* 51 vars */]) = 0 uname({sys="Linux", node="dhcp0-138", ...}) = 0 brk(0)

Install NIC drivers in centos server

E.G -Driver Installation steps for Atheros Communications Inc. AR8161 Gigabit Ethernet [NIC]. *verify ethernet controller in use : #lspci -v 02:00.0 Ethernet controller: Atheros Communications Inc. AR8161 Gigabit Ethernet (rev 10) Subsystem: Dell Device 0562 Flags: bus master, fast devsel, latency 0, IRQ 33 Memory at d0400000 (64-bit, non-prefetchable) [size=256K] I/O ports at 2000 [size=128] Capabilities: [40] Power Management version 3 Capabilities: [58] Express Endpoint, MSI 00 Capabilities: [c0] MSI: Enable+ Count=1/16 Maskable+ 64bit+ Capabilities: [d8] MSI-X: Enable- Count=16 Masked- Capabilities: [100] Advanced Error Reporting Capabilities: [180] Device Serial Number ff-4c-ed-51-5c-f9-dd-ff * download .rar file here : http://www.touslesdrivers.com/index.php ... _langue=en * yum --enablerepo=rpmforge install unrar *unrar -e *****.rar ------> replace Makefile : No * # yum groupinstall "kernel-devel" *#make *cp -r /path-to-downloaded-rar/al

Overview of OpenVZ

1. OS Virtualization - From the point of view of applications and Virtual Environment users, each VE is an independent system. This independency is provided by a virtualization layer in the kernel of the host OS. Note that only a negligible part of the CPU resources is spent on virtualization (around 1-2%). 2. Network virtualization - The OpenVZ network virtualization layer is designed to isolate VEs from each other and from the physical network 3. Resource Management - OpenVZ resource management controls the amount of resources available for Virtual Environments. The controlled resources include such parameters as CPU power, disk space, a set of memory-related parameters, etc. 4. Two-Level Disk Quota - Host system (OpenVZ) owner (root) can set up a per-VE disk quotas, in terms of disk blocks and i-nodes (roughly number of files). This is the first level of disk quota. In addition to that, a VE owner (root) can use usual quota tools inside own VE to set stan