You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2022/02/11 17:09:00 UTC

[jira] [Comment Edited] (ARTEMIS-3681) Add the function to define a static port for artemis to connect with client

    [ https://issues.apache.org/jira/browse/ARTEMIS-3681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17491058#comment-17491058 ] 

Justin Bertram edited comment on ARTEMIS-3681 at 2/11/22, 5:08 PM:
-------------------------------------------------------------------

If you use the same commands as those listed at https://www.ibm.com/support/pages/ports-used-activemq-hpc then you get something like this:
{noformat}
$ ps -eaf |grep -v grep|grep artemis
jbertram  499185  499153  7 11:01 pts/6    00:00:05 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx2G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=file:/apache-artemis-2.20.0/bin/test/etc/jolokia-access.xml -Dhawtio.role=amq -Xbootclasspath/a:/artemis/apache-artemis-2.20.0/lib/jboss-logmanager-2.1.10.Final.jar:/artemis/apache-artemis-2.20.0/lib/wildfly-common-1.5.2.Final.jar -Djava.security.auth.login.config=/artemis/apache-artemis-2.20.0/bin/test/etc/login.config -classpath /artemis/apache-artemis-2.20.0/lib/artemis-boot.jar -Dartemis.home=/artemis/apache-artemis-2.20.0 -Dartemis.instance=//artemis/apache-artemis-2.20.0/bin/test -Djava.library.path=/artemis/apache-artemis-2.20.0/bin/lib/linux-x86_64 -Djava.io.tmpdir=/artemis/apache-artemis-2.20.0/bin/test/tmp -Ddata.dir=/artemis/apache-artemis-2.20.0/bin/test/data -Dartemis.instance.etc=/artemis/apache-artemis-2.20.0/bin/test/etc -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:/artemis/apache-artemis-2.20.0/bin/test/etc//logging.properties -Dartemis.default.sensitive.string.codec.key= org.apache.activemq.artemis.boot.Artemis run
$ netstat -tulnp | grep 499185
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp6       0      0 :::61616                :::*                    LISTEN      499185/java         
tcp6       0      0 :::1883                 :::*                    LISTEN      499185/java         
tcp6       0      0 127.0.0.1:8161          :::*                    LISTEN      499185/java         
tcp6       0      0 :::5445                 :::*                    LISTEN      499185/java         
tcp6       0      0 :::5672                 :::*                    LISTEN      499185/java         
tcp6       0      0 :::61613                :::*                    LISTEN      499185/java{noformat}
By default ActiveMQ Artemis will listen on 6 ports - 1 for each of the 5 {{acceptor}} elements defined in {{broker.xml}} and 1 for the embedded web-server listening on 8161 as defined in {{{}bootstrap.xml{}}}.


was (Author: jbertram):
If you use the same commands as those listed at xxx then you get something like this:
{noformat}
$ ps -eaf |grep -v grep|grep artemis
jbertram  499185  499153  7 11:01 pts/6    00:00:05 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx2G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=file:/apache-artemis-2.20.0/bin/test/etc/jolokia-access.xml -Dhawtio.role=amq -Xbootclasspath/a:/artemis/apache-artemis-2.20.0/lib/jboss-logmanager-2.1.10.Final.jar:/artemis/apache-artemis-2.20.0/lib/wildfly-common-1.5.2.Final.jar -Djava.security.auth.login.config=/artemis/apache-artemis-2.20.0/bin/test/etc/login.config -classpath /artemis/apache-artemis-2.20.0/lib/artemis-boot.jar -Dartemis.home=/artemis/apache-artemis-2.20.0 -Dartemis.instance=//artemis/apache-artemis-2.20.0/bin/test -Djava.library.path=/artemis/apache-artemis-2.20.0/bin/lib/linux-x86_64 -Djava.io.tmpdir=/artemis/apache-artemis-2.20.0/bin/test/tmp -Ddata.dir=/artemis/apache-artemis-2.20.0/bin/test/data -Dartemis.instance.etc=/artemis/apache-artemis-2.20.0/bin/test/etc -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:/artemis/apache-artemis-2.20.0/bin/test/etc//logging.properties -Dartemis.default.sensitive.string.codec.key= org.apache.activemq.artemis.boot.Artemis run
$ netstat -tulnp | grep 499185
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp6       0      0 :::61616                :::*                    LISTEN      499185/java         
tcp6       0      0 :::1883                 :::*                    LISTEN      499185/java         
tcp6       0      0 127.0.0.1:8161          :::*                    LISTEN      499185/java         
tcp6       0      0 :::5445                 :::*                    LISTEN      499185/java         
tcp6       0      0 :::5672                 :::*                    LISTEN      499185/java         
tcp6       0      0 :::61613                :::*                    LISTEN      499185/java{noformat}
By default ActiveMQ Artemis will listen on 6 ports - 1 for each of the 5 {{acceptor}} elements defined in {{broker.xml}} and 1 for the embedded web-server listening on 8161 as defined in {{bootstrap.xml}}.

> Add the function to define a static port for artemis to connect with client
> ---------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3681
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3681
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>    Affects Versions: 2.20.0
>            Reporter: Ning Kang
>            Priority: Blocker
>
> Artemis uses 3 ports:
> 61616 , 8181 and a random port.
> a. 61616 is the activemq port which is connected by PCMD(Platform Cluster Manager core daemon).
> b. 8161 is the internal port used by activemq NIO(Non-Blocking IO) communication.
> c. Any random port like 37551, 35134 etc. : This port is used to communicate with already connected clients.
>  
> The first 2 ports can be changed, but the last random port cannot be changed. This will bring a problem in a firewall situation because it is very difficult to open a rang of firewall ports for the 3rd port due to security reasons.
>  
> So the question is: is it possible to define a static port for the 3rd one, or disable the usage of the 3rd port? If not, then it will be very helpful to add this function.
>  
> If we do not open the 3rd port on firewall, then it is not possible to make the connection, and the artemis server log will show this error in below. The ip of 111.127.116.95 is the client ip.
> 2022-02-10 18:16:34,047 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure to /111.127.116.95:55818 has been detected: AMQ229014: Did not receive data from /111.127.116.95:55818 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT]
>  
> References:
> [https://www.ibm.com/support/pages/ports-used-activemq-hpc]
> [https://www.ibm.com/support/pages/change-default-ports-activemq]
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)