Skip to content
This repository was archived by the owner on Dec 13, 2019. It is now read-only.

Commit 41b4641

Browse files
committed
added stagemonitor stack
1 parent 34dbc7a commit 41b4641

File tree

5 files changed

+188
-0
lines changed

5 files changed

+188
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# stagemonitor docker-compose
2+
3+
This docker-compose file consists of Elasticsearch, Grafana and Kibana with the [stagemonitor Kibana plugin](https://github.com/stagemonitor/stagemonitor-kibana).
4+
5+
## Prerequisites
6+
Docker and docker-compose
7+
8+
## Run
9+
10+
```
11+
git clone https://github.com/stagemonitor/stagemonitor-docker-compose.git
12+
cd stagemonitor-docker-compose
13+
docker-compose build
14+
docker-compose up
15+
```
16+
17+
To start the containers in the background run `docker-compose up -d`.
18+
19+
It can take several minutes to build the image. Especially, the build step `Optimizing and caching browser bundles...`.
20+
If you want to get started quicker, comment out the build line and uncomment the image line.
21+
22+
23+
Also, the first startup of Kibana can take a while. Don't give up when you see this message:
24+
```
25+
Optimizing and caching bundles for stagemonitor-kibana, kibana, stateSessionStorageRedirect, timelion and status_page. This may take a few minutes
26+
```
27+
28+
A few minutes later, you'll see this log message which indicates Kibana is now ready to be accessed.
29+
30+
```
31+
Optimization of bundles for stagemonitor-kibana, kibana, stateSessionStorageRedirect, timelion and status_page complete in 163.71 seconds
32+
```
33+
34+
## Elasticsearch
35+
36+
| Type of Elasticsearch installation | Elasticsearch URL |
37+
|---------------------------------------|---------------------------|
38+
| docker-compose on local linux machine or docker for mac/windows | [http://localhost:9200](http://localhost:9200) |
39+
| docker-compose with docker toolbox | http://192.168.99.100:9200 *|
40+
41+
`*` The IP can vary. Execute `docker-machine ip default` to see the actual IP if the default one doesn't work
42+
43+
## Kibana
44+
| Type of Kibana installation | Kibana URL |
45+
|---------------------------------------|---------------------------|
46+
| docker-compose on local linux machine or docker for mac/windows | [http://localhost:5601](http://localhost:5601) |
47+
| docker-compose with docker toolbox | http://192.168.99.100:5601 *|
48+
49+
`*` The IP may vary. Execute `docker-machine ip default` to see the actual IP if the default one doesn't work
50+
51+
52+
## Grafana
53+
| Type of Grafana installation | Grafana URL |
54+
|---------------------------------------|----------------------------|
55+
| docker-compose on local linux machine or docker for mac/windows | [http://localhost:3000](http://localhost:3000) |
56+
| docker-compose with docker toolbox | http://192.168.99.100:3000 *|
57+
58+
`*` The IP may vary. Execute `docker-machine ip default` to see the actual IP if the default one doesn't work
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
version: '2'
2+
services:
3+
elasticsearch:
4+
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.2
5+
environment:
6+
- cluster.name=monitoring-cluster
7+
- bootstrap.memory_lock=true
8+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" # adjust heap size, should be half of mem_limit (max 30g)
9+
- node.name=es-monitoring-01
10+
- xpack.graph.enabled=false
11+
- xpack.ml.enabled=false
12+
- xpack.monitoring.enabled=false
13+
- xpack.security.enabled=false
14+
- xpack.watcher.enabled=false
15+
- node.attr.box_type=hot
16+
## Note:
17+
# set - node.attr.box_type=hot for your beefy nodes with SSDs which hold the new indices and - node.attr.box_type=cold for historical nodes (see https://github.com/stagemonitor/stagemonitor/wiki/Elasticsearch#hot-cold-architecture)
18+
# increase the number of replicas (see https://github.com/stagemonitor/stagemonitor/wiki/Configuration-Options#number-of-es-replicas) if you want backups (needs more disk space)
19+
# don't forget to change the 'node.name' if you want multiple instances
20+
ulimits:
21+
memlock:
22+
soft: -1
23+
hard: -1
24+
nofile:
25+
soft: 65536
26+
hard: 65536
27+
mem_limit: 1g
28+
cap_add:
29+
- IPC_LOCK
30+
volumes:
31+
- esdata:/usr/share/elasticsearch/data
32+
ports:
33+
- 9200:9200
34+
networks:
35+
- esnet
36+
logging:
37+
driver: json-file
38+
options: # log rotation
39+
max-size: "10m"
40+
max-file: "20"
41+
kibana:
42+
# image: docker.elastic.co/kibana/kibana:5.6.0
43+
# Activates the stagemonitor kibana plugin.
44+
# It take several minutes to build the image. Also, the first invocation of Kibana can take a while
45+
# If you don't want this, comment out the build line and uncomment the image line
46+
build: kibana/
47+
ports:
48+
- "5601:5601"
49+
depends_on:
50+
- elasticsearch
51+
networks:
52+
- esnet
53+
environment:
54+
- XPACK_GRAPH_ENABLED=false
55+
- XPACK_MONITORING_ENABLED=false
56+
- XPACK_ML_ENABLED=false
57+
- XPACK_REPORTING_ENABLED=false
58+
- XPACK_SECURITY_ENABLED=false
59+
- XPACK_WATCHER_ENABLED=false
60+
- ELASTICSEARCH_URL=http://elasticsearch:9200
61+
logging:
62+
driver: json-file
63+
options: # log rotation
64+
max-size: "10m"
65+
max-file: "20"
66+
grafana:
67+
build: grafana/
68+
ports:
69+
- "3000:3000"
70+
depends_on:
71+
- elasticsearch
72+
networks:
73+
- esnet
74+
volumes:
75+
- grafana:/var/lib/grafana
76+
logging:
77+
driver: json-file
78+
options: # log rotation
79+
max-size: "10m"
80+
max-file: "20"
81+
volumes:
82+
esdata:
83+
driver: local
84+
grafana:
85+
driver: local
86+
networks:
87+
esnet:
88+
driver: bridge
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM grafana/grafana:4.5.2
2+
COPY ./entrypoint.sh /entrypoint.sh
3+
ENTRYPOINT ["/entrypoint.sh"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
./run.sh "${@}" &
4+
timeout 10 bash -c "until </dev/tcp/localhost/3000; do sleep 1; done"
5+
6+
curl -s -H "Content-Type: application/json" \
7+
-XPOST http://admin:admin@localhost:3000/api/datasources \
8+
-d @- <<EOF
9+
{
10+
"orgId": 1,
11+
"name": "ES stagemonitor",
12+
"type": "elasticsearch",
13+
"typeLogoUrl": "",
14+
"access": "proxy",
15+
"url": "http://elasticsearch:9200",
16+
"password": "",
17+
"user": "",
18+
"database": "[stagemonitor-metrics-]YYYY.MM.DD",
19+
"basicAuth": false,
20+
"basicAuthUser": "",
21+
"basicAuthPassword": "",
22+
"withCredentials": false,
23+
"isDefault": false,
24+
"jsonData": {
25+
"esVersion": 5,
26+
"interval": "Daily",
27+
"timeField": "@timestamp",
28+
"timeInterval": ">10s"
29+
},
30+
"secureJsonFields": {}
31+
}
32+
EOF
33+
34+
pkill grafana-server
35+
timeout 10 bash -c "while </dev/tcp/localhost/3000; do sleep 1; done"
36+
37+
exec ./run.sh "${@}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM docker.elastic.co/kibana/kibana:5.6.2
2+
RUN kibana-plugin install https://github.com/stagemonitor/stagemonitor-kibana/releases/download/v0.3.0/stagemonitor-kibana-0.3.0-5.6.2.zip

0 commit comments

Comments
 (0)