解压tar包到 /opt路径下:
开启服务,显示开启,但 http://127.0.0.1:8161/admin/ -->404
寻其原因:
/opt/activemq/bin/activemq console
起初报的是权限不足的问题,我就纳闷了,我是在超级管理员下运行,我在opt下也是我自己定义的全局普通文件夹,也不需要权限。
找到了一篇运维日志网的安装版,看启动命令,和docker一样,觉得还挺友好,多熟悉一个命令。于是也是启动了无效果。
sudo systemctl status activemq
● activemq.service - LSB: ActiveMQ instance
Loaded: loaded (/etc/init.d/activemq; bad; vendor preset: enabled)
Active: active (exited) since 一 2018-11-05 22:06:29 CST; 2s ago
Docs: man:systemd-sysv-generator(8)
Process: 4384 ExecStop=/etc/init.d/activemq stop (code=exited, status=0/SUCCESS)
Process: 4470 ExecStart=/etc/init.d/activemq start (code=exited, status=0/SUCCESS)
11月 05 22:06:29 tongning systemd[1]: Starting LSB: ActiveMQ instance...
11月 05 22:06:29 tongning activemq[4470]: * Starting ActiveMQ instance activemq
11月 05 22:06:29 tongning activemq[4470]: No instances found at /etc/activemq/instances-enabled.
11月 05 22:06:29 tongning systemd[1]: Started LSB: ActiveMQ instance.
~
但是:
sudo netstat -tnlp
激活Internet连接 (仅服务器)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 3352/beam.smp
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 3108/mysqld
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 17593/redis-server
tcp 0 0 127.0.0.1:63342 0.0.0.0:* LISTEN 1852/java
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 3223/epmd
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 4209/dnsmasq
tcp 0 0 0.0.0.0:41597 0.0.0.0:* LISTEN 1852/java
tcp 0 0 127.0.0.1:6942 0.0.0.0:* LISTEN 1852/java
tcp6 0 0 :::5672 :::* LISTEN 3352/beam.smp
tcp6 0 0 :::6379 :::* LISTEN 17593/redis-server
tcp6 0 0 :::45744 :::* LISTEN 2031/java
tcp6 0 0 :::4369 :::* LISTEN 3223/epmd
tcp6 0 0 127.0.0.1:38275 :::* LISTEN 2031/java
压根也没有active的服务。
后来看带几篇文章,让我往ip地址的方向看,ubuntu /etc/hosts ->其中解析的都是ipv6 我以为解析不了ipv4的,加了句解析ipv4的命令:
sudo gedit /etc/hosts
#插入
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
/etc/init.d/networking restart #重新启动一下你的网络。
无效果,猜着应该是端口占用的问题
接着tar解压使用的操作 给个权限(activeMq再启动操作时没有权限访问其他文件):
sudo chmod -R 777 /opt/activemq
/opt/activemq/bin/activemq console
##关键错误
ERROR | Failed to start Apache ActiveMQ (localhost, ID:tongning-37771-1541427144976-0:1)
java.io.IOException: Transport Connector could not be registered in JMX:
java.io.IOException: Failed to bind to server socket: amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: 地址已在使用
在其配置文件 conf 下 activemq.xml ---> 114行 5672 改为 5273
gedit /opt/activemq/conf/activemq.xml #进入conf 修改
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:5673?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
</transportConnectors>
ok
./activemq console
INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C)
INFO: Creating pidfile /opt/activemq//data/activemq.pid
INFO: changing to user 'activemq' to invoke java
Java Runtime: Oracle Corporation 1.8.0_03-Ubuntu /usr/lib/jvm/java-8-openjdk-amd64/jre
Heap sizes: current=121856k free=121221k max=1797120k
JVM args: -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/opt/activemq//conf/login.config -Djava.awt.headless=true -Djava.io.tmpdir=/opt/activemq//tmp -Dactivemq.classpath=/opt/activemq//conf:/opt/activemq//../lib/: -Dactivemq.home=/opt/activemq/ -Dactivemq.base=/opt/activemq/ -Dactivemq.conf=/opt/activemq//conf -Dactivemq.data=/opt/activemq//data
Extensions classpath:
[/opt/activemq/lib,/opt/activemq/lib/camel,/opt/activemq/lib/optional,/opt/activemq/lib/web,/opt/activemq/lib/extra]
ACTIVEMQ_HOME: /opt/activemq
ACTIVEMQ_BASE: /opt/activemq
ACTIVEMQ_CONF: /opt/activemq/conf
ACTIVEMQ_DATA: /opt/activemq/data
Loading message broker from: xbean:activemq.xml
INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@13fee20c: startup date [Mon Nov 05 22:37:03 CST 2018]; root of context hierarchy
INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/opt/activemq/data/kahadb]
INFO | KahaDB is version 6
INFO | PListStore:[/opt/activemq/data/localhost/tmp_storage] started
INFO | Apache ActiveMQ 5.15.7 (localhost, ID:tongning-44944-1541428624295-0:1) is starting
INFO | Listening for connections at: tcp://tongning:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector openwire started
INFO | Listening for connections at: amqp://tongning:5673?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector amqp started
INFO | Listening for connections at: stomp://tongning:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector stomp started
INFO | Listening for connections at: mqtt://tongning: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@727eb8cb{/,null,STARTING} has uncovered http methods for path: /
INFO | Listening for connections at ws://tongning:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector ws started
INFO | Apache ActiveMQ 5.15.7 (localhost, ID:tongning-44944-1541428624295-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: /opt/activemq/data/kahadb only has 49707 mb of usable space. - resetting to maximum available disk space: 49707 mb
WARN | Temporary Store limit is 51200 mb (current store usage is 0 mb). The data directory: /opt/activemq/data only has 49707 mb of usable space. - resetting to maximum available disk space: 49707 mb
INFO | No Spring WebApplicationInitializer types detected on classpath
INFO | ActiveMQ WebConsole available at http://0.0.0.0:8161/
INFO | ActiveMQ Jolokia REST API available at http://0.0.0.0:8161/api/jolokia/
INFO | Initializing Spring FrameworkServlet 'dispatcher'
INFO | No Spring WebApplicationInitializer types detected on classpath
INFO | jolokia-agent: Using policy access restrictor classpath:/jolokia-access.xml