Installation and use of ActiveMQ

1、 Installation of ActiveMQ

Environment: CentOS 6, jdk8 1. Ensure that the system has installed the available JDK version 2. Download ActiveMQ for Linux (apache-activemq-5.11.1-bin.tar.gz) from the Internet, and then use xftp to upload it to the folder where the Linux virtual machine has been built

3. Unzip and install # tar -zxvf apache-activemq-5.11 1-bin. tar. gz# mv apache-activemq-5.11. 1 ActiveMQ if the startup script ActiveMQ does not have executable permissions, At this time, you need to authorize (optional) # CD ActiveMQ / bin / # Chmod 755. / activemq4. Open the corresponding port in the firewall. ActiveMQ needs two ports, one is the message communication port (61616 by default) and the other is the management console port (8161 by default) it can be modified in conf / jetty.xml as follows: # VI / etc / syscon fig / iptables add: - a input - M state -- state new - M TCP - P TCP -- dport 6161616 - J accept-a input - M state -- state new - M TCP - P TCP -- dport 8161 - J accept restart firewall: Service iptables restart 5, start # CD / software / ActiveMQ / bin #. / ActiveMQ start6, open the firewall Management interface: http://192.168.152.129:8161/ The default user name and password for the first time is admin / Admin

7. Security configuration (message security) if ActiveMQ does not join the security mechanism, anyone can send and receive messages as long as he knows the specific address of the message service (including IP, port, message address [queue or subject address]). About ActiveMQ installation configuration http://activemq.apache.org/security.html

There are many message security configuration policies for ActiveMQ. Let's take simple authorization configuration as an example: in conf / ActiveMQ Add the following content at the end of the broker tag in the XML file: # VI / software / ActiveMQ / conf / ActiveMQ xml

Defines an LGS user with a password of LGS 123. The roles are users and admins

Set the user name and password of admin: # VI / software / ActiveMQ / conf / jetty XML ensures that the value of authenticate is true (the default)

The login user name and password of the console are saved in conf / jetty realm In the properties file, the contents are as follows: # VI / software / ActiveMQ / conf / jetty realm properties# Defines users that can access the web (console,demo,etc.)# username: password [,rolename ...] Admin: admin, admin note: the format of user name and password is user name: password, role name

Restart: # VI / software / ActiveMQ / bin / ActiveMQ restart set startup: # VI / etc / RC Local add the following ## activemqsu - LGS - C '/ software / ActiveMQ / bin / ActiveMQ start

8. Demo code in personal githup warehouse( https://github.com/leeSmall ), welcome to fork and learn together

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>