0

I am new to Wildly and Docker

I am trying to build a test cluster of wildfly.

I am using docker compose for orchestration. Following is my docker-compose.yml file

node:  
  image: wildfly-mgmt  
  links:  
    - lb:lb  
lb:  
  image: wildfly-cluster-httpd  
  ports:  
   - "9090:80" 

After running docker-compose up I can not see the nodes in the mod cluster Management page. http://localhost:9090/mod_cluster_manager It is blank, somehow mod_cluster manager not able to see the nodes...

Docker file for mod cluster:

FROM fedora:latest  

RUN yum -y update  
RUN yum -y install httpd mod_cluster  
RUN yum clean all  

RUN sed -i 's|LoadModule proxy_balancer_module|# LoadModule proxy_balancer_module|' /etc/httpd/conf.modules.d/00-proxy.conf  

ADD mod_cluster.conf /etc/httpd/conf.d/mod_cluster.conf  

EXPOSE 80  

CMD ["/sbin/httpd", "-DFOREGROUND"]

Mod_cluster.conf

LoadModule slotmem_module       modules/mod_slotmem.so  
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so  
LoadModule advertise_module     modules/mod_advertise.so  
LoadModule manager_module       modules/mod_manager.so  


<IfModule manager_module>  
  Maxhost 100  
  ServerName localhost  
  <VirtualHost *:80>  


    <Directory />  
      Require all granted  
    </Directory>  


    <Location /mod_cluster_manager>  
      SetHandler mod_cluster-manager  
      Require all granted  
    </Location>  


    KeepAliveTimeout 60  
    ManagerBalancerName mycluster  
    EnableMCPMReceive On  
    ServerAdvertise On  


  </VirtualHost>  
</IfModule>

I can see the servers running. > Docker ps command shows the two containers

CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                  NAMES
b613166f4236        wildfly-mgmt            "/opt/jboss/wildfly/b"   18 hours ago        Up 18 hours         8080/tcp               dockercomposecluster_node_1
963a728bae70        wildfly-cluster-httpd   "/sbin/httpd -DFOREGR"   18 hours ago        Up 18 hours         0.0.0.0:9090->80/tcp   dockercomposecluster_lb_1

I can see the servers running from the console log

node_1  | 19:43:23,828 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://0.0.0.0:9990/management
node_1  | 19:43:23,828 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://0.0.0.0:9990
node_1  | 19:43:23,829 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 75208ms - Started 331 of 577 services (393 services are lazy, passive or on-demand)

But the Mod-CLuster_manager is not able to see the nodes. Can anyone please point out what is wrong here? I am really new to this.

4

1 回答 1

0

对于调试,您可以docker exec -it containername bash为交互式终端执行 -it。这应该把你放在容器里。从那里你可以做telnet <containername> <port>(​​你可能必须先安装 telnet) - 或者docker inspect <containername>你想查看和使用它的 IP 的容器。如果您不能远程登录,您是否尝试过在同一个 docker 网络上启动它们?

于 2017-01-07T13:18:15.110 回答