【问题标题】:How enable management console with wildfly swarm docker?如何使用 wildfly swarm docker 启用管理控制台?
【发布时间】:2023-04-11 08:56:01
【问题描述】:

我想为服务器 Wildfly swarm docker 激活控制台管理

我在 pom 中有依赖项

        <dependency>
    <groupId>org.wildfly.swarm</groupId>
    <artifactId>management-console</artifactId>
    <version>2017.1.1</version>
</dependency>
<dependency>
    <groupId>org.wildfly.swarm</groupId>
    <artifactId>management</artifactId>
    <version>2017.1.1</version>
    <type>jar</type>
</dependency>

我在日志中有管理 - STABLE,但也有 WFLYSRV0054:管理控制台未启用。

我尝试通过项目阶段文件启用控制台并添加:

swarm:
  management:
    security-realms:
      ManagementRealm:
        in-memory-authentication:
          users:
            admin:    
              password: admin                            
    http-interface-management-interface:
      allowed-origins:
      - http://localhost:8080
      security-realm: ManagementRealm

但是没有用。 有人可以帮我吗?

【问题讨论】:

    标签: docker wildfly wildfly-swarm


    【解决方案1】:

    我在我的 docker 镜像中添加了管理员用户。这样,您将在服务的所有任务(容器)中拥有相同的用户。

    Dockerfile 示例:

    FROM jboss/wildfly:latest
    # create user
    RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin#123 --silent
    # enable management console
    CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
    

    【讨论】:

      【解决方案2】:

      以下配置对我有用。

      thorntail:
        management:
           audit-access:
             audit-log-logger:
               log-boot: true
               enabled: true
           security-realms:
             ApplicationRealm:
               ssl-server-identity:
                 alias: my_app_ssl
                 keystore-provider: PKCS12
                 keystore-path: /home/keystore.p12
                 keystore-password: changeit
             ManagementRealm:
               in-memory-authentication:
                 users:
                   admin:
                     password: admin
               in-memory-authorization:
                 users:
                   admin:
                     roles:
                       - admin
           http-interface-management-interface:
             console-enabled: true
             allowed-origins:
               - http://localhost:8080
             security-realm: ManagementRealm
      
      

      以下是添加到 pom 文件中的依赖项

      <dependency>
                  <groupId>io.thorntail</groupId>
                  <artifactId>management</artifactId>
              </dependency>
              <dependency>
                  <groupId>io.thorntail</groupId>
                  <artifactId>management-console</artifactId>
              </dependency>
      
      

      这就是我访问控制台的方式

      http://127.0.0.1:8080/console/

      更多信息请看下面的链接。

      https://github.com/thorntail/thorntail-examples/blob/master/management-console/README.md

      【讨论】:

        猜你喜欢
        • 2018-10-25
        • 2019-05-11
        • 2018-05-11
        • 2018-08-02
        • 1970-01-01
        • 1970-01-01
        • 2016-07-31
        • 1970-01-01
        • 2015-05-22
        相关资源
        最近更新 更多