sipcapture / heplify

Portable and Lightweight HEP Capture Agent for HOMER
https://sipcapture.org
GNU Affero General Public License v3.0
188 stars 67 forks source link

Heplify blocks port 8090 for sipwise sems-b2b #282

Closed ciscospirit closed 7 months ago

ciscospirit commented 7 months ago

Hello,

we found out that there is somewhere a problem if we doing a switchover from our active node sp2 to our passive node sp1.

on the passive node (sp1), heplify is running and sems-b2b not. as soon we make this node active, sems-b2b fails to start, as heplify is already using port 8090 on tcp6 to LISTEN. but 8090 is manadory for sems-b2b to work correctly and to start correctly.

how can we prevent this? Also why it is listen to tcp6? maybe it is a startup problem, that heplify is not allowed to start before sems is started?

any idea how to fix this?

# ngcp-parallel-ssh all "ps axuf | grep heplify" | grep -v grep
[1] 15:28:56 [SUCCESS] sp1:22
root     3409461  0.1  0.2 2416760 78424 ?       Ssl  15:27   0:00 /etc/ngcp-config/xxx/homer/heplify/heplify -hs homer.xxx.xx:9060 -m SIP -hn sppro -hi 2002 -p /var/log/homer/

[2] 15:28:56 [SUCCESS] sp2:22
root     1350697  1.1  0.9 2760416 326792 ?      Ssl  Feb29 432:39 /etc/ngcp-config/xxx/homer/heplify/heplify -hs homer.xxx.xx:9060 -m SIP -hn sppro -hi 2002 -p /var/log/homer/
# ngcp-parallel-ssh all "netstat -ploan | grep 8090"
[1] 15:29:23 [SUCCESS] sp1:22
tcp6       0      0 :::8090                 :::*                    LISTEN      3409461/heplify      off (0.00/0/0)

[2] 15:29:23 [SUCCESS] sp2:22
tcp        0      0 127.0.0.1:8090          0.0.0.0:*               LISTEN      541308/sems-b2b      off (0.00/0/0)
# ngcp-parallel-ssh all "netstat -ploan | grep heplify"
[1] 15:29:32 [SUCCESS] sp1:22
tcp6       0      0 :::8090                 :::*                    LISTEN      3409461/heplify      off (0.00/0/0)
udp        0      0 1xx.xxx.xxx.11:55003     1xx.xxx.xxx.8:9060       ESTABLISHED 3409461/heplify      off (0.00/0/0)
unix  3      [ ]         STREAM     CONNECTED     527363347 3409461/heplify

[2] 15:29:32 [SUCCESS] sp2:22
udp        0      0 1xx.xxx.xxx.12:50679     1xx.xxx.xxx.8:9060       ESTABLISHED 1350697/heplify      off (0.00/0/0)
unix  3      [ ]         STREAM     CONNECTED     295688769 1350697/heplify
lmangani commented 7 months ago

That's the default Prometheus Metrics exporter port 8090

flag.StringVar(&config.Cfg.PrometheusIPPort, "prometheus", ":8090", "prometheus metrics - ip:port. By default all IPs")

I guess you can replace that with something else, unless you're not scraping it? You can also map it only locally or on a specific interface, if that's helping avoid the collision with SEMS

ciscospirit commented 7 months ago

thanks for your fast reply...

hmm but how? just starting heplify with this argument?

heplify -hs homer.xxx.xx:9060 -m SIP -prometheus :9090

for what is this port needed? is prometheus used by homer or local prometheus? what you mean to map it on a specific interface? for what is this setting?

i also thought about to create the startup script, that it is not allowed to start heplify before sems is running. but not sure if this will solve the problem too.

lmangani commented 7 months ago

This endpoint is used to expose metrics in the prometheus format. They do nothing unless pulled by a scraper. You can use the same setting to modify the :port for all interfaces or a specific one using interface:port Last and perhaps really least, You can also make any other service a dependency for the heplify service if you want it to queue behind it.

lmangani commented 7 months ago

Closing as answered. Feel free to post updates if needed.