ConfigurationΒΆ

The lighthouse scripts are configured by passing in a root config directory which contains individual YAML config files and follows a certain layout:

<config dir>/
  |____logging.yaml
  |____balancers/
  |      |____haproxy.yaml
  |____discovery/
  |      |____zookeeper.yaml
  |____clusters/
  |      |____webcache.yaml
  |      |____pg-db.yaml
  |      |____users-api.yaml
  |____services/
  |      |____a_service.yaml
  |      |____other_service.yaml

There are five types of config file:

  • logging:

    This file lives at the root of the config directory and its contents are passed to the standard lib logging.config module’s dictConfig function.

    Configuring Logging

  • balancer:

    Files that configure the locally-running load balancer(s). These live in the balancers subdirectory. The project includes a plugin for HAProxy as a balancer.

    Configuring HAProxy

  • discovery:

    Discovery config files live in a discovery subdirectory, each file configures a single discovery method with a name matching the filename. The project includes a plugin for Zookeeper as a discovery method.

    Configuring Zookeeper

  • cluster:

    Cluster config files are found under the clusters subdirectory and denote services used by the local machine/node that should be watched for member node updates.

    Configuring Clusters

  • service:

    Each config file under the services subdirectory represents a local service to be reported as up or down via the discovery method(s). These files include configurations for a service’s health checks as well. The project includes simple HTTP and Redis health checks.

    Configuring Services

Note

Service vs. Cluster terminology: Think of a “service” as used in this documentation as describing an individual service provided by the local node/machine, a “cluster” as a description of a service consumed by the local node/machine.