Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Gigaspaces on docker

Is it possible to get Gigaspaces (10.2.0) running successfully within a Docker container? I have managed to deploy my service in a container but I am having issues connecting to a remote space.

When I connect to the remote space, I create some notify listeners that are configured with a lease listener. It appears that the leases are expiring on these listeners, and as a result, they get expired and my service does not get its expected events.

I have turned on extra lrmi logging and can see some worrying warning/exceptions. The server channel state of NONE certainly stands out for me. 172.17.0.2 is the docker container IP address and 10.134.146.167 is the remote space

[gsc][6/367] 2017-11-20 13:54:22,122 FINE [com.gigaspaces.lrmi.watchdog] - Writing watch monitor request to the ServerEndpoint at [/10.134.146.167:7064] [gsc][6/367] 2017-11-20 13:54:22,122 FINE [com.gigaspaces.lrmi.watchdog] - Reading watch monitor response from the ServerEndpoint at [/10.134.146.167:7064] [gsc][6/367] 2017-11-20 13:54:22,137 FINE [com.gigaspaces.lrmi.watchdog] - The ServerEndPoint [/10.134.146.167:7064] is not reachable or is reachable but with no matching invocation in progress at the server peer, closing invalid connection with local address [/172.17.0.2:38022] [ remote invocation of: updateLeases] [java.io.IOException: No matching server channel invocation was found for this client at /10.134.146.167:7064, server channel state: NONE]; Caused by: java.io.IOException: No matching server channel invocation was found for this client at /10.134.146.167:7064, server channel state: NONE [gsc][6/367] 2017-11-20 13:54:22,137 FINE [com.gigaspaces.lrmi] - LRMI transport protocol over NIO broken connection with ServerEndPoint: [NIO://10.134.146.167:7064/pid[32 61]/505138961858_3_-1512117490315387709_details[class com.gigaspaces.internal.server.space.SpaceImpl(ucmSpace_container1:ucmSpace)]]; Caused by: java.nio.channels.ClosedChannel Exception [gsc][6/367] 2017-11-20 13:54:22,137 pu [1] WARNING [com.gigaspaces.spaceproxy.router.mySpace] - Async execution failed: java.rmi.ConnectIOException: null; nested exception is: [gsc][6/367] java.io.IOException: No matching server channel invocation was found for this client at /10.134.146.167:7064, server channel state: NONE, request=sp ace_container1:myspace=>UpdateLeasesSpaceOperationRequest[leases={com.gigaspaces.internal.lease.LeaseUpdateDetails@7491cf0a,com.gigaspaces.internal.lease.LeaseUpdateDetails@5 44906cc,com.gigaspaces.internal.lease... 0eb86a,com.gigaspaces.internal.lease.... c6c00,com.gigaspaces.internal.lease.L... 8026,com.gigaspaces.internal.lease.Le... 2d9,com.gigaspaces.internal.lease.Lea... 33,com.gigaspaces.internal.lease.Leas...]

Another log message I see a lot of is this, and according to this link is a sign of misconfiguration -

[lus][1/304] Nov 20, 2017 4:22:26 PM sun.rmi.server.UnicastRef logClientCall a.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease) [gsc][3/329] Nov 20, 2017 4:22:26 PM sun.rmi.server.UnicastRef logClientCall a.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease) [gsc][7/317] Nov 20, 2017 4:22:27 PM sun.rmi.server.UnicastRef logClientCall a.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease) [gsc][5/362] Nov 20, 2017 4:22:27 PM sun.rmi.server.UnicastRef logClientCall a.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease) [gsc][6/370] Nov 20, 2017 4:22:27 PM sun.rmi.server.UnicastRef logClientCall a.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease) [gsc][2/339] Nov 20, 2017 4:22:27 PM sun.rmi.server.UnicastRef logClientCall a.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease) [gsc][4/371] Nov 20, 2017 4:22:27 PM sun.rmi.server.UnicastRef logClientCall

I suspect it is a security/ports issue that it preventing the client from renewing the listener lease, but I have exposed and mapped the ports I think are required based on the parameters passed on space startup.

There are the flags/parameters I set -

ENV EXT_JAVA_OPTIONS "-Dcom.gs.multicast.enabled=false -Dcom.gs.multicast.discoveryPort=7000 -Dcom.gs.transport_protocol.lrmi.bind-port=7013-7199 -Dcom.gigaspaces.start.httpPort=7002 -Dcom.gigaspaces.system.registryPort=7001 -Djava.rmi.server.hostname=${NIC_ADDR} -Djava.rmi.server.RMIClassLoaderSpi=default -Djava.rmi.server.logCalls=true -Dcom.gs.transport_protocol.lrmi.selector.threads=10 -Dcom.gigaspaces.system.registryRetries=196 -Dcom.sun.jini.reggie.initialUnicastDiscoveryPort=7000 -Dcom.gigaspaces.unicast.interval=5000 -Dcom.gs.transport_protocol.lrmi.inspect_timeout=500 -Dcom.gs.transport_protocol.lrmi.connect_timeout=1s -Dcom.gs.transport_protocol.lrmi.request_timeout=1s -Dcom.gs.transport_protocol.lrmi.cache.buffer-size=5242880 -Dsun.rmi.client.logCalls=true"

Note that this setup works perfectly when deployed outside of the docker container.

asked 2017-11-20 10:35:16 -0600

phil_35 gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

It will depend upon how you manage networking for Docker. Said another way: How Docker sees other hosts in its network.

Are you using host mode networking? Kubernetes? Swarm?

answered 2017-11-20 13:19:38 -0600

edit flag offensive delete link more

Comments

Right now I'm simply creating a single container where my service will be running and that service needs to communicate with a remote space on another host.

I am able to ping the remote space from the docker container.

It's the default bridge mode that I am using. Will this only work with host mode?

phil_35 gravatar imagephil_35 ( 2017-11-21 07:01:03 -0600 )edit
0

Host mode should work for most lower-level environments. If you're running the docker server on your laptop, it's pretty straightforward to add the correct port ranges to the Dockerfile. Look over here: https://github.com/xap/xap-docker

It gets more complicated when you run across multiple hosts and need a tool like Kubernetes to keep better track of networking.

answered 2017-11-21 15:51:05 -0600

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-11-20 10:35:16 -0600

Seen: 88 times

Last updated: Nov 21