JBoss Wildfly 8.1上的HawtIO

HawtIO为基于JVM的中间件提供了令人赞叹的视觉效果。 它是应用程序的统一控制台,否则将不得不构建自己的糟糕的Web控制台。 老实说,它们的构建方式各不相同,技术不同,用户体验不同,并且都围绕一种可怕的方式来尝试在QA / PROD环境中管理中间件……我能听到有人说“ amen brotha”。

徽标-450像素

因此, HawtIO是解决此问题的理想方法。 它是开源的Apache 2.0许可的 ,并且具有强大的社区支持。使用AngularJS和良好的插件体系结构编写而成,您可以将其扩展到自己的个人应用程序中。

您可能已经注意到,它也是Fabric8的绝佳控制台,它是JVM中间件开放DevOps平台 -它使中间件的管理,部署,配置,版本控制,发现,负载平衡等工作变得更加轻松。

但是,今天使用HawtIO有什么选择?

许多!

HawtIO实际上只是在JVM中运行的Web应用程序。 所以这是您的选择:

  • 将其作为WAR部署到您喜欢的servlet容器(Tomcat,Jetty,JBoss Wildfly / EAP)中
  • 作为可执行的Java应用程序独立部署
  • 使用HawtIO Chrome扩展程序直接从浏览器插入应用程序

查看“ 入门”页面,以获取有关使用在不同配置中部署的HawtIO的更多详细信息。

HawtIO具有出色的插件,可用于配置,管理和可视化Apache ActiveMQ代理, Apache Camel路由, Apache Karaf OSGI捆绑/服务/配置以及Tomcat,Wildfly,Jetty,ElasticSearch,jclouds等等等 。 例如,要管理ActiveMQ经纪人, 请查看我的好友Dejan的博客文章

当我们在Red Hat推出JBoss FuseJBoss Fuse Serviceworks时 ,我们在集成各个组件方面变得越来越好。 例如,通过Fuse Service Works订阅,您可以完全访问A-MQ,Fuse及其所有组件,包括HawtIO。 不幸的是,到目前为止,EAP尚未“正式”支持HawtIO,但是在下一发行版中将对此进行修复。 这不是技术的局限性,而是存在着太多的东西,并且Red Hat具有严格的测试/兼容性要求,因此我们需要在完全“支持”它之前完成所有测试/认证。

但是……在我们等待支持的过程中,实际上没有理由不使用它(至少是Development和QA)。 而且已经有很多人这样做了。 请记住,它尚未得到官方支持!

wildflynew改良

因此,本博客的其余部分是逐步指南,其中包含有关如何在您的JBoss Wildfly 8.1应用程序服务器上部署和保护HawtIO的最佳实践。 下一个条目(第二部分)将显示与JBoss EAP 6.2发行版相同的条目。 本指南将使用HawtIO 1.4.11(社区的最新版本)。

入门

首先,假设您知道从何处下载Wildfly 8.1 。 但是从这里开始,我们将想要获得最新的HawtIO发行版 (在撰写本文时为1.4.11) 。 我们将使用hawtio-default-1.4.11.war进行具体说明。 下载发行版后,请考虑以下步骤:

1.删​​除log4j.properties文件

我们将要删除发行版随附的log4j.properties文件,因为我们将要使用JBoss Wildfly的内置日志记录工具,该工具会自动插入到HawtIO写入的log4j日志中。 如果不删除log4j.properties,则希望将每个部署的日志记录设置为false。 。 但是,因为这并不困难,所以我们只需删除log4j.properties(注意:您应该在其日志记录组件上查看wildfly文档,以获取有关日志记录子系统灵活性的更多信息

ceposta@postamachat(renamed) $ ll
total 50936
-rw-r--r--@ 1 ceposta  staff    25M Jul 25 14:00 hawtio-default-1.4.11.war

ceposta@postamachat(renamed) $ unzip -l hawtio-default-1.4.11.war | grep log4j.properties
     1268  07-13-14 17:23   WEB-INF/classes/log4j.properties

ceposta@postamachat(renamed) $ zip -d  hawtio-default-1.4.11.war WEB-INF/classes/log4j.properties
deleting: WEB-INF/classes/log4j.properties

2.重命名发行版

我们将要重命名发行版,以便在部署Web应用程序后更轻松地使用它。 请注意,这不是必须执行的步骤,而是可以轻松使用的妙处:

ceposta@postamachat(renamed) $ mv hawtio-default-1.4.11.war hawtio.war

现在,当我们部署WAR文件时,我们将能够像这样访问上下文:http:// localhost:8080 / hawtio

而不用担心版本号。

3.放松CDI子系统

HawtIO确实使用了一些CDI注释(例如@Inject),但是默认情况下不包含beans.xml文件。 根据引入隐式bean档案的CDI 1.1规范,Wildfly 8.1默认情况下不喜欢这样做。 我们可以告诉Wildfly忽略这个web应用的CDI应用程序,因为它没有包括beans.xml中 ,我们可以有效地禁用隐豆档案。 为此,请编辑您的配置文件(我们将使用standalone.xml,但如果使用域模式,请为此编辑相应的配置文件):

353         ....
354         <subsystem xmlns="urn:jboss:domain:weld:2.0" require-bean-descriptor="true"/>
355     </profile>

4.故意禁用安全性

We want to make sure the webapp deployed correctly and you can access all of the HawtIO goodies. So we'll temporarily _disable_ security on the webapp so we can access it. To do this, add this section after the `<extensions/>` section:

    31     <system-properties>
    32         <property name="hawtio.authenticationEnabled" value="false" />
    33     </system-properties>

我们将在后面的部分中恢复安全性

5.部署HawtIO

现在您可以部署HawtIO了!

如果您刚刚打开Wildfly发行版的包装,则需要在管理和应用程序领域中添加一些用户:

ceposta@postamachat(wildfly-8.1.0.Final) $ ./bin/add-user.sh

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a):

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : admin
The username 'admin' is easy to guess
Are you sure you want to add user 'admin' yes/no? yes
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
 - The password should be different from the username
Password :
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: admin
About to add user 'admin' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'admin' to file '/Users/ceposta/dev/eap/wildfly-8.1.0.Final/standalone/configuration/mgmt-users.properties'
Added user 'admin' to file '/Users/ceposta/dev/eap/wildfly-8.1.0.Final/domain/configuration/mgmt-users.properties'
Added user 'admin' with groups admin to file '/Users/ceposta/dev/eap/wildfly-8.1.0.Final/standalone/configuration/mgmt-groups.properties'
Added user 'admin' with groups admin to file '/Users/ceposta/dev/eap/wildfly-8.1.0.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? no

您现在可以启动Wildfly并部署HawtIO! 启动Wildfly:

ceposta@postamachat(wildfly-8.1.0.Final) $ ./bin/standalone.sh

并导航到Web控制台。 使用您在上面的添加用户部分中设置的用户名和密码来访问Web控制台。 您可以通过导航到http:// localhost:9990 /来访问Web控制台。 现在,单击“ 运行时”选项卡,然后单击“ 管理部署” 。 单击“添加”,导航到HawtIO发行版的下载位置并重命名。 添加后,您应点击“启用”按钮以启用它。 您应该有一个如下所示的屏幕:

00-hawtio-deployed-wildfly

6.使用HawtIO!

现在您应该可以访问http:// localhost:8080 / hawtio并开始使用HawtIO!

01-重量

注意:在Mac上的Safari上,似乎存在一些与安全性/登录有关的问题。 似乎提示您输入un / pw。 只需尝试使用Chrome或其他网络浏览器即可。

7.设置安全性

因此,在企业环境中,无论是开发环境还是QA环境,我们都希望保护HawtIO。 为此,我们需要绑定到Widlfly的安全子系统

首先,让我们首先停止Wildfly,然后再次编辑独立配置文件。 在禁用安全性的同一位置,让我们重新启用它并添加更多其他选项。 您的<system-properties>部分应如下所示:

31     <system-properties>
32         <property name="hawtio.authenticationEnabled" value="true" />
33         <property name="hawtio.realm" value="jboss-web-policy" />
34         <property name="hawtio.role" value="admin" />
35     </system-properties>

太棒了! 现在让我们添加一个能够登录的用户。 我们将在本指南中再次使用./bin/add-user.sh,但是最有可能在您的环境中使用比默认使用的属性文件更复杂的安全性机制(数据库,LDAP等)。 但是,尽管如此,让我们向ApplicationRealm添加一个新用户:

ceposta@postamachat(wildfly-8.1.0.Final) $ ./bin/add-user.sh 

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a): b

Enter the details of the new user to add.
Using realm 'ApplicationRealm' as discovered from the existing property files.
Username : ceposta
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
 - The password should be different from the username
Password :
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: admin
About to add user 'ceposta' for realm 'ApplicationRealm'
Is this correct yes/no? yes
Added user 'ceposta' to file '/Users/ceposta/dev/eap/wildfly-8.1.0.Final/standalone/configuration/application-users.properties'
Added user 'ceposta' to file '/Users/ceposta/dev/eap/wildfly-8.1.0.Final/domain/configuration/application-users.properties'
Added user 'ceposta' with groups admin to file '/Users/ceposta/dev/eap/wildfly-8.1.0.Final/standalone/configuration/application-roles.properties'
Added user 'ceposta' with groups admin to file '/Users/ceposta/dev/eap/wildfly-8.1.0.Final/domain/configuration/application-roles.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? no

现在,让我们再次启动应用服务器:

ceposta@postamachat(wildfly-8.1.0.Final) $ ./bin/standalone.sh

当我们再次导航到http:// localhost:8080 / hawtio端点时,应该看到一个登录页面:

02-重量级安全

EAP呢?

你有它! 您已经在Wildfly上运行并保护了HawtIO! 现在,您可以检查使用HawtIO可以完成的所有令人敬畏的事情 ,尤其是可以管理,调试,跟踪,分析和监视Apache Camel路由的事情。

但是在JBoss EAP上做同样的事情呢? 请继续关注下一部分……我将向您确切演示如何做到这一点!

翻译自: https://www.javacodegeeks.com/2014/08/hawtio-on-jboss-wildfly-8-1.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值