loggregator update

  • Published on
    25-Jun-2015

  • View
    595

  • Download
    0

Embed Size (px)

DESCRIPTION

about loggregator, a CloudFoundry component

Transcript

<ul><li> 1. Copyright2014 NTT corp. All Rights Reserved. loggregator update NTT Software Innovation Center </li></ul> <p> 2. 1Copyright2014 NTT corp. All Rights Reserved. @kenojiri CloudFoundry V 3. 2Copyright2014 NTT corp. All Rights Reserved. loggregator CloudFoundry log aggregator loggregator CloudFoundry HTTP(WebSocket) CF HTTP http://www.slideshare.net/morika_t/16-cloud-foundry-loggregator 4. 3Copyright2014 NTT corp. All Rights Reserved. loggregator(1) $ cf push hello -n hello Creating app hello in org test / space test as admin... OK Using route hello.10.244.0.34.xip.io OK Uploading hello... Uploading app files from: /home/ntt/GO/src/github.com/tamac-io/cf-acceptance-tests/assets/hello-world Uploading 894, 5 files OK Starting app hello in org test / space test as admin... OK -----&gt; Downloaded app package (212K) -----&gt; Compiling Ruby/Rack -----&gt; Using Ruby version: ruby-2.0.0 -----&gt; Installing dependencies using 1.5.2 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 -- deployment Using bundler (1.5.2) Installing rack (1.5.2) Updating files in vendor/cache Your bundle is complete! Gems in the groups development and test were not installed. It was installed into ./vendor/bundle Bundle completed (0.40s) Cleaning up the bundler cache. -----&gt; WARNINGS: You have not declared a Ruby version in your Gemfile. To set your Ruby version add this line to your Gemfile: ruby '2.0.0' # See https://devcenter.heroku.com/articles/ruby-versions for more information. No Procfile detected, using the default web server (webrick) https://devcenter.heroku.com/articles/ruby-default-web-server -----&gt; Uploading droplet (13M) 1 of 1 instances running App started Showing health and status for app hello in org test / space test as admin... OK requested state: started instances: 1/1 usage: 256M x 1 instances urls: hello.10.244.0.34.xip.io state since cpu memory disk #0 running 2014-05-17 11:57:30 PM 0.0% 20.1M of 256M 0 of 1G 5. 4Copyright2014 NTT corp. All Rights Reserved. loggregator(2) $ cf logs hello Connected, tailing logs for app hello in org test / space test as admin... 2014-05-18T00:08:04.95+0900 [RTR] OUT hello.10.244.0.34.xip.io - [17/05/2014:15:08:04 +0000] "GET / HTTP/1.1" 200 13 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3" 10.244.0.34:41875 vcap_request_id:e6e7eb70-50ed-4a59-6c72-91122d3cf1fc response_time:0.141390983 app_id:0e974c86-346e-4e4a-8977-105211a9586c 2014-05-18T00:08:10.07+0900 [RTR] OUT hello.10.244.0.34.xip.io - [17/05/2014:15:08:09 +0000] "GET /hoge HTTP/1.1" 200 13 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3" 10.244.0.34:41601 vcap_request_id:3c1095aa-b0e6-4a3d-44f0- 4575f246dfba response_time:0.118677522 app_id:0e974c86-346e-4e4a-8977-105211a9586c ^c $ cf logs hello --recent Connected, dumping recent logs for app hello in org test / space test as admin... 2014-05-17T23:57:28.40+0900 [DEA] OUT Starting app instance (index 0) with guid 0e974c86-346e- 4e4a-8977-105211a9586c 2014-05-17T23:57:30.13+0900 [App/0] ERR [2014-05-17 14:57:30] INFO WEBrick 1.3.1 2014-05-17T23:57:30.13+0900 [App/0] ERR [2014-05-17 14:57:30] INFO ruby 2.0.0 (2014-05-08) [x86_64- linux] 2014-05-17T23:57:30.13+0900 [App/0] ERR [2014-05-17 14:57:30] INFO WEBrick::HTTPServer#start: pid=33 port=61001 2014-05-17T23:58:19.52+0900 [RTR] OUT hello.10.244.0.34.xip.io - [17/05/2014:14:58:19 +0000] "GE T / HTTP/1.1" 200 13 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3. 4 libidn/1.23 librtmp/2.3" 10.244.0.34:38142 vcap_request_id:30522106-ba66-4094-5746-d91b4f3f2146 response_time:0.170692205 app_id:0e974c86-346e-4e4a-8977-105211a9586c 2014-05-18T00:08:04.95+0900 [RTR] OUT hello.10.244.0.34.xip.io - [17/05/2014:15:08:04 +0000] "GE T / HTTP/1.1" 200 13 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3. 4 libidn/1.23 librtmp/2.3" 10.244.0.34:41875 vcap_request_id:e6e7eb70-50ed-4a59-6c72-91122d3cf1fc response_time:0.141390983 app_id:0e974c86-346e-4e4a-8977-105211a9586c 2014-05-18T00:08:10.07+0900 [RTR] OUT hello.10.244.0.34.xip.io - [17/05/2014:15:08:09 +0000] "GE T /hoge HTTP/1.1" 200 13 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1. 2.3.4 libidn/1.23 librtmp/2.3" 10.244.0.34:41601 vcap_request_id:3c1095aa-b0e6-4a3d-44f0-4575f246dfba response_time:0.118677522 app_id:0e974c86-346e-4e4a-8977-105211a9586c 6. 5Copyright2014 NTT corp. All Rights Reserved. Router CCDEA CCDEA Router API log dea_logging _agent app log (STDOUT/ STDERR) warden container app instance access log loggregator trafficcontroller loggregator _trafficcontroller staging log loggregatorloggregator log log CF UDP WebSocket CLI loggregator 7. 6Copyright2014 NTT corp. All Rights Reserved. UDP Syslog UUID(appid) (API/DEA/STG/APP/RTR/) () github.com/cloudfoundry/loggregator lib/emitter 8. 7Copyright2014 NTT corp. All Rights Reserved. WebSocket WebSocketURL /v2/info API $ curl -k https://api.10.244.0.34.xip.io/v2/info {"name":"vcap", "build":"2222", "support":"http://nttlabs.info/", "version":2, "description":"Cloud Foundry on bosh-lite", "authorization_endpoint":"https://uaa.10.244.0.34.xi p.io", "api_version":"2.4.0", "logging_endpoint":"wss://loggregator.10.244.0.34.xi p.io:443"} 9. 8Copyright2014 NTT corp. All Rights Reserved. WebSocket URLappid Gorouter ... loggregator.10.244.0.34.xip.io:443 - [22/05/2014:15:08:04 +0000] "GET /tail/?app=031ac4c4-d2b6-4df8-a700-a2513fac8e10 HTTP/1.1" Mi ssingResponseStatusCode 0 "-" "-" 10.244.0.34:45519 vcap_request_ id:afc124a9-9891-45c7-4aba-bde23ffaed67 response_time:MissingFini shedAt app_id: ... loggregator.10.244.0.34.xip.io:443 - [22/05/2014:15:24:09 +0000] "GET /recent?app=cdf44a31-f159-4458-a9ca-0929555f44dc HTTP/1.1" 4 00 26 "-" "Go 1.1 package http" 10.244.0.34:51756 vcap_request_id :5f55da2a-e2ea-44b3-5c38-faf763ab027a response_time:0.512795756 a pp_id: ... loggregator.10.244.0.34.xip.io:443 - [22/05/2014:15:24:10 +0000] "GET /dump/?app=cdf44a31-f159-4458-a9ca-0929555f44dc HTTP/1.1" Mi ssingResponseStatusCode 0 "-" "-" 10.244.0.34:51765 vcap_request_ id:5e2d2fde-ac58-4636-5c66-16e239189671 response_time:MissingFini shedAt app_id: ... 10. 9Copyright2014 NTT corp. All Rights Reserved. log sink sink appidsink appidsink sink dump dumpdump app 1 app 2 app N 11. 10Copyright2014 NTT corp. All Rights Reserved. syslog drain app 1 WebSocket WebSocket sink syslog (rsyslogd, Splunk, fluentd, ) syslog drain 12. 11Copyright2014 NTT corp. All Rights Reserved. syslog drain CLI URLschemesyslog syslog-tls https fluentd $ cf create-user-provided-service my-fluentd -l syslog://fluentd.hoge.me:5140 $ cf push my-app $ cf bind-service my-app my-fluentd $ cf create-user-provided-service l 13. 12Copyright2014 NTT corp. All Rights Reserved. loggregator Diego etcd log sink DEADiego warden container app instance loggregator trafficcontroller loggregator _trafficcontrollerstaging log app log loggregatorloggregator log sink log sink etcd 14. 13Copyright2014 NTT corp. All Rights Reserved. </p>