我目前正在使用 ActiveMQ 和 JMS。我面臨的問題是我想更改 ActiveMQ Web 控制臺的埠(在 Linux - ubuntu 22 上作為 localhost 運行)。使用默認埠 ( 8161) 沒有問題,但是當我更改檔案中的埠時,jetty.xmlWeb 控制臺不會啟動(或短暫啟動然后停止)。
這是我做的步驟(安裝路徑是/opt/apache-activemq-5.17.1/:)
$ cd opt/apache-activemq-5.17.1/conf
$ sudo nano jetty.xml
將埠從更改8161為61616in jetty.xml:
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="init-method="start">
<!-- the default port number for the web console -->
<property name="host" value="127.0.0.1"/>
<!--property name="port" value="8161"/>-->
<property name="port" value=61616">
</bean>
保存并回傳后,我啟動 ActiveMQ:
$ cd /opt/apache-activemq-5.17.1/bin/linux-x86-64
$ ls -l
total 152
-rwxr-xr-x 1 root root 15456 Mai 22 10:07 activemq
-rwxr-xr-x 1 root root 15248 Mai 22 10:07 libwrapper.so
-rwxr-xr-x 1 root root 111027 Mai 22 10:07 wrapper
-rw-r--r-- 1 root root 6730 Mai 22 10:07 wrapper.conf
$ sudo ./activemq start
Starting ActiveMQ Broker...
# Checking the status
$ sudo ./activemq status
ActiveMQ Broker is running (26867).
# Checking the status again (about 2-5 seconds execution last command)
$ sudo ./activemq status
ActiveMQ Broker is not running.
編輯/解決方案:
服務器沒有啟動,因為 OpenWire 已經在監聽 port 61616。我已經恢復了默認配置。如果您使用 JMS,則可以8161通過瀏覽器在默認埠上訪問 ActiveMQ 并使用 Java 發送訊息tcp://localhost:61616。感謝用戶 justin-bertram!
uj5u.com熱心網友回復:
默認情況下,ActiveMQ 在埠上偵聽61616來自 OpenWire 客戶端的連接。請參閱activemq.xml:
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
因此,如果您將 Jetty 更改為也偵聽埠,則61616Jetty 或 ActiveMQ 本身將無法啟動,因為一次只能將一個服務系結到任何特定埠。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/480492.html
上一篇:如何包含一級目錄但排除二級目錄?
下一篇:重新啟動應用程式的簡單方法
