Archive for November 2010

Reading time: < 1 minute

AptURL o APT protocol plateja una idea molt interessant. Per exemple, quan estem mirant una pàgina web i aquesta ens parla d’un aplicatiu per Debian/Ubuntu la idea seria clicar a un enllaç del tipus: apt:exampleapp i això llençaria el gestor d’aplicacions (package manager) del sistema APT que instal·laria aquesta applicació en el nostre sistema.
Per tal de fer això possible hi ha una serie d’extencions per diversos navegadors: firefox, crhome, konqueror, opera, etc. si voleu més informació podeu consultar el wiki d’ubuntu on parla de AptURL.

Tags: , , , , , , , ,

Reading time: < 1 minute

Al wiki fa uns dies vaig començar una secció referedia a temes de balanceig de càrrega i alta disponibilitat en linux, en escència són fruit de la recol·lecció d'informació que vaig fer per preparar un projecte que estic montant i que requereix aquestes funcionalitats.

Així doncs, per donar-li rellevancia aquestes notes malgrat no estan acabades ni tenen un ordre i idioma depurats les adjunto aquí.

HA and load balancing in linux

Summary

highlighted: load balancers

HAProxy

  • last version: 29/10/2010
  • load balancer for HTTP and TCP
  • client-side-keepalive
  • TCP speedups
  • RDP protocol compatible
  • source-based stickiness
  • stats interface
  • health checks
  • HTTP auth
  • server management via CLI
  • ACL based persistence
  • Log analyzer
  • Transparent proxy
  • Content inspection
  • App cookies
  • Hot-reconfig

highlighted: HA

Keepalived

  • last update: 6/5/2010
  • HA and health check
  • hot-standby protocol
  • uses VRRP for VIP

Heardbeat

  • last update: Abr/2010
  • HA and health check
  • host-standby
  • part of LVS project

Wackamole/Spread

  • last update: 28/12/2007
  • HA and health check
  • host-standby
  • manages a pool of balanced IPs, no only a VIP

Load Balancers

HAProxy

ldirectord

  • part of LVS

ldirectord is a daemon to monitor and administer real servers in a LVS cluster of load balanced virtual servers. ldirectord typically used as a resource for Linux-HA , but can also be run from the command line.
ldirectord monitors the health of the real servers by periodically requesting a known URL and checking that the response contains an expected response. If a real server fails then the server is removed and will be reactivated once it comes back on line. If all the real servers are down then a fall-back server is inserted into the pool, which will made quiescent one of the real web servers comes back on line. Typically, the fall-back server is localhost. If an HTTP virtual service is being provided then it is useful to run an Apache HTTP server that returns a page indicating that the service is temporarily inaccessible.

relayd

  • only for BSD

High availability

keepalived

  • strong & robust health-check framework
  • implementing a Hot Standby protocol

Heardbeat

  • daemon that provides cluster infrastructure (communication and membership) services to its clients
  • permit know about the presence (or disappearance!) of peer processes on other machines and to easily exchange messages with them.
  • needs to be combined with a cluster resource manager (CRM) which has the task of starting and stopping the services (IP addresses, web servers, etc.) that cluster will make highly available
  • Pacemaker is the preferred cluster resource manager for clusters based on Heartbeat.
  • The CRM (a.k.a Pacemaker) is a Cluster Resource Manager which implements the cluster configuration provided by the user in CIB (Cluster Information Base). The CIB is a set of instructions coded in XML. Editing the CIB is a challenge, not only due to its complexity and a wide variety of options, but also because XML is more computer than user friendly.

Wackamole+Spread

  • monitoring
  • Wackamole is an application that helps with making a cluster highly available. It manages a bunch of virtual IPs, that should be available to the outside world at all times. Wackamole ensures that a single machine within a cluster is listening on each virtual IP address that Wackamole manages. If it discovers that particular machines within the cluster are not alive, it will almost immediately ensure that other machines acquire these public IPs. At no time will more than one machine listen on any virtual IP. Wackamole also works toward achieving a balanced distribution of number IPs on the machine within the cluster it manages.
  • Spread is an open source toolkit that provides a high performance messaging service that is resilient to faults across local and wide area networks. Spread functions as a unified message bus for distributed applications, and provides highly tuned application-level multicast, group communication, and point to point support. Spread services range from reliable messaging to fully ordered messages with delivery guarantees.

LVS: load balancer and HA solution

A LVS cluster consists or one or more virtual services each of which may have zero or more real servers. The IP address of a virtual service is what end-users connect to and is typically advertised over DNS. When a connection is made to a virtual service, it is allocated a real server, and all packets for this connection are forwarded to this real server.

  • TCP/IP and UDP/IP connections to be load balanced
  • Layer 4 Switching as information available
  • layer 3 is used to make load balancing decisions.
  • Heartbeat is the core: messages are sent at regular intervals between machines and if a message is not received from a particular machine then the the machine is assumed to have failed and some form of evasive action is taken
  • heartbeat starts up master node sets up an interface for a virtual IP address
  • IP Address Takeover: If this node fails then another node in the heartbeat cluster will start up an interface for this IP address and use gratuitous ARP to ensure that all traffic bound for this address is received by this machine
  • Each virtual IP address is considered to be a resource
  • the resource can be started and stopped, and its can be asked if it is running or not
  • Ultra Monkey makes use of heartbeat on linux-directors to mangage IP addresses and monitor real-servers using the IPaddr2 resource and ldirectord running as a resource respectively.

Tags: , , , , , , , , , , ,

Reading time: 2 – 2 minutes

Potser a alguns els semblarà rara la recomanació d’una aplicació per Windows i encara més si aquesta esta fet amb Silverlight. Però he de reconeixer que a mi m’esta resultat una eina força còmode.

Perquè l’utilitzo:

  • Des d’una sola eina i amb una sola línia de temps veig:
    • twitter
    • facebook
    • linked.in
    • google buzz
  • Obviament puc, fer tot tipus d’accions sobre cada una de les entrades vingui d’on vingui el contingut. O sigui, comentaris, retweets, preview d’imatges, informació dels usuarios, etc.
  • També puc escoltar last.fm des de la mateixa aplicació i compartir la informació de les cançons que escolto quan m’interessa.
  • S’actualitzen en temps real les línies de temps de les diferents eines, via streams.
  • També puc postejar sobre quasevol de les xarxes socials o fins hi tot sobre totes a la vegada.

Per acabar un parell d’screenshots perquè ús feu una idea del seu aspecte, el primer és la finestra de l’aplicació tal qual la faig correr jo:

el segon és l’aplicació a ‘full-screen’:

Pàgina web de l’aplicació: Seesmic, l’eina esta disponible també com a plug-in d’un munt de navegadors i de quasi tots els sistemes operatius mòbils moderns.

Tags: , , , , , , , , , ,

Reading time: 2 – 2 minutes

A aquestes altures tothom coneix screen i a quin més qui menos li ha solucionat més d’un problema. Pels que no el coneixeu, podeu donar un cop d’ull als posts que vaig fer sobre el tema:

Per començar un screenshot de l’eina:
byobu screenshot

Pel que fa a les funcionalitats hereda tota la potència i accessos ràpids que té screen, a més d’un entorn basat en ncurses per configurar l’aspecte de les pantalles i comportament de l’eina. És genial amb un cop d’ull poder saber les consoles que tenim obertes i monitoritzar el sistema des de la shell. A més també permet instal·lar-se al ~/.profile de l’usuari de forma senzilla (byobu-launcher-install) perquè al fer un login o un ssh tinguem la sessió directament dintre del byobu.

A la Ubuntu Lucid (10.04) i a Fedora 14 ja he trobat el paquet, pel que fa a MeeGo aquest no estava disponible però m’he baixat el tar.gz i compilar-lo ha estat 1s.

La pàgina web de: byobu.

Algunes referències interessants de les tecles d’screen:

Tags: , , , , , , ,

Reading time: 1 – 2 minutes

Mai ho havia necessitat fins avui, tenia un samba que accedia a un AD per saber quins eren els seus usuaris i grups d’usuaris. Així doncs, el problema que tenia era com podia saber quins usuaris tenia i quins grups. Es veu que tot això es fa a través de la comanda wbinfo.

A continuació poso una petita referència dels paràmetres que més bé m’han anat:

# llista usuaris
wbinfo -u
# llista grups
wbinfo -g
# info d'un usuari
wbinfo -i DOMINI+username
# grups que té l'usuari
wbinfo -r DOMINI+username
# informació d'un grup a partir del GID
wbinfo --gid-info=GID
# obtenir el GID a partir del nom del grup
wbinfo --group-info=DOMINI+groupname
# informació d'un usuari a partir del UID
wbinfo --uid-info=UID

Referència completa de la comanda: wbinfo

Tags: , , , , , , ,

Reading time: < 1 minute

No tenia gaire frescos els mecanismes que usava Zeroconf per treballar, així doncs, arran d'un comentari fet pel Marcos he decidit invertir-hi una estoneta per fer-me uns petits apunts sobre el tema.

Són quatre notes que he posat al wiki i que enllaço a continuació espero que ús siguin útils.

ZeroConf

  • Zeroconf o Zero Configuration Networking es un conjunto de técnicas que permiten crear de forma automática una red IP sin configuración o servidores especiales.
  • Automatic Private IP Addressing o APIPA, permite a los usuarios sin conocimientos técnicos conectar ordenadores, impresoras de red y otros elementos y hacerlos funcionar.
  • Selecciona una dirección IP para los elementos de red.
  • Descubre qué ordenador tiene determinado nombre. Dos modos:
    • MulticastDNS (mDNS) – el más usado, no estandarizado
      • Permite a un device seleccionar un nombre de dominio para el TLD: .local y anunciarlo via una dirección multicast especial
      • mDNS es compatible con DNS-SD
    • Link-local Multicast Name Resolution (LLMNR) – de MS, menos usado y en trámites de estandarización por la IETF
      • El borrador actual de LLMNR permite a un dispositivo de red seleccionar cualquier nombre de dominio
  • Descubre dónde se encuentran los servicios, como el de impresión.
      • protocolo de Apple
      • soportado por varios dispositivos de Apple y otras marcas
      • se considera más simple de implementar que SSDP porqué usa DNS y no HTTP
      • usa los registros DNS SRV – RFC 2782, TXT y PTR para informar de los servicios (SIN – Service Instant Names)
    • UPnP
      • SSDP – Simple Service Discovery Protocol
      • Usado por WXP y algunos dispositivos
      • se considera complejo a pesar del nombre
      • usa notificaciones HTTP con una URI de tipo de servicio y un nombre de servicio unico (USN – Unique Service Name)
      • nombres de servicio regulados por el Universal Plug and Play Steering Committee
    • SLP (Service Location Protocol)
      • estándard RFC 2608
      • ignorado por los grandes fabricantes, excepto Novell

Bonjour de Apple

  • solución Zeroconf más adoptada
  • IPv4 link-local
  • mDNS
  • DNS-SD

Avahi – Open Source implementation

  • active OS project
  • mDNS
  • DNS-SD
  • uses D-BUS
  • default daemon in most linux distributions
  • compatible with Apple Bonjour, pass conformance test suite
  • Drops all privileges and runs as user “avahi”
  • IPv4 and IPv6 support
  • chroot support
  • Support for loading static service definitions from XML fragments
  • Ability to reflect mDNS traffic between multiple subnets
  • Ability to configure a unicast DNS server automatically from server data published on the LAN
  • Compatibility libraries implementing a subset of the HOWL and Apple Bonjour APIs – needed to get IP address in LAN
  • nss-mdns is a plugin for the GNU Name Service Switch (NSS) functionality of the GNU C Library (glibc) providing host name resolution via Multicast DNS (aka Zeroconf, aka Apple Rendezvous, aka Apple Bonjour), effectively allowing name resolution by common Unix/Linux programs in the ad-hoc mDNS domain .local.

References

Tags: , , , , , , ,