CloudFoundry(bosh-lite)のログを収集してkibanaで表示する

# CloudFoundry(bosh-lite)のログを収集してkibanaで表示する

事前にインストールするもの
- python: https://github.com/yyuu/pyenv
- docker: https://docs.docker.com/installation/ubuntulinux/
- docker-compose: https://docs.docker.com/compose/
- fabric: http://www.fabfile.org/installing.html


注意事項
- ファイルディスクリプタを大きくする http://qiita.com/kazunori279/items/5aedb6ed548225545a3c


## 受信側
```
$ git clone https://github.com/k-kurumi/docker_collector
$ cd docker_collector
$ docker-compose up
```


## 送信側
```
$ cd ~/workspace
$ git clone https://github.com/k-kurumi/fabric_bosh_lite_helper
$ cd fabric_bosh_lite_helper


$ bosh vms
Deployment `cf-services-contrib'

Director task 9

Task 9 done

+----------------------+---------+---------------+-------------+
| Job/index            | State   | Resource Pool | IPs         |
+----------------------+---------+---------------+-------------+
| mongodb_gateway/0    | running | gateway_z1    | 10.244.1.2  |
| mongodb_node/0       | running | node_z1       | 10.244.1.82 |
| postgresql_gateway/0 | running | gateway_z1    | 10.244.1.10 |
| postgresql_node/0    | running | node_z1       | 10.244.1.90 |
| rabbit_gateway/0     | running | gateway_z1    | 10.244.1.6  |
| rabbit_node/0        | running | node_z1       | 10.244.1.86 |
| redis_gateway/0      | running | gateway_z1    | 10.244.1.14 |
| redis_node/0         | running | node_z1       | 10.244.1.94 |
+----------------------+---------+---------------+-------------+

VMs total: 8
Deployment `cf-warden'

Director task 10

Task 10 done

+------------------------------------+---------+---------------+--------------+
| Job/index                          | State   | Resource Pool | IPs          |
+------------------------------------+---------+---------------+--------------+
| unknown/unknown                    | running | small_errand  | 10.244.0.178 |
| unknown/unknown                    | running | small_errand  | 10.244.0.182 |
| api_z1/0                           | running | large_z1      | 10.244.0.138 |
| etcd_z1/0                          | running | medium_z1     | 10.244.0.42  |
| ha_proxy_z1/0                      | running | router_z1     | 10.244.0.34  |
| hm9000_z1/0                        | running | medium_z1     | 10.244.0.142 |
| loggregator_trafficcontroller_z1/0 | running | small_z1      | 10.244.0.150 |
| loggregator_z1/0                   | running | medium_z1     | 10.244.0.146 |
| login_z1/0                         | running | medium_z1     | 10.244.0.134 |
| nats_z1/0                          | running | medium_z1     | 10.244.0.6   |
| postgres_z1/0                      | running | medium_z1     | 10.244.0.30  |
| router_z1/0                        | running | router_z1     | 10.244.0.22  |
| runner_z1/0                        | running | runner_z1     | 10.244.0.26  |
| uaa_z1/0                           | running | medium_z1     | 10.244.0.130 |
+------------------------------------+---------+---------------+--------------+

VMs total: 14


## bosh vmsの情報を元にcf-warden側のunknown以外を対象にfabする
## dockerホストのIPは192.168.1.220とする

$ fab -H 10.244.0.138,10.244.0.42,10.244.0.34,10.244.0.142,10.244.0.150,10.244.0.146,10.244.0.134,10.244.0.6,10.244.0.30,10.244.0.22,10.244.0.26,10.244.0.130 fluentd.forward:192.168.1.220
# (時間がかかる)
```

## 動作確認

dockerホストの5601でkibana4が動作している
![kibana4.png](https://qiita-image-store.s3.amazonaws.com/0/56105/36a672b1-1c44-8a5f-86df-aed24c30cbf9.png)