ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.27k stars 628 forks source link

jmx.rmi.host value is ignored #1808

Closed cemalgultekin closed 4 years ago

cemalgultekin commented 4 years ago

Hello,

we are testing _Enterprise Edition 1.9.0 201911271810 on Ubuntu 16.04 LTS .

We want to change the jmx.rmi.host to serve from a specific ip address, therefore changed the value from /usr/local/antmedia/conf/red5.properties file, however it still serves from all the available ip addresses.

muratugureminoglu commented 4 years ago

Hello Cemal,

We dont use red5.properties file for Jmx configration.

You need to change /etc/init.d/antmedia file as follows.

Open with editor the following file.

vim /etc/init.d/antmedia

find "JVM_OPTS=" variable then change this line as follow.

JVM_OPTS="-Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quartz.skipUpdateCheck=true -XX:+UseG1GC -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5599 -Djava.rmi.server.useLocalHostname=true -Dcom.sun.management.jmxremote.rmi.port=5599 -Djava.rmi.server.hostname=YOUR_SERVER_IP"

After saving file, restart antmedia service.

Reference Link: https://raw.githubusercontent.com/ant-media/Ant-Media-Server-Service/master/src/main/daemon/antmedia

cemalgultekin commented 4 years ago

Hello Murat,

changed

JVM_OPTS="-Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quartz.skipUpdateCheck=true -XX:+UseG1GC"

to

JVM_OPTS="-Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quartz.skipUpdateCheck=true -XX:+UseG1GC -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5599 -Djava.rmi.server.useLocalHostname=true -Dcom.sun.management.jmxremote.rmi.port=5599 -Djava.rmi.server.hostname=*.*.*.*"

I have also replaced *.*.*.* with the actual ip address, in my /etc/init.d/antmedia file. Also since this is systemd, I have executed

systemctl daemon-reload

, and then

systemctl restart antmedia

however executing

lsof -i -n -P | grep 5599

, shows me that

jsvc      15749 antmedia   28u  IPv6  37760      0t0  TCP *:5599 (LISTEN)

but the port 9999 which is configured as default in conf/red5.properties , which the question was about is still open.

with the additional parameters passed to _JVMOPTS ,the port 5599 and another randomly selected port also opened up listening on all interfaces by jsvc(antmedia). The second random port is unknown and unconfigured, that we have no idea what is used for. Removing the additional parameters fixed the issue of port 5590 and random port opening up, but the initial problem is not yet fixed.

muratugureminoglu commented 4 years ago

Hi, Can you add the following parameter to the end of the JMV variable? This parameter listen only the localhost. JVM_OPTS= -Dcom.sun.management.jmxremote.host=127.0.0.1 tcp 0 0 127.0.0.1:5599 0.0.0.0:* LISTEN 8566/jsvc.exec