GrafHana (Grafana and HANA on docker) is a collection of docker containers for developing queries and metrics related to a HANA database. It can also be used for getting familar with Grafana, Prometheus, Loki and Prometheus Alertmanager. And last but not least for getting first experiances on HANA.
Onced prepared it also can be used for demos running on any Laptop with at least 16 GB of memory.
- Easy to deploy within 15 min.
- A Laptop with >= 16 GB of RAM is enough.
- CPUs are limited to 2.5 to not decrease the overall performance of the system to much.
- All Grafana components are already pre-configured and can be used out of the box.
- The HANA installation of GrafHana is using template files for the installation. No interaction during the installation is needed at all.
- Beside docker, no other special packages are needed on the system.
- Persistent volumes are used to not lose any data. (Grafana components only)
Please note that HANA running inside the container was never created and tested for productive use at all. These container has only a extreamly minimum of packages to get the HANA started. It also limits CPU usage and memory to a absolute minimum.
-
hana01
- hana 2.0 (HANA installation source is needed - see below)
- promtail
- node-exporter
- blackbox-exporter
- grafana loki
-
prometheus
- grafana prometheus
-
loki
- grafana loki
-
grafana
- grafana dashboard
-
alertmanager
- alertmanager for e.g. email notify
├── conf
│ ├── grafana.ini
│ ├── loki
│ │ ├── loki.yaml
│ │ └── rules
│ │ └── rules.yml
│ ├── alertmanager.yml
│ ├── alertmanager-template.yml
│ ├── blackbox.yaml
│ ├── prometheus
│ │ ├── prometheus-rules.yml
│ │ └── prometheus.yml
│ └── promtail.yml
├── docker-compose.yaml
├── Dockerfile
├── examples
│ [...]
│ ├── commands.md
│ ├── logo01.png
│ ├── templateFile
│ └── templateFile.xml
├── grafana
│ └── data
│ └── grafana.db
├── hana
│ └── (DATA_UNITS)
│ └── (HDB_SERVER_LINUX_X86_64)
│ [...]
│ ├── (templateFile)
│ └── (templateFile.xml)
└── README.md
Important:
The SAP HANA installation files (DATA_UNITS/HDB_SERVER_LINUX_X86_64) are not included. They have to download and add separately.
To run all the container you need at least 16 GB RAM and about 50 GB of diskspace.
-
Clone the repository.
-
Download and unpack the original HANA sources from SAP.
-
Copy or symlink the HANA source files to the directory hana/ (see Directory structure above)
In our example we only needDATA_UNIT/HDB_SERVER_LINUX_X86_64
(it is about 4G). -
Because we install HANA in batch mode we need two templateFiles:
templateFile.xml
containing the HANA configuration.tempateFile
where all the passwords are stored.
Already prepared example files can be find in the folder example
These files has to be placed under
hana/DATA_UNIT/HDB_SERVER_LINUX_X86_64
.If you like to create these template files from scratch the following command is needed: ./hdblcm --dump_configfile_template=templateFile --action install
-
Edit and rename the file alertmanager-template.yml to you needs.
Run:
docker-compose --compatibility up -d
-
Grafana Dashboard: http://localhost:3000
-
Grafana Prometheus: http://localhost:9090
-
Alertmanager: http://localhost:9093
-
Exec into HANA:
docker exec -it hana01 /bin/bash
-
Progress of the HANA installation can be checked with:
docker logs -f hana01
-
Stop the whole stack
docker-compose --compatibility down
The grafana config (including Dashboards, grafana.ini, etc) are persistent after stopping.
Any HANA DB changes will get lost.
Default password for HANA is Suse1234
GrafHana is currently collecting the following files whith Promtail:
- backup logs
- indexserver traces
- nameserver traces
- system_availability traces
- /var/log/messages from the docker host
On deploying GrafHana, Prometheus and its node-exporter is running out of the box. There is also a Node Exporter Dashboard available.
Prometheus and Loki Alerts vial Alertmanager are possible. (see Using Alerts)
On default, if you run GrafHana the HANA DB will always installed from scratch. Installing takes about 15 min. It is however possible to take a "screenshot" from the current running container with the command docker commit
. This will create a image copy of the current state of the hana container.
The following steps are needed to get it permanent running with docker-compose:
- Run the first time
docker-compose --compatibility up -d
like describe above. - Wait until HANA is complete install.
- Run the command:
docker commit hana01 hana2
to get a new docker image. - Stop the containers with
docker-compose --compatibility down
- Change the following lines in docker-compose.yaml:
1.image: hana:latest
toimage: hana2:latest
2.cd /src && cat templateFile.xml | ./hdblcm --action=inst....
tosu - ha0adm HDB start
- Run
docker-compose --compatibility up -d
Note Please keep in mind that the HANA licence might expire after some weeks.
It is sometimes usefull to not start/install the HANA DB but instead starting only all the Grafana tools. I use this often if I for example only want to troubleshoot my promtail or loki configuration. The latest version of the docker-compose.yaml file has the whole HANA Install line outsoureced to the env variable $HANA
.
There is now a new enviroment file named ".env-noHANA" which can be used with the following command:
docker-compose --compatibility --env-file .env-noHANA up -d
Because these new file has HANA=""
in it the HANA DB will not started.
Alerts can configured in different way's and for different sources. GrafHana is currently able to use Prometheus and Loki rules. there is a template/example for each rule type available:
- Prometheus rule file:
conf/prometheus/rules/rules.yml
- Loki rule file:
conf/loki/rules/fake/rules.yaml
For both way's the prometheus alertmanager will be used to manage the alert's. There is also a template alertmanager yaml file avaiable:
alertmanager-template.yml
It can be changed to you needs and has to be renamed to alertmanager.yml
.
This feature has been moved to a separate project.
Please see new repository called: Grafhista.