Created
July 12, 2023 02:52
-
-
Save BoredHackerBlog/9d307c22e0829eee7101edb60c3f9595 to your computer and use it in GitHub Desktop.
elasticsearch grafana with anonymous explore view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:8.8.0 | |
container_name: elasticsearch | |
environment: | |
- xpack.security.enabled=false #there is no password to access ES!! | |
- xpack.security.enrollment.enabled=false | |
- discovery.type=single-node | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
nofile: | |
soft: 65536 | |
hard: 65536 | |
cap_add: | |
- IPC_LOCK | |
volumes: | |
- elasticsearch-data:/usr/share/elasticsearch/data | |
ports: | |
- 9200:9200 | |
#- 9300:9300 | |
networks: | |
- es_grafana_net | |
grafana: | |
image: grafana/grafana:latest | |
container_name: grafana | |
environment: | |
- GF_SECURITY_ADMIN_USER=research #grafana admin username | |
- GF_SECURITY_ADMIN_PASSWORD__FILE=/run/secrets/grafana_password #grafana admin password comes from secrets file | |
- GF_USERS_VIEWERS_CAN_EDIT=true #viewers can go into the explore view | |
- GF_AUTH_ANONYMOUS_ENABLED=true #allow anonymous / without login | |
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer #give anonymous viewer role | |
- GF_AUTH_ANONYMOUS_HIDE_VERSION=true #hide version | |
- GF_AUTH_ANONYMOUS_ORG_NAME=Main Org. #use default org | |
volumes: | |
- grafana-data:/var/lib/grafana | |
ports: | |
- 3000:3000 | |
networks: | |
- es_grafana_net | |
secrets: | |
- grafana_password | |
secrets: | |
grafana_password: | |
file: ./grafana_password.txt #grafana password should be in this file | |
volumes: | |
elasticsearch-data: | |
grafana-data: | |
networks: | |
es_grafana_net: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create grafana_password.txt in the same folder as docker-compose and add password to it | |
docker compose up -d to run | |
in connections, new connection to ES should be made w/ ES url being http://elasticsearch:9200 | |
ES wont have indices by default so those will need to be added before grafana shows anything useful | |
ES 9200 is not password protected!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment