Closed pipinstallyogi closed 4 years ago
@pipinstallyogi thx for issue!
so let me show you how to do it.
First I assume you created the 1st instance correctly with the configuration needed etc.
hana01:/usr/etc/hanadb_exporter # ls
config.json.example logging_config.ini metrics.json PRD_HDB00.json PRD_HDB01.json
I have created 2 configuration files.
cat PRD_HDB00.json
{
"exposition_port": 9668,
"multi_tenant": true,
"timeout": 600,
"hana": {
"host": "hana01",
"port": 30013,
"user": "SYSTEM",
"password": "MyFOOPWD"
},
"logging": {
"config_file": "/usr/etc/hanadb_exporter/logging_config.ini",
"log_file": "/var/log/hanadb_exporter_PRD_HDB00.log"
}
}
cat PRD_HDB01.json
{
"exposition_port": 9999,
"multi_tenant": true,
"timeout": 600,
"hana": {
"host": "hana01",
"port": 30013,
"user": "SYSTEM",
"password": "myfooPWD"
},
"logging": {
"config_file": "/usr/etc/hanadb_exporter/logging_config.ini",
"log_file": "/var/log/hanadb_exporter_PRD_HDB00.log"
}
}
then you activate the confi with the systemd
systemctl start prometheus-hanadb_exporter@PRD_HDB01.service
Note that the PRD_HDB01
map to systemd unit and I changed port.
Let me know if you have any other questions :white_flower: or you need clarifications
Thanks @MalloZup for the quick reply.
Sorry in advance for sending a long post. I really appreciate the easy way of explaining the solution for the issue. However, I am still stuck with few things.
Actually I am running an Ubuntu machine where I have configured the hanadb_exporter using Manual Clone as described in the repository:
git clone https://github.com/SUSE/hanadb_exporter cd hanadb_exporter source virt/bin/activate pip install pyhdb pip install . deactivate
The above setting are done for me in the directory /home/username/hanadb_exporter, whereas my config file is lying also inside /home/usename/hana_db_exporter. In the config.json file I have given the details about the HANA database which I wanted to connect. When I am running the command :
hanadb_exporter -c config.json -m metrics.json
the exporter get started and I can configure that in Prometheus and see the metrics.
Now the situation is, I wanted to connect this exporter to another HANA database. As you have just mentioned above and also stated in the repository (running hanadb_exporter as a daemon with systemd) it is based on openSUSE or SLE environment. As we only have the RPM package for the hanadb_exporter and not DEB Package so as to run it under ubuntu.
zypper install prometheus-hanadb_exporter
and not
sudo apt-get install prometheus-hanadb_exporter
I have tried to convert the .rpm package into .deb package using alien and then tried to follow the steps to run it as systemd (As you explained above). However not getting any success from it.
I have also tried to run systemctl start prometheus-hanadb_exporter@config1.service within virtual envt (where I am running the hanadb_exporter with the command : hanadb_exporter -c config.json -m metrics.json ) but to avail no success.
Can I run the second instance from my Ubuntu machine where I am already running one instance of hanadb_exporter? Within the setting I am currently having or any other way? Your inputs are highly appreciated. Thanks in advance.
Hi @pipinstallyogi , Happy to see that you are able to run the exporter in Ubuntu, we never tried that before . So, well done!
We can have multiple hanadb_exporter
executions running together in the same machine, as long as we are using a different exposition port for each of them. Each of the executions will monitor a single instance (multi-tenant of the same instance is available too). So, you cannot use 1 exporter instance to monitor 2 databases, you must have 2 executions of the exporter.
Setting the multi_tenant
option to true
just queries all of the databases of the same HANA system (SYSTEMDB
and PRD
, for example, being PRD
your system id).
What I would expect here, is that you have 2 configuration files config_hana_1.json
and config_hana_2.json
. They must have at least a different exposition_port
. Update the logging path too, to have individualized logs.
Later, you should run:
hanadb_exporter -c config_hana_1.json -m metrics.json
hanadb_exporter -c config_hana_2.json -m metrics.json
Each of the executions shouldn't have any impact in the other, as they are just python apps.
Thanks a lot. It worked now. Superb.
Hallo everyone,
Is it possible to run two instances of hanadb_exporter when we clone it manually to the system and run it inside Virtual environment? I have tried creating two virtual environments and running second instance inside it, but it does not work. I have created an additional config file for the second instance. Any inputs will be very helpful. Thanks in advance.
Best