cloudstax / firecamp

Serverless Platform for the stateful services
https://www.cloudstax.io
Apache License 2.0
208 stars 21 forks source link

Kafkamanager does not see JMX port #70

Closed jazzl0ver closed 5 years ago

jazzl0ver commented 5 years ago

It shows -1 instead: image To fix that, the environment variable JMX_PORT has to be set before starting Kafka. Please, add it to the Kafka task definition. Probably the line should be:

kafkacatalog.go:
func GenDefaultCreateServiceRequest(platform string, region string, azs []string,
....
        envkvs := []*common.EnvKeyValuePair{
                &common.EnvKeyValuePair{Name: ENV_JMX_PORT, Value: jmxPort},
        }
...
JuniusLuo commented 5 years ago

JMX_PORT is included in the "service.conf". Kafka container entrypoint.sh will source the service.conf file. Kafka should already start with JMX_PORT.

KafkaManager collects the metrics via the JMX_PORT. If JMX_PORT is not set in Kafka, kafkamanager would not be able to collect the metrics. Possibly a bug in kafkamanager?

jazzl0ver commented 5 years ago

Kafkamanager reads jmx_port from Zookeeper. Kafka sets this variable in ZK only when JMX_PORT environment variable was exported before starting Kafka.

JuniusLuo commented 5 years ago

I see what you mean. Source the service.conf file is not enough. We have to explicitly export JMX_PORT, so kafka starting script will recognize it. We could make a fix to kafka image entrypoint.sh to export JMX_PORT, and rebuild the image. Will make a fix.