简体   繁体   中英

Run Infinispan cluster with Server management console using Docker swarm

Hi have successfully managed to get an Infinispan cluster running using docker swarm. I used this site to figure out how to do it http://blog.infinispan.org/2016/07/improved-infinispan-docker-image.html

I created my own Overlay network called infinispan. I then spun up a jgroups-gossip service using the following command:

docker service create --name jgroupsGossip --replicas 2 --network infinispan jboss/jgroups-gossip

Then I spun up a cluster using:

docker service create --name infinispanTest --replicas 4 --network infinispan jboss/infinispan-server:latest -Djboss.default.jgroups.stack=tcp-gossip -Djgroups.gossip.initial_hosts=jgroupsGossip[12001]

The following command shows the clusters are able to see each other across the two nodes in the swarm

docker exec -it {CONTAINER_ID} /opt/jboss/infinispan-server/bin/ispn-cli.sh -c "/subsystem=datagrid-infinispan/cache-container=clustered:read-attribute(name=members)"

My problem is trying to get the management console running using the following two commands instead of the infinispanTest service.

docker service create --name infinispanUI --replicas 2 --network infinispan --publish 9990:9990 jboss/infinispan-server domain-controller -Djboss.default.jgroups.stack=tcp-gossip -Djgroups.gossip.initial_hosts=jgroupsGossip[12001]

docker service create --name infinispanCluster --replicas 4 --network infinispan jboss/infinispan-server host-controller -Djboss.default.jgroups.stack=tcp-gossip -Djgroups.gossip.initial_hosts=jgroupsGossip[12001]

The infinispanCluster service refuses to spin up and when accessing the management console on ip-address:9990 it asks for credentials and then just shows a blank screen. Anyone tired this setup before and made any progress

Managed to get some logs from one of the infinispanCluster containers.

Entry point arguments: host-controller -Djboss.default.jgroups.stack=tcp-gossip -Djgroups.gossip.initial_hosts=jgroupsGossip[12001]
Added user 'user' to file '/opt/jboss/infinispan-server/standalone/configuration/application-users.properties'
Added user 'user' to file '/opt/jboss/infinispan-server/domain/configuration/application-users.properties'
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /opt/jboss/infinispan-server

JAVA: /usr/lib/jvm/java/bin/java

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

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

15:23:59,225 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
15:23:59,371 INFO  [org.jboss.as.process.Host Controller.status] (main) WFLYPC0018: Starting process 'Host Controller'
[Host Controller] 15:23:59,911 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
[Host Controller] 15:24:00,087 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
[Host Controller] 15:24:00,132 INFO  [org.jboss.as] (MSC service thread 1-7) WFLYSRV0049: Infinispan Server 9.1.0.CR1 (WildFly Core 2.2.0.Final) starting
[Host Controller] 15:24:00,781 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'permgen-size' in the resource at address '/host=c04c29fac2cd/jvm=default' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
[Host Controller] 15:24:00,782 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'max-permgen-size' in the resource at address '/host=c04c29fac2cd/jvm=default' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
[Host Controller] 15:24:00,816 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
[Host Controller]     ("host" => "c04c29fac2cd"),
[Host Controller]     ("core-service" => "discovery-options"),
[Host Controller]     ("static-discovery" => "primary")
[Host Controller] ]) - failure description: "WFLYCTL0113: '' is an invalid value for parameter host. Values must have a minimum length of 1 characters"
[Host Controller] 15:24:00,822 INFO  [org.xnio] (MSC service thread 1-4) XNIO version 3.4.0.Final
[Host Controller] 15:24:00,828 INFO  [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.4.0.Final
[Host Controller] 15:24:00,859 FATAL [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0034: Host Controller boot has failed in an unrecoverable manner; exiting. See previous messages for details.
[Host Controller] 15:24:00,860 FATAL [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0178: Aborting with exit code 99
[Host Controller] 15:24:00,871 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0050: Infinispan Server 9.1.0.CR1 (WildFly Core 2.2.0.Final) stopped in 6ms
[Host Controller]
15:24:01,198 INFO  [org.jboss.as.process.Host Controller.status] (reaper for Host Controller) WFLYPC0011: Process 'Host Controller' finished with an exit status of 99
15:24:01,200 INFO  [org.jboss.as.process] (Thread-8) WFLYPC0017: Shutting down process controller
15:24:01,201 INFO  [org.jboss.as.process] (Thread-8) WFLYPC0016: All processes finished; exiting

The domain mode currently works by linking containers by name. The domain controller is called "dc" and the slaves are linked to it so that the variables DC_PORT, DC_HOST, etc are visible.

Can you follow this naming on docker swarm?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM