杨梅冲
每天在想什么呢?

官网:https://activemq.apache.org/index.html

下载最新:https://activemq.apache.org/components/classic/download/

下载老版本:https://activemq.apache.org/components/classic/documentation/download-archives

tar -xzvf apache-activemq-5.15.14-bin.tar.gz
mv apache-activemq-5.15.14-bin activemq
cd activemq/bin

# 启动失败查看错误使用
./activemq console
# 启动
./activemq start
# 带日志的启动
./activemq start > logs/activestart.log

linux启动报错

# activemq/data/activemq.log
2024-06-26 17:55:11,498 | ERROR | Failed to start Apache ActiveMQ (localhost, ID:server_test-38193-1719395711115-0:1) | org.apache.activemq.broker.BrokerService | main
java.net.URISyntaxException: Illegal character in hostname at index 11: ws://server_test:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600

# 解决方法:
# 这个不是端口占用问题,将配置文件中0.0.0.0的ip改为127.0.0.1 就可以重新启动解决
vim activemq/conf/activemq.xml
<transportConnector name="openwire" uri="tcp://127.0.0.1:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://127.0.0.1:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://127.0.0.1:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://127.0.0.1:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://127.0.0.1:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>

# 5.18版本已修复这个错误
5.18 版本需要将activemq/conf/jetty.xml中 8161端口的 host改为 0.0.0.0或者 IP,或者不能远程连接

登陆后台:http://192.168.10.10:8161/ ,默认账号密码:admin/admin

如果需要修改默认密码conf/jetty-realm.properties:

# Defines users that can access the web (console, demo, etc.)
# username: password [,rolename ...]
admin: 123456, admin
user: 123456, user

Jms连接MQ需要的帐号密码: 

默认帐号:system

默认密码:manager

cat conf/credentials.properties
activemq.username=system
activemq.password=manager

docker安装 activemq

docker run --name='activemq5' --restart=always -d -e 'ACTIVEMQ_ADMIN_LOGIN=admin' -e 'ACTIVEMQ_ADMIN_PASSWORD=123456' -e 'ACTIVEMQ_CONFIG_MINMEMORY=1024' -e  'ACTIVEMQ_CONFIG_MAXMEMORY=1024' -v /usr/local/activemq/data:/opt/apache-activemq/data -p 8161:8161 -p 61616:61616 -p 61613:61613 apache/activemq-classic:5.18.6

密码要是没生效就登录到里面去修改

 

posted on 2024-06-26 19:01  杨梅冲  阅读(881)  评论(0)    收藏  举报