[root@rhel soft]# cd /usr/local/apache-activemq-5.16.7/bin[root@rhel bin]# ll
total 144
-rwxr-xr-x 1 root root 26694 Jan 312022 activemq
-rwxr-xr-x 1 root root 6190 Jan 312022 activemq-diag
-rw-r--r-- 1 root root 15945 Jan 312022 activemq.jar
-rw-r--r-- 1 root root 5645 Jan 312022env
drwxr-xr-x 2 root root 78 Jun 16 00:30 linux-x86-32
drwxr-xr-x 2 root root 78 Jun 16 00:30 linux-x86-64
drwxr-xr-x 2 root root 82 Jun 16 00:30 macosx
-rw-r--r-- 1 root root 83820 Jan 312022 wrapper.jar
# 启动 这将后台启动ActiveMQ服务[root@rhel bin]# ./activemq start
INFO: Loading '/usr/local/apache-activemq-5.16.7//bin/env'
INFO: Using java'/usr/local/jdk1.8.0_381/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: pidfile created :'/usr/local/apache-activemq-5.16.7//data/activemq.pid'(pid '34998')# 验证ActiveMQ运行状态: 可以通过以下命令来检查ActiveMQ是否正在运行:[root@rhel bin]# ./activemq status
INFO: Loading '/usr/local/apache-activemq-5.16.7//bin/env'
INFO: Using java'/usr/local/jdk1.8.0_381/bin/java'
ActiveMQ is running (pid '34998')# 关闭ActiveMQ服务[root@rhel bin]# ./activemq stop
INFO: Loading '/usr/local/apache-activemq-5.16.7//bin/env'
INFO: Using java'/usr/local/jdk1.8.0_381/bin/java'
INFO: Waiting at least 30 seconds for regular process termination of pid '34998':
Java Runtime: Oracle Corporation 1.8.0_381 /usr/local/jdk1.8.0_381/jre
Heap sizes: current=62976k free=62320k max=932352k
JVM args: -Xms64M-Xmx1G-Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/usr/local/apache-activemq-5.16.7//conf/login.config -Dactivemq.classpath=/usr/local/apache-activemq-5.16.7//conf:/usr/local/apache-activemq-5.16.7//../lib/: -Dactivemq.home=/usr/local/apache-activemq-5.16.7/ -Dactivemq.base=/usr/local/apache-activemq-5.16.7/ -Dactivemq.conf=/usr/local/apache-activemq-5.16.7//conf -Dactivemq.data=/usr/local/apache-activemq-5.16.7//data
Extensions classpath:
[/usr/local/apache-activemq-5.16.7/lib,/usr/local/apache-activemq-5.16.7/lib/camel,/usr/local/apache-activemq-5.16.7/lib/optional,/usr/local/apache-activemq-5.16.7/lib/web,/usr/local/apache-activemq-5.16.7/lib/extra]
ACTIVEMQ_HOME: /usr/local/apache-activemq-5.16.7
ACTIVEMQ_BASE: /usr/local/apache-activemq-5.16.7
ACTIVEMQ_CONF: /usr/local/apache-activemq-5.16.7/conf
ACTIVEMQ_DATA: /usr/local/apache-activemq-5.16.7/data
Connecting to pid: 34998
Stopping broker: localhost
.. FINISHED
# 如果你想在前台启动并查看日志输出,可以使用[root@rhel bin]# ./activemq console
INFO: Loading '/usr/local/apache-activemq-5.16.7//bin/env'
INFO: Using java'/usr/local/jdk1.8.0_381/bin/java'
INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C)
INFO: Creating pidfile /usr/local/apache-activemq-5.16.7//data/activemq.pid
Java Runtime: Oracle Corporation 1.8.0_381 /usr/local/jdk1.8.0_381/jre
Heap sizes: current=62976k free=58040k max=932352k
JVM args: -Xms64M-Xmx1G-Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/usr/local/apache-activemq-5.16.7//conf/login.config -Dcom.sun.management.jmxremote-Djava.awt.headless=true -Djava.io.tmpdir=/usr/local/apache-activemq-5.16.7//tmp -Dactivemq.classpath=/usr/local/apache-activemq-5.16.7//conf:/usr/local/apache-activemq-5.16.7//../lib/: -Dactivemq.home=/usr/local/apache-activemq-5.16.7/ -Dactivemq.base=/usr/local/apache-activemq-5.16.7/ -Dactivemq.conf=/usr/local/apache-activemq-5.16.7//conf -Dactivemq.data=/usr/local/apache-activemq-5.16.7//data
Extensions classpath:
[/usr/local/apache-activemq-5.16.7/lib,/usr/local/apache-activemq-5.16.7/lib/camel,/usr/local/apache-activemq-5.16.7/lib/optional,/usr/local/apache-activemq-5.16.7/lib/web,/usr/local/apache-activemq-5.16.7/lib/extra]
ACTIVEMQ_HOME: /usr/local/apache-activemq-5.16.7
ACTIVEMQ_BASE: /usr/local/apache-activemq-5.16.7
ACTIVEMQ_CONF: /usr/local/apache-activemq-5.16.7/conf
ACTIVEMQ_DATA: /usr/local/apache-activemq-5.16.7/data
Loading message broker from: xbean:activemq.xml
INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@50b494a6: startup date[Sun Jun 16 00:49:20 CST 2024]; root of context hierarchy
INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/usr/local/apache-activemq-5.16.7/data/kahadb]
INFO | KahaDB is version 7
INFO | PListStore:[/usr/local/apache-activemq-5.16.7/data/localhost/tmp_storage] started
INFO | Apache ActiveMQ 5.16.7 (localhost, ID:rhel-30233-1718470161742-0:1) is starting
INFO | Listening for connections at: tcp://rhel:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector openwire started
INFO | Listening for connections at: amqp://rhel:56721?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector amqp started
INFO | Listening for connections at: stomp://rhel:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector stomp started
INFO | Listening for connections at: mqtt://rhel:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector mqtt started
INFO | Starting Jetty server
INFO | Creating Jetty connector
WARN | ServletContext@o.e.j.s.ServletContextHandler@25bfcafd{/,null,STARTING} has uncovered http methods for path: /
INFO | Listening for connections at ws://rhel:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector ws started
INFO | Apache ActiveMQ 5.16.7 (localhost, ID:rhel-30233-1718470161742-0:1) started
INFO | For help or more information please see: http://activemq.apache.org
WARN | Store limit is 102400 mb (current store usage is 0 mb). The data directory: /usr/local/apache-activemq-5.16.7/data/kahadb only has 44150 mb of usable space. - resetting to maximum available disk space: 44150 mb
WARN | Temporary Store limit is 51200 mb (current store usage is 0 mb). The data directory: /usr/local/apache-activemq-5.16.7/data only has 44150 mb of usable space. - resetting to maximum available disk space: 44150 mb
INFO | ActiveMQ WebConsole available at http://127.0.0.1:8161/
INFO | ActiveMQ Jolokia REST API available at http://127.0.0.1:8161/api/jolokia/
# 命令查找进程ps aux |grep activemq
# (在Linux系统中)检查端口是否被占用,或者直接检查服务的状态。netstat-tuln|grep5672# 配置防火墙: 如果你的系统防火墙是开启的,你可能需要开放ActiveMQ使用的端口(默认是61616)。这可以通过
firewall-cmd --permanent --add-port=61616/tcp 命令来实现。
修改ActiveMQ的管理控制台地址
http://127.0.0.1:8161/ ---> http://ip***:8161/ 默认账号密码:admin/admin