Beruflich Dokumente
Kultur Dokumente
es
06/05/13
herramientas
series de artculos
sobre el autor
subscribete
yn ic al ats nI re k m a e c a p
La versin 2 de heart beat ha cambiado bastante respecto la versin 1 . Vamos a ver como inst alar heart beat y como configurar un servicio con pacemaker con una VIP asociada . Para esta configuracin vamos a suponer dos host s : host1 host2 Empezaremos instalando el reposit orio de clust erlabs e instalando todos los paquetes necesarios en ambos nodos (deberemos t ener inst alado previament e
el resposit orio EPEL):
escribe aqu...
buscar
sodaca t seD
Linux 3.0 : Ya tenemos la versin 3.0 del kernel Linux. Lo ha anunciado Linus Torvalds en la lista de desarrollo... Como cambiar el t ext o del men Inicio de Windows por ot ro : Anteriormente ya coment (Jugando con IDA Pro) como con un amigo nos entretuvimos hace ya aos a mod... Wargame behemot h: Nivel 1 : Siguiendo con el wargame a continuacin del narnia tenemos el behemoth, vamos a ver como
solucionar ... wget -O /etc/yum.repos.d/pacemaker.repo http://clusterlabs.org/rpm/epel-5/clusterlabs.repo yum install heartbeat cluster-glue resource-agents pacemaker -y
sa i r oge t aC
Aplicaciones Backup BSD Buscador Clustering Correo Curiosidades DBA Desktop DNS Hardware Instalaciones Kernel LAMP y web Monitorizacin Programacin Redes Rendimiento SAN Script Seguridad Sistemas de ficheros Sistemas empotrados Storage systemadmin.es otros Utilidades Virtualizacin
A continuacin deberemos modificar el fichero /et c/host s , aadiendo los dos nodos del cluster:
172.16.2.10 host1 172.16.2.11 host2
A continuacin, en uno de los dos nodos generamos el fichero /et c/ha.d/ha.cf con lo siguiente:
autojoin none bcast eth0
pacemaker respawn
pasaran mensajes entre los nodos del cluster. Podemos hacerlo tambin por
mult icast (mcast ) pero si tenemos una VLAN para el cluster y no hay ms de
un cluster en la VLAN podemos dejarlo con broadcast . Mediante warnt ime , deadt ime , init dead , keepalive indicamos diferentes valores globales de timeouts.
http://systemadmin.es/2011/03/instalacion-y-conguracion-de-heartbeat-2 1/9
06/05/13
vuelve a iniciar. A continuacin deberemos generar el fichero de aut ent icacin mediant e pwgen:
yum install pwgen -y
06/05/13
Errors found during check: config not valid -V may provide more details
encuentren en un estado indeterminado para permitir levantar sus servicios en otro nodo. De momento lo podemos dejar deshabilitado:
crm configure property stonith-enabled=false
T ambin deberemos definir el nmero de votos con los que indicamos que el cluster tiene quorum :
2 Nodes configured, unknown expected votes
Para evitar que los servicios hagan fail-back (vuelvan al otro nodo cuando se recupere de un fallo):
crm configure rsc_defaults resource-stickiness=100
A continuacin aadiremos servicios, primero de todo tenemos que obtener el listado de clases que podemos aadir:
# crm ra classes heartbeat lsb ocf / heartbeat pacemaker stonith
Mediante crm ra list podemos listar los scripts de control de una de las clases:
# crm ra list ocf heartbeat AoEtarget IPaddr Route VirtualDomain eDir88 oralsnr AudibleAlarm IPaddr2 SAPDatabase WAS iSCSILogicalUnit pgsql CTDB IPsrcaddr SAPInstance WAS6 iSCSITarget pingd ClusterMon LVM SendArp WinPopup ids portblock Delay LinuxSCSI ServeRAID Xen iscsi postfix Dummy MailTo SphinxSearchDaemon Xinetd ldirectord proftpd Ev Ma Sq an my rs
A continuacin mediante crm ra info podemos obtener los datos de funcionamiento de un script en concreto:
# crm ra info ocf:heartbeat:IPaddr2 Manages virtual IPv4 addresses (Linux specific version) (ocf:heartbeat:IPaddr2)
This Linux-specific resource manages IP alias IP addresses. It can add an IP alias, or remove one.
http://systemadmin.es/2011/03/instalacion-y-conguracion-de-heartbeat-2 3/9
06/05/13
ip* (string): IPv4 address The IPv4 address to be configured in dotted quad notation, for example "192.168.1.1".
nic (string, [eth0]): Network interface The base network interface on which the IP address will be brought online.
If left empty, the script will try and determine this from the routing table.
Do NOT specify an alias interface in the form eth0:1 or anything here; rather, specify the base interface only.
cidr_netmask (string): CIDR netmask The netmask for the interface in CIDR format (e.g., 24 and not 255.255.255.0)
If unspecified, the script will also try to determine this from the routing table.
broadcast (string): Broadcast address Broadcast address associated with the IP. If left empty, the script will determine this from the netmask.
iflabel (string): Interface label You can specify an additional label for your IP address here. This label is appended to your interface name. If a label is specified in nic name, this parameter has no effect.
lvs_support (boolean, [false]): Enable support for LVS DR Enable support for LVS Direct Routing configurations. In case a IP address is stopped, only move it to the loopback device to allow the local node to continue to service requests, but no longer advertise it on the network.
mac (string): Cluster IP MAC address Set the interface MAC address explicitly. Currently only used in case of the Cluster IP Alias. Leave empty to chose automatically.
clusterip_hash (string, [sourceip-sourceport]): Cluster IP hashing function Specify the hashing algorithm used for the Cluster IP functionality.
unique_clone_address (boolean, [false]): Create a unique address for cloned instances If true, add the clone ID to the supplied value of ip to create a unique address to manage
arp_interval (integer, [200]): ARP packet interval in ms Specify the interval between unsolicited ARP packets in milliseconds.
06/05/13
arp_bg (string, [yes]): ARP from background Whether or not to send the arp packets in the background.
arp_mac (string, [ffffffffffff]): ARP MAC MAC address to send the ARP packets too.
Aadiremos una IP de clust er (VIP) como servicio con crm configure primit ive :
crm configure primitive haip1 ocf:heartbeat:IPaddr2 params ip=172.16.2.100 cidr_netmask=32 op monitor interval=30s
En el nodo que se haya levantado podemos ver como esta presente mediante ip
addr show: # ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:0c:29:40:db:82 brd ff:ff:ff:ff:ff:ff inet 172.16.2.10/16 brd 172.16.255.255 scope global eth0 inet 172.16.2.100/32 brd 172.16.6.100 scope global eth0
A continuacin mediante ocf:heart beat :anyt hing podemos aadir cualquier daemon al cluster. Primero obtenemos los detalles con crm ra info :
# crm ra info ocf:heartbeat:anything Manages an arbitrary service (ocf:heartbeat:anything)
06/05/13
binfile* (string): Full path name of the binary to be executed The full name of the binary to be executed. This is expected to keep running with the same pid and not just do somethi
cmdline_options (string): Command line options Command line options to pass to the binary
pidfile (string, [/var/run//anything_undef.pid]): File to write STDOUT to File to read/write the PID from/to.
stop_timeout (string): Seconds to wait after having sent SIGTERM before sending SIGKILL in stop operation In the stop operation: Seconds to wait for kill -TERM to succeed before sending kill -SIGKILL. Defaults to 2/3 of the stop operation timeout.
http://systemadmin.es/2011/03/instalacion-y-conguracion-de-heartbeat-2
6/9
06/05/13
A continuacin podemos indicar dos recursos con que puntuacin deben mantenerse juntos:
# crm configure colocation usage: colocation <id> <score>: [:] [:]
A continuacin mediante order indicamos el orden en que se deben arrancar los servicios:
# crm configure order usage: order <id> score-type: <first-rsc>[:<action>] <then-rsc>[:<action<] [symmetrical=<bool>]
Relacionados St at ement is not safe t o log in st at ement format ssh con daemont ools Replicacin en memcached Reinicio aut omt ico de memcached en la versin de Facebook Posiciones del fichero de configuracin de MySQL 6 Dentro de Clust ering March 21, 2011 Tags: Alt a disponibilidad , heart beat , pacemaker
Imprimir
http://systemadmin.es/2011/03/instalacion-y-conguracion-de-heartbeat-2
7/9
06/05/13
gracias amigos lo voy a practicar y les aviso que tal me va,no saben lo til que me es esto.
art uro wrot e: 2. May 2012 at 9:15 pm :
tengo problemas configurando el pacemaker y no hay muchas instrucciones aqui podras darme una mano con eso!?
marcelo wrot e: 13. November 2012 at 8:54 pm :
Hola muy buen tutorial entre este y otros tutoriales he conseguido hasta el momento Crear mi pequeo Cluster con 2 Nodos y una IP virtual. Ahora voy a intentar poner mysql en Alta Disponibilidad. Gracias
David wrot e: 3. April 2013 at 8:4 6 am :
Podria alguien ayudarme diciendome como agregaria el servicio de proxy http (squid) y dansguardian que es lo que tengo montado para agregarlo al cluster? Gracias desde ya!
n e m oc n u a je D
Nombre (obligat orio ) Ant iBot : Suma de 2 y 5 ? Email (obligat orio , no se muestra) Website (no se muestra) XHT ML - Tags permitidos:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
enviar
http://systemadmin.es/2011/03/instalacion-y-conguracion-de-heartbeat-2 8/9
06/05/13
http://systemadmin.es/2011/03/instalacion-y-conguracion-de-heartbeat-2
9/9