Install ActiveMQ under Centos7

Start learning to use ActiveMQ today. Before learning, we deploy ActiveMQ on the server.

Prepare the environment##

download link###

The author recommends downloading from Official Website.

Direct download address

Steps##

The next step is to install activemq.

Get activemq

You can directly click the download address above and upload to the server via FTP tool. (FileZilla etc.)

You can also use the wget tool to operate on the server.

wget http://mirror.bit.edu.cn/apache//activemq/5.15.11/apache-activemq-5.15.11-bin.tar.gz

If there is no wget command on the server, you can install wget through yum -y install wget

Unzip###

We install activemq into the /var directory

## First unzip to/var directory
tar -xvf apache-activemq-5.15.11-bin.tar.gz -C /var
## Apache-activemq-5.15.11 Rename
mv /var/apache-activemq-5.15.11/var/activemq

ActiveMQ start and stop###

First we enter the installation directory: /var/activemq

Start the service: ./bin/activemq start

Stop the service: ./bin/activemq stop

Make ActiveMQ a system service##

  1. First create a systemd service file: vi /usr/lib/systemd/system/activemq.service
  2. Write the following content in the file:
[ Unit]
Description=ActiveMQ service
After=network.target

[ Service]
Type=forking
ExecStart=/var/activemq/bin/activemq start
ExecStop=/var/activemq/bin/activemq stop
User=root
Group=root
Restart=always
RestartSec=9
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=activemq

[ Install]
WantedBy=multi-user.target
  1. Find the directory where the java command is located: whereis java

  1. Set JAVA_HOME in activemq configuration file /var/activemq/bin/env
# Location of the java installation
# Specify the location of your java installation using JAVA_HOME, or specify the
# path to the "java" binary using JAVACMD
# ( set JAVACMD to "auto"for automatic detection)
JAVA_HOME=" /var/java/jdk1.8.0_241"
JAVACMD="auto"
  1. Manage activemq start and stop through systemctl

If you want to start automatically after booting, you can run the following command:

Firewall configuration###

If we access remotely, there may be a firewall problem. We can turn off the firewall through the following name.

Firewall configuration, the default Web management port of ActiveMQ is 8161 (admin/admin), and the default communication port is 61616

  1. Add and restart firewall
firewall-cmd --zone=public--add-port=8161/tcp --permanent
firewall-cmd --zone=public--add-port=61616/tcp --permanent
systemctl restart firewalld.service
  1. You can also directly choose to close the firewall: systemctl stop firewalld.service

Configure web management system###

The configuration file of ActiveMQ web management system is in: /var/activemq/conf

Modify port###

< bean id="jettyPort"class="org.apache.activemq.web.WebConsolePort" init-method="start"><!-- the default port number for the web console --><property name="host" value="0.0.0.0"/><!--This is the port of the management platform--><property name="port" value="8161"/></bean>

Close login###

< bean id="securityConstraint"class="org.eclipse.jetty.util.security.Constraint"><property name="name" value="BASIC"/><property name="roles" value="user,admin"/><!--Change to false to close login--><property name="authenticate" value="true"/></bean>

Other configuration###

Other configuration files are in: /var/activemq/conf/jetty-realm.properties

## ---------------------------------------------------------------------------
# The account password can be maintained here, format:
# username:password,Roles
# Defines users that can access the web(console, demo, etc.)
# username: password [,rolename ...]
admin: admin, admin
user:123, user

The above is the basic process of installing ActiveMQ under Centos7 without any problems.

Recommended Posts

Install ActiveMQ under Centos7
Install mysql5.7 under CentOS7
Install PostgreSQL12 under CentOS7
Install CentOS under VMware
Install mysql under Centos 7
Install Jenkins under Centos 7
Install MariaDB under MariaDB Centos7
Install mysql5.1 under CentOS6.5
Install Oracle11gR2 database under CentOS6.9
Install MySQL under Linux (CentOS 7)
Install Java JDK8 under CentOS6
1.5 Install Centos7
Install MongoDB database under CentOS7
CentOS 6.8 under linux install mongodb
Install Mesos tutorial under CentOS7
Install and configure keepalived under CentOS 5.9
Compile and install LAMP under Centos 5.2
[Introduction to redis] Install redis under Centos
Install Harbor mirror warehouse under CentOS
Install Python3 and ansible under CentOS8
Install the latest OpenCV4.3 under Centos8
Install and use docker under CentOS 6.8
Install Python3 and Py under CentOS7
Install Mono 3.2 and Jexus 5.4 under CentOS 6.3
Centos6 install Python2.7.13
Centos7.3 install nginx
CentOS7.2 install Mysql5.7.13
Centos7 install Python 3.6.
CentOS7 install MySQL
Centos7 install protobuf
CentOS 7 install Docker
CentOS7 install GlusterFS
CentOS7 install Docker
Centos6.5 install Tomcat
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Centos7 install Python2.7
Centos 7.6 install seleniu
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
CentOS install mysql
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
CentOS6 install mist.io
Centos7 install Docker
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Centos7 install Nginx
CentOS6.5 install CDH5.13
Centos7 install docker18
Centos install Python3
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM