病症:
ActiveMQ管理页面无法访问。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 401 Unauthorized</title>
</head>
<body><h2>HTTP ERROR 401 Unauthorized</h2>
<table>
<tr><th>URI:</th><td>/</td></tr>
<tr><th>STATUS:</th><td>401</td></tr>
<tr><th>MESSAGE:</th><td>Unauthorized</td></tr>
<tr><th>SERVLET:</th><td>-</td></tr>
</table>
<hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.28.v20200408</a><hr/>
</body>
</html>
病根:
存储空间设置不当,告警日志/usr/local/activemq/data/activemq.log内容如下:
2021-03-31 00:35:31,174 | WARN | Store limit is 102400 mb (current store usage is 0 mb). The data directory: /usr/local/activemq/data/kahadb only has 27291 mb of usable space. - resetting to maximum available disk space: 27291 mb | org.apache.activemq.broker.BrokerService | main
2021-03-31 00:35:31,174 | WARN | Temporary Store limit is 51200 mb (current store usage is 0 mb). The data directory: /usr/local/activemq/data only has 27291 mb of usable space. - resetting to maximum available disk space: 27291 mb | org.apache.activemq.broker.BrokerService | main
药方:
配置/usr/local/activemq/conf/activemq.xml中的存储空间为1G,重新启动activemq即可。
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage percentOfJvmHeap="70" />
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="1 gb"/>
</tempUsage>
</systemUsage>
</systemUsage>
疗效:
药到病除。