Posts

Showing posts with the label System

Web load balancer with HAproxy

This note provides steps for up and running haproxy loadbalancer for http service. Install haproxy rpm yum install haproxy Edit haproxy.cfg vi /etc/haproxy/haproxy.cfg global maxconn 100000 user haproxy group haproxy defaults #log global mode http # option httplog # option dontlognull retries 3 option redispatch maxconn 100000 contimeout 5000 clitimeout 50000 srvtimeout 50000 VIP address. Do not add config at /etc/sysctl.conf listen webfarm 192.168.1.3:80 It can be tcp or http mode http # stats enable # stats auth someuser:somepassword balance roundrobin # allow to track source ip option forwardfor option httpchk HEAD /linkcheck.html HTTP/1.0 server webA 192.168.1.1:80 cookie A check server webB 192.168.1.2:80 cookie B check Edit system parameter vi /etc/sysctl.conf net.ipv4.ip_nonlocal_bind = 1

How to edit initial ram disk at Linux server

This steps will be general procedures to edit initial ram disk Create temporary directory. For this case, i will create /boot/img mkdir /boot/img Change initrd file name mv /boot/initrd.xx.img /boot/img/initrd.xx.img.gz Unzip and extract image cd /boot/img gunzip initrd.xx.img.gz cpio -idumv < initrd.xx.img.gz You will have extracted directory. Now you can edit or add necessary drivers. This will be how to repackage Go to your extracted temporary directory. For my case, /boot/img find . | cpio -o -H newc | gzip -11 > ../initrd.xx.img

Backup the whole partition with cpio archive command

cpio is a useful tool to archive Linux system. In this article, we are going to archive / partition which is mounted from sda11 partition. ###Archive ssh root@192.168.1.104 "find / -xdev -print0 | cpio --null --create" > sda11.cpio ###Extract cpio --extract --no-absolute-filenames --file=sda11.cpio For the /dev directory, recommended to be archived by tar command ssh root@192.168.1.104 "tar -c /dev" > dev.tar

Configure serial console at Linux

Edit /etc/inittab co1:2345:respawn:/sbin/agetty ttyS0 9600 vt100 co2:2345:respawn:/sbin/agetty ttyS1 9600 vt100 Restart init init q