Emergency

PMM ProxySQL monitoring in docker containers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PMM ProxySQL monitoring in docker containers

    We would like to be able to run multiple proxysql docker containers for different applications on the same docker host. We'd like to monitor them with PMM by placing a pmm-agent alongside each proxysql container, one per container instance. The out-of-the-box PMM server setup does not seem to allow us to have the pmm-agent listen internally on the default port, but have PMM server connect to it on whatever random port docker assigns. Also, there does not seem to be a way for pmm-agent to listen on an alternate port and therefore we cannot run more than one pmm-agent instance per host.

    Is there a way to allow docker to randomly assign an external port that we can then publish to the PMM server for scraping prometheus metrics on the pmm-agent container?

    Basically, are there suggestions to have PMM server communicate with multiple pmm-agent docker containers per host?

  • #2
    Hi Jon,

    There is no need to run multiple instances of pmm-client in order to monitor multiple servers on a machine or container. You can add additional listening services for the additional instances of mysqld or ProxySQL like so:

    mysqld (you use the --host and --port parameters):
    $ sudo pmm-admin config --server {pmm-server}
    $ sudo pmm-admin add mysql --host 127.0.0.1 --port 3306 --user root --password password local3306
    $ sudo pmm-admin add mysql --host 127.0.0.1 --port 3307 --user root --password password local3307



    ProxySQL (you use the --dsn parameter):
    $ sudo pmm-admin config --server {pmm-server}
    $ sudo pmm-admin add proxysql:metrics
    --dsn "theuser:thepassword@tcp(localhost:6032)/" proxysql6032
    $ sudo pmm-admin add proxysql:metrics --dsn "theuser:thepassword@tcp(localhost:6034)/" proxysql6034



    After configuration you can check that the services are installed with pmm-admin list
    $ sudo pmm-admin list
    pmm-admin 1.1.3

    PMM Server | xx.xx.xx.xx
    Client Name | 260a116c4a3e
    Client Address | xx.xx.xx.xx
    Service Manager | unix-systemv

    -------------- ---------- ----------- -------- ----------------------------- ------------------------------------------
    SERVICE TYPE NAME LOCAL PORT RUNNING DATA SOURCE OPTIONS
    -------------- ---------- ----------- -------- ----------------------------- ------------------------------------------
    mysql:queries local3306 - YES root:***@tcp(127.0.0.1:3306) query_source=slowlog, query_examples=true
    mysql:queries local3307 - YES root:***@tcp(127.0.0.1:3307) query_source=slowlog, query_examples=true
    linux:metrics local3306 42000 YES -
    mysql:metrics local3306 42002 YES root:***@tcp(127.0.0.1:3306)
    mysql:metrics local3307 42003 YES root:***@tcp(127.0.0.1:3307)



    --Dave
    Last edited by DBennett; 05-19-2017, 05:29 PM.

    Comment

    Working...
    X