Closed hmmxp closed 5 years ago
The preparation and installation required for the worker are the same as for the web app.
Then you register and start like this:
# Register prometheus server
# Syntax: promgen register <shard name> <prometheus host> <prometheus port>
promgen register default localhost 9090
# Start worker
# Syntax: celery -A promgen worker -l <log level> -Q <queues>
celery -A promgen worker -l info -Q localhost
The worker needs to subscribe to the queue with the host name of the prometheus server.
You can also have a look at #57, it includes documentation on how to setup the web app and the worker using docker.
i believe the above is for push model if promgen and promethues is installed on the same server.
But my Prometheus and promgen is on different server, how can i configure pull model?
Update:
I saw this article https://github.com/kfdm/promgen/blob/5baa8fe44e6f5bac78f4f33989990d0101c5b40b/docs/worker.rst
But how should i register my Prometheus server to promgen? Or are there any missing steps?
The celery worker is installed the same way as the web app and as long as they can reach the same database and redis instance, it doesn't matter if the web app and workers are on different servers.
Apparently I forgot to merge some docs updates but you should be able to see some illustrations here https://github.com/line/promgen/pull/46/files I'll try to go through the PRs on Monday.
Dear Paul & Seoster,
Will await the documents and finish testing in my linux environment and if i have spare time will test on docker
My other question is are the below run once:
promgen register default localhost 9090
celery -A promgen worker -l info -Q localhost
As i am running promgen in a virtual env, and if the above is run once and upon my server reboot it is still in effect?
thank you all for the wonderful job
Correct. Those commands register the worker in Promgen's database so the data is saved between reboots and anything else :)
The worker flags you need to add to your startup command so that it knows which queue to run from.
Dear Paul,
If i am running uWSGI to launch the application where should i add the worker flag?
uWSGI would be used to run the Promgen worker, so there are no worker flags required.
Something like systemd or another process manager would run the worker on the same node as Prometheus. I use something like this when deployed from Ansible
[Unit]
Description=Daemon for Celery
After=network.target
[Service]
Type=simple
ExecStart={{ promgen_virutalenv }}/bin/celery -A promgen worker -l info --queues {{ ansible_host }}
Restart=on-failure
User=prometheus
[Install]
WantedBy=multi-user.target
Dear Paul,
Noted on this let me test it out and feedback and update the document as needed
Dear All,
Currently i have created an installation guide for Promgen Web on CentOS 7, how can i install and configure Promgen Worker On CentOS 7?