A sample docker compose file for BYFN from fabric-samples with fluentd log driver output enabled, and is connected to ElasticSearch and Kibana.
NOTE The docker-compose file attached here is based on BYFN (fabric-samples) matching hyperledger fabric v1.1. However, it should be trivial to apply for others (such as v1.2).
Thanks to this blog in Qiita (Japan) - https://qiita.com/cgetc/items/345e3c686910b30ba49f.
See Hyperledger Fabric byfn with fluent logging but use the docker-compose file and fluentd.conf attached here instead.
- Change to fabric-samples/first-network directory.
- Create fluentd and elasticsearch directory under first-network directory.
- Copy docker-compose-cli-logging-EK.yaml and replace docker-compose-cli.yaml under first-network directory.
- Place fluentd.conf and fluentd Dockerfile under fluentd directory.
- Place elasticsearch Dockerfile under elasticsearch directory.
- Set VM max memory to 262144 or more (ElasticSearch requires more than default container memory size).
- On Linux host: sudo sysctl -w vm.max_map_count=262144
- On macOS or Windows, see https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docker.html#docker-cli-run-prod-mode.
- Start byfn.sh
- $ ./byfn.sh -m up
Note: "Error response from daemon: configured logging driver does not support reading" message is expected so don't worry.
- Access Kibana by connecting to http://localhost:5601/.
- For new Kibana users: Set "*" for index pattern and save and click "Discover" to see logs. You also may want to click "Last 15 minutes" on the upper right corner and select "Today", if your logs are more than 15 minutes away.
X. To quit, simply teardown byfn.
- $ ./byfn.sh -m down