gpt4 book ai didi

jboss - Wildfly 10 - 域模式下的身份验证失败

转载 作者:行者123 更新时间:2023-12-04 16:40:48 25 4
gpt4 key购买 nike

我遇到了误会的情况。

我尝试将 Ubuntu 16.04 上的 Wildfly 10.1.0 设置为在域模式下工作。为了测试,我有额外的虚拟机。

基本系统:域 Controller

虚拟机:主机 Controller

通常我使用的配置 wildfly documentation但它不能正常工作。

没有身份验证主机服务器可以连接到域 Controller ,但是当我想使用身份验证时出现问题 - 有一些我不明白的奇怪行为。

在域 Controller 上:

  1. 在 host-master.xml 中设置所有内容
  2. 使用以下选项创建管理用户:

用户:测试

密码:测试

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? yes To represent the user add the following to the server-identities definition secret value="dGVzdA=="

3.服务器使用domain.sh --host-config=host-master.xml 启动没有问题

在主机 Controller 上:

  1. 用 secret 值设置 host-slave.xml 中的所有内容:

            <security-realm name="ManagementRealm">
    <server-identities>
    <secret value="dGVzdA==" />
    </server-identities>
    <authentication>
    <local default-user="$local" skip-group-loading="true"/>
    <properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>
    </authentication>
    <authorization map-groups-to-roles="false">
    <properties path="mgmt-groups.properties" relative-to="jboss.domain.config.dir"/>
    </authorization>
    </security-realm>
    1. 使用domain.sh --host-config=host-slave.xml 启动服务器

当我启动服务器时出现以下错误:

*[主机 Controller ] 22:23:03,553 WARN [org.jboss.as.host.controller] **( Controller 引导线程)​​WFLYHC0001:无法连接到远程域 Controller remote://192.168.56.1:9999 -- java.lang.IllegalStateException: WFLYHC0043: 由于身份验证失败无法连接。*

./domain.sh --host-config=host-slave.xml
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /home/test1/Warsztat/wildfly

JAVA: java

JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

22:22:59,931 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
22:23:00,212 INFO [org.jboss.as.process.Host Controller.status] (main) WFLYPC0018: Starting process 'Host Controller'
[Host Controller] 22:23:01,207 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
[Host Controller] 22:23:01,521 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
[Host Controller] 22:23:01,586 INFO [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) starting
[Host Controller] 22:23:02,624 INFO [org.xnio] (MSC service thread 1-1) XNIO version 3.4.0.Final
[Host Controller] 22:23:02,634 INFO [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.4.0.Final
[Host Controller] 22:23:02,741 WARN [org.jboss.as.domain.management.security] (MSC service thread 1-2) WFLYDM0111: Keystore /home/test1/Warsztat/wildfly/domain/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
[Host Controller] 22:23:02,752 INFO [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.21.Final
[Host Controller] 22:23:02,834 INFO [org.jboss.as.remoting] (MSC service thread 1-1) WFLYRMT0001: Listening on 192.168.56.111:9999
[Host Controller] 22:23:03,553 WARN [org.jboss.as.host.controller] **(Controller Boot Thread) WFLYHC0001: Could not connect to remote domain controller remote://192.168.56.1:9999 -- java.lang.IllegalStateException: WFLYHC0043: Unable to connect due to authentication failure.**
[Host Controller] 22:23:03,554 WARN [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0147: No domain controller discovery options remain.
[Host Controller] 22:23:03,555 ERROR [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0002: Could not connect to master. Aborting. Error was: java.lang.IllegalStateException: WFLYHC0120: Tried all domain controller discovery option(s) but unable to connect
[Host Controller] 22:23:03,556 FATAL [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0178: Aborting with exit code 99
[Host Controller] 22:23:03,603 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0050: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) stopped in 22ms
[Host Controller]
22:23:04,063 INFO [org.jboss.as.process.Host Controller.status] (reaper for Host Controller) WFLYPC0011: Process 'Host Controller' finished with an exit status of 99
22:23:04,066 INFO [org.jboss.as.process] (Thread-8) WFLYPC0017: Shutting down process controller
22:23:04,066 INFO [org.jboss.as.process] (Thread-8) WFLYPC0016: All processes finished; exiting

但是如果我将主机 Controller 上的 name="test"添加到如下所示的 host-slave.xml 文件中(名称必须与在域 Controller 中创建的用户管理相同)它就可以工作!

<host xmlns="urn:jboss:domain:4.2" name="test">

我完全不明白,我找不到任何解释那种情况?任何人都知道为什么我必须添加 name="test"?

最佳答案

好的 - 我找到了解释。

Security Realms documentation是有关如何定义您自己的用户名以进行身份​​验证的信息:

By default when a slave host controller authenticates against the master domain controller it uses its configured name as its username. If you want to override the username used for authentication a username attribute can be added to the element.

在我的例子中,我必须像下面这样添加用户名:

<domain-controller>
<remote security-realm="ManagementRealm" username="atest">
<discovery-options>
<static-discovery name="primary" protocol="${jboss.domain.master.protocol:remote}" host="${jboss.domain.master.address:192.168.56.1}" port="${jboss.domain.master.port:9999}"/>
</discovery-options>
</remote>
</domain-controller>

现在我可以自由设置名称

关于jboss - Wildfly 10 - 域模式下的身份验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43620988/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com