3

I'm trying to get a bit more into infispan and, as described in the docs, I cloned the tutorials repo. To get it started easily, I use the official docker images, this time (since I had problems with 13.X) limiting myself to 12.1 - tutorial branch as well as the docker image.

To start the docker image, I tried both ways:

docker run -p 11222:11222 -e USER="Titus Bramble" -e PASS="Shambles" --name infinispan infinispan/server:12.1

docker run --network host -e USER="Titus Bramble" -e PASS="Shambles" --name infinispan infinispan/server:12.1

Both do not work. The client says, a lot of time:

Sep 11, 2021 10:14:24 AM org.infinispan.client.hotrod.impl.transport.netty.ChannelFactory closeChannelPools
INFO: ISPN004016: Server not in cluster anymore(127.0.0.1:11222), removing from the pool.

...until it fails to connect:

io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: /127.0.0.1:11222
Caused by: java.net.ConnectException: Connection refused: no further information

The basic code is...

ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServer()
       .host("127.0.0.1")
       .port(ConfigurationProperties.DEFAULT_HOTROD_PORT)
     .security().authentication()
       //Add user credentials.
       .username("Titus Bramble")
       .password("Shambles")
       .realm("default")
       .saslMechanism("DIGEST-MD5");    

// Connect to the server
RemoteCacheManager client = new RemoteCacheManager(builder.build());

While I'm not running a mac, I tried the old workaround...

  builder.clientIntelligence(ClientIntelligence.BASIC);

...but this doesn't help either. This only happens with a dockerized infinispan, but not when infinispan is installed "traditionally".

Running Docker for Windows on a Windows 10 machine, Java version is 8. Anyone got an idea what's going on here?

Florian Schaetz
  • 10,454
  • 5
  • 32
  • 58
  • hmmm... not familiar with docker for windows. Have you tried with other non-infinispan images? Checking the ports are working properly. – pruivo Sep 22 '21 at 10:39
  • I had no problems with any other images, they work totally fine. But of course, those will not try cluster logic normally. But I would have expected "network host" to work for a single node, at least. – Florian Schaetz Sep 22 '21 at 11:47
  • any errors in the logs? Check if the container is listening in the correct IP and Port by looking for the log entry `Server '' listening on http://:11222`. You can also try to access the web console from the browser using http://127.0.0.1:11222. – pruivo Sep 22 '21 at 13:01
  • Ok, that is a good hint, it seems that while the docker container is running in the host's network, infinispan itself only listens to the docker's internal ip: `Server 'docker-desktop-61819' listening on http://192.168.65.4:11222`. Is there an easy way to set the ip the server should listen at? – Florian Schaetz Sep 22 '21 at 14:20
  • it would be easier to change the IP in the client configuration: `builder.addServer().host("192.168.65.4")`. Currently is not possible to change the bind-address without setting a full XML configuration: https://github.com/infinispan/infinispan-images#custom-infinispan-xml-configuration – pruivo Sep 24 '21 at 08:50
  • 1
    Unfortunately, that's an internal ip of the docker network and not reachable from the host. – Florian Schaetz Oct 07 '21 at 11:39

0 Answers0