allomov
11/11/2014 - 12:29 AM

bind-elk-to-cf.sh

ELK-demo: 
  services: 
    kibana: 
      charm: "cs:trusty/kibana"
      num_units: 1
      expose: true
    elasticsearch: 
      charm: "cs:trusty/elasticsearch"
      num_units: 1
      constraints: mem=2000
      expose: true
    "logstash-agent": 
      charm: "cs:~lazypower/trusty/logstash-agent"
    "logstash-indexer": 
      charm: "cs:~lazypower/trusty/logstash"
      num_units: 1
  relations: 
    - - "kibana:rest"
      - "elasticsearch:client"
    - - "logstash-indexer:client"
      - "elasticsearch:client"
    - - "logstash-agent:input"
      - "logstash-indexer:input"
  series: trusty
# Deploy CF (see cloudfoundry charm README http://bazaar.launchpad.net/~cf-charmers/charms/trusty/cloudfoundry/trunk/view/head:/README.rst#L47)
./cfdeploy

# Deploy ELK bundle (see elk-bundle.yml)
juju-deployer -Wdvc elk-bundle.yml

# Connect logstash-agent and cc
juju add-relation logstash-agent cc
juju run --service cc "echo \"input {  file {    type => 'syslog'    path => ['/var/vcap/sys/log/**/*.log']    debug => true    format => json  }}\" > /opt/logstash-agent/conf.d/input_file_syslog.conf"
juju run --service cc "initctl restart logstash-agent"