linux搭建activemq

Scroll Down

下载

官网:http://activemq.apache.org/
下载页面:http://activemq.apache.org/download-archives

下载V5.14.5

wget https://archive.apache.org/dist/activemq/5.14.5/apache-activemq-5.14.5-bin.tar.gz

解压

tar -xvf apache-activemq-5.14.5-bin.tar.gz

添加环境变量

vim /etc/profile

添加path

# activemq
export PATH=/opt/activemq/apache-activemq-5.14.5:$PATH

使环境变量生效

source /etc/profile

启动

cd apache-activemq-5.14.5/bin
./activemq start

停止

./activemq stop

查看状态

./activemq status

打开端口

61616服务端口,8161管理页面端口。

firewall-cmd --add-port=61616/tcp --permanent
firewall-cmd --add-port=8161/tcp --permanent
firewall-cmd --reload

管理页面地址:ip:8161/admin
管理页面默认账号/密码:admin/admin
管理页面账号在conf/jetty-realm.properties配置文件中修改,格式为

#用户名:密码,角色(可选)
admin:admin,admin

mq服务默认无账号密码

开启用户认证

修改bin/activemq.xml,在broker下增加如下内容:

<plugins>
    <simpleAuthenticationPlugin>
        <users>
            <authenticationUser username="${activemq.username}" password="${activemq.password}" groups="users, admins" />
        </users>
    </simpleAuthenticationPlugin>
</plugins>

在conf/credentials.properties中添加用户名、密码。该文件中的两个key和xml中的key对应,可以自定义。

activemq.username=dd
activemq.password=dd123456

重启服务生效。