我正在以两种不同的方式初始化经纪人。一种是侦听 0.0.0.0
,另一种是侦听节点 IP,即 172.29.245.17
。
经纪人 1:
[root@amq-1 apache-artemis-2.4.0]# bin/artemis create --name BROKER-1 /var/tmp/BROKER-1 --user admin --password admin --http-host 0.0.0.0 --http-port 8080 --allow-anonymous
代理 2:
[root@amq-1 apache-artemis-2.4.0]# bin/artemis create --name BROKER-2 /var/tmp/BROKER-2 --user admin --password admin --http-host 172.29.245.17 --http-port 8080 --allow-anonymous
正如您所看到的,唯一的区别在于要监听哪个IP。一个是对所有IP开放(0.0.0.0),另一个仅监听一个特定的IP()。
没有问题可以访问Broker-2的GUI界面(监听
172.29.245.17
)。现在当我启动监听
0.0.0.0
的Broker-1时,我被重定向到/console/jvm/connect
。
错误信息如下:[Core] Operation unknown failed due to: java.lang.Exception : Origin http://172.29.245.17:8080 is not allowed to call this agent
[Core] ActiveMQ Management Console started
[Window] Uncaught TypeError: Cannot read property 'apply' of undefined (http://172.29.245.17:8080/console/app/app.js?0d5300a336117972:16:14366)
[Window] Uncaught TypeError: Cannot read property 'apply' of undefined (http://172.29.245.17:8080/console/app/app.js?0d5300a336117972:16:14366)
[Window] Uncaught TypeError: Cannot read property 'apply' of undefined (http://172.29.245.17:8080/console/app/app.js?0d5300a336117972:16:14366)
[Window] Uncaught TypeError: Cannot read property 'apply' of undefined (http://172.29.245.17:8080/console/app/app.js?0d5300a336117972:16:14366)
对于 Broker-1 ,
jolokia-access.xml
文件中声明了以下内容:<restrict>
<cors>
<!-- Allow cross origin access from 0.0.0.0 ... -->
<allow-origin>*://0.0.0.0*</allow-origin>
<!-- Check for the proper origin on the server side, too -->
<strict-checking/>
</cors>
</restrict>
对于Broker-2,
jolokia-access.xml
文件中说明:<restrict>
<cors>
<!-- Allow cross origin access from 172.29.245.17 ... -->
<allow-origin>*://172.29.245.17*</allow-origin>
<!-- Check for the proper origin on the server side, too -->
<strict-checking/>
</cors>
</restrict>
我无法弄清楚为什么在尝试侦听 0.0.0.0
时出现问题。有什么想法吗?
所有其他配置都是默认的。我没有修改任何其他配置。