User:XenGi

From ArchWiki
Jump to: navigation, search

Sensu bla bla

Installation Strategies

Standalone

For a standalone setup you can install all of Sensu’s dependencies and services on a single system. Sensu’s modular design makes it easy to upgrade from a standalone installation to a distributed or high-availability installation, so unless you have some specific technical requirement that demands a distributed or high availability installation, there’s usually no need to start with a more complex installation.

Distributed

For a distributed setup you can install Sensu’s dependencies (e.g. RabbitMQ and/or Redis) and services (i.e. the Sensu server and API) on separate systems. The only difference between a Standalone installation and a Distributed installation is that Sensu’s dependencies and services are running on different systems.

Prerequisites

Data store

Sensu uses Redis as a data-store for storing persistent data such as the client registry and check results. Two Sensu Core services, the server and API require access to the same instance of Redis to function (i.e. the Sensu client does not communicate with Redis).

Transport

Sensu services use a message bus (e.g. RabbitMQ) for communication. This message bus communication is provided by the Sensu Transport, which is a library that makes it possible to leverage alternate transport solutions in place of RabbitMQ (the default transport). Sensu services requires access to the same instance of the defined transport (e.g. a RabbitMQ cluster) to function. Sensu check requests and check results are published as "messages" to the Sensu Transport, and the corresponding Sensu services receive these messages by subscribing to the appropriate subscriptions.

Configure RabbitMQ access controls

Access to RabbitMQ is restricted by access controls (e.g. username and password). For Sensu services to connect to RabbitMQ a virtual host (vhost) and user credentials will need to be created.

Create a dedicated RabbitMQ vhost for Sensu

sudo rabbitmqctl add_vhost /sensu

Create a RabbitMQ user for Sensu

sudo rabbitmqctl add_user sensu secret sudo rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"

Configure Sensu

Example Standalone Configuration

Copy the following contents to a configuration file located at /etc/sensu/conf.d/rabbitmq.json:

  {
    "rabbitmq": {
      "host": "127.0.0.1",
      "port": 5672,
      "vhost": "/sensu",
      "user": "sensu",
      "password": "secret"
    }
  }

Example Distributed Configuration

Obtain the IP address of the system where RabbitMQ is installed. For the purpose of this example, we will assume 10.0.1.6 is our IP address. Create a configuration file with the following contents at /etc/sensu/conf.d/rabbitmq.json on the Sensu server and API system(s), and all systems running the Sensu client:

  {
    "rabbitmq": {
      "host": "10.0.1.6",
      "port": 5672,
      "vhost": "/sensu",
      "user": "sensu",
      "password": "secret"
    }
  }

Server and API