Wiki

Clone wiki

opsworks-recipes / Deploying sensu with Opsworks

Deploying Sensu using Docker containers on Amazon Opsworks.

  • Log in your AWS Account

VPC

  • Select VPC service
  • Select or create a new VPC
  • Make sure this VPC has DNS Hostnames enabled (Yes)

DNS

  • Select Route53 service
  • Create a new internal hosted zone
  • Associate with a previous VPC

OPSWorks

  • Select Opsworks service
  • Create a new stack
      It only supports Chef12.
      Put the stack name (You can use any stack name).
      Select the region.
      Select the previous VPC.
      Select the AZ.
      Select the operational system.
      Select the SSH Key.
      Enable custom Chef cookbooks.
      Select Git as repository type.
      Put "https://bitbucket.org/tnache/opsworks-recipes.git" as repository URL.
      Click on "Add stack".
    
  • Create sensu layer
      Put the layer name and short name as sensu
      Select the security groups.
      Click on "Add layer".
    
  • Configure the layer
      Click on "recipes".
      Add sensu,sensu::server,sensu::client,docker-compose at Setup life cycle.
      Add docker-compose::deploy at Deploy life cycle.
      Add docker-compose::kill, docker-compose::rm at Shutdown life cycle.
      Click on "save".
      Make sure network configuration of the layer is correct (it depends on your VPC configuration). The instance needs access to the internet.
    
  • Configure stack custom JSON
      Go back to Stack (on the left side).
      Click on "Stack Settings".
      Click on "Edit".
      Put the file below as Custom JSON
    
    Server Sensu Custom JSON

Server Client Custom JSON

Note: You need to update the DNS configuration at node[:route53][:zone_id] and rabbitmq password on node[:layers][:sensu][:applications][:rabbitmq][:environment][:RABBITMQ_DEFAULT_PASS] and node[:sensu][:amqp][:pass].

  • Create two instances

Note: This is an active/standby cluster strategy. You should use the recipe below to determine which is the active node.

  • Run sensu::update_dns recipe on instance would be the active node

Note: The note should have permission to update the hosted zone. Use IAM.

  • Open a browser on http://sensu-server.your.hostedzone:3000

Updated