2017-07-03 301 views
1

您已成功設法使用docker swarm獲得運行的Infinispan羣集。我用這個網站弄清楚如何去做http://blog.infinispan.org/2016/07/improved-infinispan-docker-image.html使用Docker羣運行Infinispan羣集和服務器管理控制檯

我創建了我自己的覆蓋網絡,名爲infinispan。 我然後使用下面的命令起轉一個JGroups的八卦服務:

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

然後我起轉集羣中使用:

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] 

以下命令顯示的簇能夠跨看到彼此在羣兩個節點

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

我的問題是試圖讓使用以下兩種命令,而不是infinispanTest Servi大街運行的管理控制檯CE。

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] 

的infinispanCluster服務拒絕停止旋轉並訪問管理控制檯時對IP地址:9990它要求憑據,然後只是顯示一個空白屏幕。任何人都厭倦了此設置並取得了進展

從一個infinispanCluster容器中獲取一些日誌。

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 

回答

0

域模式通過按名稱鏈接容器來工作。域控制器被稱爲「dc」,從屬鏈接到它,以便變量DC_PORT,DC_HOST等可見。

你能在碼頭羣上跟隨這個命名嗎?

+0

只要im感知鏈接不在羣中使用/可用。然而,如果使用用戶定義的覆蓋網絡(即時使用)連接2個或更多服務,則他們可以使用羣組服務名稱例如彼此查詢。從運行在service_name_2中的容器ping/curl/wget service_name_1應該可以工作 –