Install ACTIVEMQ under Linux and specify JDK 1.8

Source: Internet
Author: User
Tags stomp

1. Download the installation package

<apache-activemq-5.15.4-bin.tar.gz>

: Https://pan.baidu.com/s/18xzjBAchjWqsHNA1HuYvTg

2. Configuring the Environment

JDK 1.7 & JDK 1.8 installed

PS: Download JDK 1.8:

① View Name-a View Linux version number "x86_64 for 64-bit systems-32-bit compatible"

②oracle official website Download the specified version " key Select Accept, otherwise cannot download "

③ extract to the specified directory, default to <opt/jdk1.8>

Decompression command: TAR-ZXVF jdk-8u131-linux-x64.tar.gz

④ Configuring environment variables

1vim/etc/Profile #编辑配置文件2 3 # Sun JDK profile4 5Export JAVA_HOME=/USR/LOCAL/JDK1.8/jdk1.8. 0_1316 7Export jre_home=${java_home}/JRE8 9Export classpath=.:${java_home}/lib:${jre_home}/LibTen  OneExport path=${java_home}/Bin: $PATH A  -: Wq # Save and exit "or shift+ZZ " -  theSource/etc/profile # Make/etc/profile file is in effect -  -Java-version # view Java version display

3. Start

1 CD bin #进入bin目录2 3 # foreground startup, with boot log (can be used to see if it starts properly)4./ACTIVEMQ Console5 6 # Background boot, no boot log7./activemq Start8 9 # CloseTen./ACTIVEMQ Stop One  A # Restart -./activemq Restart -  the #查看进程 - PS-ef |grepACTIVEMQ -  - # Kill Process + Kill 1234 -  + # See if Port 61616 is open ANETSTAT-ANP |grep 8161 atNETSTAT-ANP |grep 61616

4. ACTIVEMQ designation jdk1.8

① Modifying a configuration file

1 #进入activemq Bin directory2cd/opt/apache-activemq-5.15.4/bin3 4 #修改env, environment configuration file5VimEnv6 7#添加指定 JDK1. 8 Info8 #进行修改 Insert9 ITen #添加信息 OneJava_home="/opt/jdk1.8"
12
#保存并退出
-: Wq # Save and exit "or Shift+zz"

② Restart MQ

./ACTIVEMQ Restart

5. Modify the Tomcat configuration to invoke the MQ

① Modifying configuration information

1 #进入tomcat路径下 2 cd/opt/tomcat/webapps/root/web-inf/ 3  4#修改tomcat configuration file 5vim Server.properties  6  7#修改activemq配置, add the following information 8 activemq.url=tcp://  10.10.101.101:61616  9 activemq.username=adminTen Activemq.password=admin

② rebooting Tomcat

1 #查看tomcat进程 2 PS grep  34#杀掉进程 5kill -912346 7 #启动tomcat 8 ./opt/tomcat/bin start. SH ; tail -F. /logs/catalina.out

6. Other configurations or FAQs

①jetty.xml Configuration

1 #activemq配置文件路径2 Vim/opt/apache-activemq-5.15.4/conf/jetty.xml3 4 # IP and ports for Web management access5 # can be changed to the external IP of the cost machine, cannot be changed to 127.0.0.1, otherwise cannot be accessed externally6 7     <BeanID= "Jettyport"class= "Org.apache.activemq.web.WebConsolePort"Init-method= "Start">8              <!--The default port number for the Web console -9         < Propertyname= "Host"value= "0.0.0.0"/>Ten         < Propertyname= "Port"value= "8161"/> One     </Bean>

②activemq.xml

1 Vim Opt/apache-activemq-5.15.4/conf/activemq.xml2 3 # IP and port to use4         <transportconnectors>5             <!--DOS Protection, limit concurrent connections to $ and frame size to 100MB -6             <Transportconnectorname= "Openwire"URI= "tcp://0.0.0.0:61616?maximumconnections=1000&amp;wireformat.maxframesize=104857600"/>7             <Transportconnectorname= "AMQP"URI= "amqp://0.0.0.0:5672?maximumconnections=1000&amp;wireformat.maxframesize=104857600"/>8             <Transportconnectorname= "Stomp"URI= "stomp://0.0.0.0:61613?maximumconnections=1000&amp;wireformat.maxframesize=104857600"/>9             <Transportconnectorname= "Mqtt"URI= "mqtt://0.0.0.0:1883?maximumconnections=1000&amp;wireformat.maxframesize=104857600"/>Ten             <Transportconnectorname= "ws"URI= "ws://0.0.0.0:61614?maximumconnections=1000&amp;wireformat.maxframesize=104857600"/> One         </transportconnectors>
#默认openwire Port number is 61616

③ Frequently Asked Questions

A. JDK version is incompatible "<apache-activemq-5.15.4> requires JDK 1.8 version"

Problem Description:

Start the Times wrong,

Workaround: because the machine is installed jdk1.7 is incompatible, install jdk1.8 and assign to ACTIVEMQ, solve the problem.

Install ACTIVEMQ under Linux and specify JDK 1.8

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.