[[email protected] local]# tar -zxvf apache-activemq-5.15.8-bin.tar.gz
[[email protected] local]# mv apache-activemq-5.15.8 activemq
[[email protected] activemq]# cd conf/
[[email protected] conf]# pwd
/usr/local/activemq/conf
[[email protected] conf]# cp activemq.xml activemq.xml.bak
[[email protected] conf]# vim activemq.xml
<persistenceAdapter>
<!--<kahaDB directory="${activemq.data}/kahadb"/>-->
<jdbcPersistenceAdapter dataSource="#mysql-ds"/>
</persistenceAdapter>
<bean id="mysql-ds" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/test_mq?relaxAutoCommit=true"/>
<property name="username" value="root"/>
<property name="password" value="2018"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
[[email protected] conf]# cd ..
[[email protected] activemq]# cd bin/linux-x86-64/
[[email protected] linux-x86-64]# ./activemq restart
Stopping ActiveMQ Broker...
Stopped ActiveMQ Broker.
Starting ActiveMQ Broker...
[[email protected] linux-x86-64]# systemctl stop firewalld
http://ip:8161/admin/
用户名和密码默认是:admin
原文地址:https://www.cnblogs.com/zhangkaimin/p/10669691.html