Issue Description
My docker containers are running in mesos cluster and they are sending metrics to dashboard using the docker container host. Sentinel dashboard server isn't able to pull metrics from clients
My query is :
I don't have a control where my docker containers will run in the mesos cluster.
How shall I set the value of this variable -Dcsp.sentinel.heartbeat.client.ip = xxx so that all my docker clients should be able to send metrics?
Describe what happened (or what feature you want)
Describe what you expected to happen
I expect sentinel dashboard server to collect metrics from all sentinel clients
6条答案
按热度按时间f5emj3cl1#
@sczyh30 Can you please help out here ? And help me understand how to figure out what value needs to be set for the variable csp.sentinel.heartbeat.client.ip??
42fyovps2#
if your sentinel dashboard can receive your client heartbeat, then the problem may be you sentinel dashboard send fetch command but you client cannot receive it, the network is unavailable,please check:
sentinel.transport.port
in your dockerfilefnvucqvd3#
Yes, that's exactly my point. How will the sentinel dashboard will collect metrics from client?
Client is registering to the dashboard with host and ip, that's only accessible within the host that docker container is running.
Marathon maps the port exposed by docker via different port? Eg port 8719 will be exposed by marathon with some random port available on the host
How can the client register to sentinel dashboard with the port which marathon will expose?
2nc8po8w4#
according to Requiring a specific host port you can setting
"requirePorts": true
in your app definition, but it is not recommendedmmvthczy5#
I get what you are saying, but since we have multiple containers running in the same VM, not sure if the marathon will be able to start the container with the required port.
Do you have any other recommendations or any other suggestions which I can follow?
ff29svar6#
I finally worked it out using the environment variables which are set inside the docker env.
Docker env maps the outside port to variables like PORT_8719 and PORT_8080. I used the value of these variables to register the clients with sentinel dashboard
If this use case seems to be good enough for you, I can send one pull request for supporting docker containers
Below is the snapshot of the code, I have used in my heartbeat