Hitchhiker's Guide to Openbsd


Download 1.27 Mb.
Pdf ko'rish
bet107/258
Sana04.04.2023
Hajmi1.27 Mb.
#1328980
1   ...   103   104   105   106   107   108   109   110   ...   258
Bog'liq
obsd-faq49

6.11.3 - Load balancing
Flash forward a few months. Our company of the previous example has grown to the point where a 
single internal Web server is just barely managing the load. What to do? CARP to the rescue. It's time to 
try load balancing. Create a new CARP interface and group on rachael
rachael# ifconfig carp1 create
rachael# ifconfig carp1 vhid 2 advskew 100 pass bryant 
carpdev fxp0 \
192.168.0.7 netmask 255.255.255.0
On pris, we'll create the new group and interface as well, then set the "preempt" sysctl: 
pris# ifconfig carp1 create
pris# ifconfig carp1 vhid 2 pass bryant carpdev fxp0 \
192.168.0.7 netmask 255.255.255.0
pris# sysctl net.inet.carp.preempt=1
http://www.openbsd.org/faq/faq6.html (28 of 33)9/4/2011 10:02:06 AM


6 - Networking
Now we have two CARP groups with the same IP address. Each group is skewed toward a different 
host, which means rachael will stay master of the original group, but pris will take over the new one. 
While these examples are for a two-machine cluster, the same principles apply to more systems. Please 
note, however, that it's not expected that you will achieve perfect 50/50 distribution between the two 
machines--CARP uses a hash of the originating IP address to determine which system handles the 
request, rather than by load. 
6.11.4 - More Information on CARP

carp(4)
 

ifconfig(8)
 

sysctl(8)

sysctl(3)

Firewall Failover with pfsync and CARP
 by Ryan McBride 
6.12 - Using OpenNTPD
Accurate time is important for many computer applications. However, many people have noticed that 
their $5 watch can keep better time than their $2000 computer. In addition to knowing what time it is, it 
is also often important to synchronize computers so that they all agree on what time it is. For some time
ntp.org
 has produced a Network Time Protocol (
RFC1305

RFC2030
) application, available through 
ports
, which can be used to synchronize clocks on computers over the Internet. However, it is a 
nontrivial program to set up, difficult code to audit, and has a large memory requirement. In short, it fills 
an important role for some people, but it is far from a solution for all. 
OpenNTPD
is an attempt to resolve some of these problems, making a trivial-to-administer, safe and 
simple NTP compatible way to have accurate time on your computer. OpenBSD's 
ntpd(8)
is controlled 
with an easy to understand configuration file, 
/etc/ntpd.conf

Simply activating ntpd(8) through 
rc.conf.local
 will result in your computer's clock slowly moving 
towards, then keeping itself synchronized to, the 
pool.ntp.org
servers, a collection of publicly available 
time servers. Once your clock is accurately set, ntpd will hold it at a high degree of accuracy, however, 
if your clock is more than a few minutes off, it is highly recommended that you bring it to close to 
accurate initially, as it may take days or weeks to bring a very-off clock to sync. You can do this using 
the "
-s
" option of ntpd(8) or any other way to accurately set your system clock. 

Download 1.27 Mb.

Do'stlaringiz bilan baham:
1   ...   103   104   105   106   107   108   109   110   ...   258




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling