rinetd – harika bir olay – redirects TCP connections from one IP address and port to another

olay: acil olarak server , lokasyon ve ip degistirmek gerekti.

durum: eski serverda calisan pek cok domain, web , mail var – aktarim kolay – ancak kisa surede yeni serverda yeni ipde devam etmek istiyoruz

normal prosedur : eski serverdaki servisleri durdur. Yedek al – Yedekleri yeni servera aktar – yukle – calistigindan emin olunca nameserver iplerini degistir yeni server ipleri ile – bekle – 24 saat icinde hersey yoluna girer

sorun: vakit dar – tum islemin 2 3 saat icinde olmasi gerek – ancak yedekleme tek basina 10 saat suruyor –

10 saat yedekle – yedekleri aktar – 50GB 🙂 – yukle – calistir et – 12 saat oldu . bizim 2 – 3 saatimiz var

dnsler degisti ancak guncellenene kadar hersey eski iplerde resolve ediyor. basa bela durumu…

cozum: rinetd !

rinetd redirects TCP connections from one IP address and port to another, with basic IP-based access control.rinetd is a single-process server which handles any number of connections to the address/port pairs specified in the file /etc/rinetd.conf. Since rinetd runs as a single process using nonblocking I/O, it is able to redirect a large number of connections without a severe impact on the machine. This makes it practical to run services on machines inside an IP masquerading firewall.

install rinetd in ubuntu

apt-get install rinetd

install rinetd in centos

http://www.boutell.com/rinetd/

wget http://www.boutell.com/rinetd/http/rinetd.tar.gz

tar zxvf rinetd.tar.gz , cd rinetd  , make install

config dosyasi yapisi cok kolay

nano /etc/rinetd.conf


#
# forwarding rules come here
#
# you may specify allow and deny rules after a specific forwarding rule
# to apply to only that forwarding rule
#
# bindadress bindport connectaddress connectport

# logging information
logfile /var/log/rinetd.log

# uncomment the following line if you want web-server style logfile format
# logcommon

rinetd example
Assume that you have a machine with the IP address 192.168.2.1 which has been running Apache, and that you’d like to move that to the IP address 192.168.2.3

You’ve already updated DNS to point visitors to the new IP address, but you want to ensure that people connecting to the old IP still continue to receive service.

To handle this example you should update the /etc/rinetd.conf file to read:

# bindadress bindport connectaddress connectport
192.168.2.1 80 192.168.2.3 80
192.168.2.1 443 192.168.2.3 443

Once you restart rinetd all incoming connections on port 80 and 443 will be seamlessly redirected from the old IP to the new one – although you will need to restart rinetd after making the change to your configuration file.

sonre restart et inetd yi oldu bitti..

sitesi burada

http://www.boutell.com/rinetd/