-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0b0455
commit 6565056
Showing
6 changed files
with
170 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[Apache ActiveMQ](https://activemq.apache.org) 是老牌的开源消息总线,完全支持 JMS1.1 和 J2EE 1.4 规范,它支持多种语言和协议编写客户端。 | ||
|
||
![](https://libs.websoft9.com/Websoft9/DocsPicture/zh/activemq/activemq-logined-websoft9.png) | ||
|
||
|
||
部署 Websoft9 提供的 ActiveMQ 之后,请参考下面的步骤快速入门。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# {{trademark}} | ||
|
||
{{overview}}。 | ||
|
||
简而言之,[{{trademark}}](websiteurl) 是一个 **{{summary}}**,它被用于 {% for catalog in catalog %} {{catalog.name}} {% endfor %} 等场景。 | ||
|
||
![screenshots[1].name]({{screenshots[1].url}}) | ||
|
||
## 准备 | ||
|
||
在参阅本文档使用 {{trademark}} 时,需要确保如下几点: | ||
|
||
- 应用是基于 Websoft9 安装的 | ||
- 应用的用途符合 [{{license}}](license_url) 开源许可协议 | ||
- 应用具备访问条件:[配置域名](./guide/appsetdomain) 或 **服务器安全组**开启网外端口 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
--- | ||
sidebar_position: 1 | ||
slug: /activemq2 | ||
tags: | ||
- ActiveMQ | ||
- IT 架构 | ||
- 中间件 | ||
--- | ||
|
||
import Meta from './_include/activemq.md'; | ||
|
||
# ActiveMQ | ||
|
||
<Meta name="meta" /> | ||
|
||
## ActiveMQ 初始化 | ||
|
||
Websoft9 控制台安装完 ActiveMQ 后,即可根据【访问】标签页获取登录地址和账号。 | ||
|
||
![ActiveMQ初始化页面](http://libs.websoft9.com/Websoft9/DocsPicture/zh/activemq/activemq-login-websoft9.png) | ||
|
||
![ActiveMQ控制台](http://libs.websoft9.com/Websoft9/DocsPicture/zh/activemq/activemq-logined-websoft9.png) | ||
|
||
## ActiveMQ 指南 | ||
|
||
[Using Apache ActiveMQ](https://activemq.apache.org/using-activemq) | ||
|
||
### 修改控制台密码 | ||
|
||
进入ActiveMQ容器,通过 */opt/apache-activemq/conf/jetty-realm.properties* 文件修改,重启 [ActiveMQ 服务](#service)后生效 | ||
|
||
### 运行 ActiveMQ 演示 | ||
|
||
ActiveMQ 附带了许多 Web 演示,这些演示说明了如何将 ActiveMQ 代理与 REST 和 AJAX 一起使用。 Web 演示在默认配置中未激活,因此您必须按照以下步骤运行它们: | ||
|
||
1. 进入ActiveMQ容器,编辑 /opt/apache-activemq/examples/conf/activemq-demo.xml 文件并更改位置属性以反映加密凭证文件的位置,该文件位于 /opt/activemq/conf/credentials-enc.properties: | ||
|
||
```shell | ||
<property name="locations"> | ||
<value>file:${activemq.conf}/credentials-enc.properties</value> | ||
</property> | ||
``` | ||
|
||
2. 如果 ActiveMQ 服务器当前正在运行,先停止: | ||
|
||
```shell | ||
docker stop activemq | ||
``` | ||
|
||
3. 运行示例: | ||
|
||
```shell | ||
docker exec -it activemq bash | ||
cd /opt/activemq | ||
sudo ./bin/activemq console xbean:/opt/activemq/examples/conf/activemq-demo.xml | ||
``` | ||
|
||
4. 等待 ActiveMQ 代理启动。 | ||
|
||
5. 登录到 Web 管理面板查看演示: *http://服务器公网 IP:8161/demo* | ||
|
||
### 配置消息 | ||
|
||
官方方案:http://activemq.apache.org/configuration.html | ||
|
||
## ActiveMQ 管理 | ||
|
||
### ActiveMQ 升级 | ||
|
||
ActiveMQ 主要采用二级制安装方式,其升级方案差不多等于安装: | ||
|
||
1. 进入容器,依次运行如下的命令做好准备: | ||
``` | ||
docker exec -it activemq bash | ||
# stop ActiveMQ service | ||
systemctl stop activemq | ||
# rename the dir of ActiveMQ for backup | ||
mv /opt/activemq /opt/activemqBK | ||
``` | ||
2. 访问 ActiveMQ 官方网站,[下载](http://activemq.apache.org/components/classic/download/)后解压并上传到:*/opt* 目录,并命名为 *activemq* | ||
3. 分别运行下面的修改权限 | ||
``` | ||
chown -R activemq. /opt/activemq | ||
chmod 640 /opt/activemq/examples/stomp/php/* | ||
chmod +x /opt/activemq/bin/activemq | ||
``` | ||
4. 重启 [ActiveMQ服务](../activemq#service) 后升级完成 | ||
|
||
### 运行调试模式 | ||
|
||
``` | ||
docker exec -it activemq bash | ||
systemctl stop activemq | ||
/opt/activemq/bin/activemq console | ||
``` | ||
|
||
|
||
|
||
## ActiveMQ 故障 | ||
|
||
#### ActiveMQ 服务无法启动? | ||
|
||
1. 以调试模式运行`activemq console`,便可以查看启动状态和错误 | ||
``` | ||
docker exec -it activemq bash | ||
/opt/activemq/bin/activemq | ||
``` | ||
2. 打开日志文件:*/opt/activemq/data/activemq.log*,检索 **failed** 关键词,分析错误原因 | ||
|
||
3. 常见的无法启动ActiveMQ服务的原因有如下几点: | ||
|
||
* 主机名不符合要求。例如:activemq5.6,这种包含"."的主机名就会导致ActiveMQ无法重启。参考如下命令重置主机名 | ||
``` | ||
hostnamectl set-hostname activemq | ||
``` | ||
* 缺乏Java的环境变量。通过:`echo $JAVA_HOME` 或 `which java` 查看反馈信息。 | ||
|
||
|
||
#### 是否可以修改 ActiveMQ 的源码路径? | ||
|
||
可以,但要参考如下的命令重试设置环境变量 | ||
``` | ||
echo 'export PATH="$PATH:/opt/activemq/bin"' >> /etc/profile | ||
``` | ||
|
||
#### 如何修改上传的文件权限? | ||
|
||
```shell | ||
docker exec -it activemq bash | ||
chown -R activemq.activemq /opt/activemq | ||
find /opt/activemq -type d -exec chmod 750 {} \; | ||
find /opt/activemq -type f -exec chmod 640 {} \; | ||
``` | ||
|
||
## ActiveMQ 问答 | ||
|
||
#### Active Classic vs ActiveMQ Artemis? | ||
|
||
ActiveMQ Artemis 是 ActiveMQ 下一代产品,未来将替换 ActiveMQ Classic。 具体参考:[ActiveMQ Classic](https://activemq.apache.org/getting-started), [ActiveMQ Artemis](https://activemq.apache.org/components/artemis/documentation/) | ||
|
||
#### ActiveMQ 中是否包含 Tomcat? | ||
|
||
ActiveMQ 官方提供的二级制包中包含 Tomcat,但已经集成到 ActiveMQ 服务中。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters