- demonio -> /etc/init.d/heartbeat
- Archivos importantes ->
/var/lib/heartbeat -> hb_generation hb_uuid hostcache
/var/lib/heartbeat/crm -> cib.xml
- entorno grafico -> hb_gui
- status comandos -> crm_mon
Suse10-cluster1:/var/lib/heartbeat/crm #
cat /etc/ha.d/ha.cf
autojoin any
#!! Cualquier máina se puede conectar
crm true
#!! Activamos el CRM que es el sistema principal del cluster
bcast eth0
#!! Tarjeta para realizar el heartbeat
node Suse10-cluster1
node Suse10-cluster2
respawn root /sbin/evmsd
#!! en caso de morir el evms (opciones avanzadas) lo relanza
apiauth evms uid=hacluster,root
#!! Usuario que puede autenticarse
Suse10-cluster1:/var/lib/heartbeat/crm #
cat /etc/ha.d/authkeys
auth 1
1 md5 prueba
- Nos logamos como usuario hacluster:
- Creamos dos grupos de recursos, uno asociado a cada uno, dentro de cada uno creamos el recurso.
- Por ultimo, generamos las prioridades. Tb si queremos indicarles algun tipo de orden.
- Movemos el recurso de apache a la maquina2.
crm_resource -M -r resource_apache -H suse10-cluster2
Suse10-cluster1:/var/lib/heartbeat/crm # crm_resource -W -r resource_apache
resource resource_apache is running on: suse10-cluster2
- Información de los comandos:
Suse10-cluster1:/var/lib/heartbeat/crm # crm_resource
usage: unknown [-?VS] -(L|Q|W|D|C|P|p) [options]
--help (-?) : this help message
--verbose (-V) : turn on debug info. additional instances increase verbosity
--quiet (-Q) : Print only the value on stdout (for use with -W)
Commands
--list (-L) : List all resources
--query-xml (-x) : Query a resource
Requires: -r
--locate (-W) : Locate a resource
Requires: -r
--migrate (-M) : Migrate a resource from it current location. Use -H to specify a destination
If -H is not specified, we will force the resource to move by creating a rule for the current location and a score of -INFINITY
NOTE: This will prevent the resource from running on this node until the constraint is removed with -U
Requires: -r, Optional: -H, -f, --lifetime
--un-migrate (-U) : Remove all constraints created by -M
Requires: -r
--delete (-D) : Delete a resource from the CIB
Requires: -r, -t
--cleanup (-C) : Delete a resource from the LRM
Requires: -r. Optional: -H
--reprobe (-P) : Recheck for resources started outside of the CRM
Optional: -H
--refresh (-R) : Refresh the CIB from the LRM
Optional: -H
--set-parameter (-p): Set the named parameter for a resource
Requires: -r, -v. Optional: -i, -s, --meta
--get-parameter (-g) : Get the named parameter for a resource
Requires: -r. Optional: -i, -s, --meta
--delete-parameter (-d) : Delete the named parameter for a resource
Requires: -r. Optional: -i, --meta
Options
--resource (-r) : Resource ID
--resource-type (-t) : Resource type (primitive, clone, group, ...)
--property-value (-v) : Property value
--host-uname (-H) : Host name
--meta : Modify a resource's configuration option rather than one which is passed to the resource agent script.
For use with -p, -g, -d
--lifetime (-u) : Lifespan of migration constraints
--force (-f) : Force the resource to move by creating a rule for the current location and a score of -INFINITY
This should be used if the resource's stickiness and constraint scores total more than INFINITY (Currently 100,000)
NOTE: This will prevent the resource from running on this node until the constraint is removed with -U or the --lifetime duration expires
-s : (Advanced Use Only) ID of the instance_attributes object to change
-i : (Advanced Use Only) ID of the nvpair object to change/delete
Documento pdf para crear un cluster de Suse con dos recursos, cada uno en un servidor. Para ello definimos prioridades.
- Más comandos:
http://www.scribd.com/doc/46251784/Cganen1-6-CLuster
No hay comentarios:
Publicar un comentario