1

We have Ignite running inside a docker container and we would like to connect thick client to it in order to perform some specific operations (e.g. reset lost partitions). Unfortunately we found it unable to do so, because according to the documentation only Ignition.Start() and Ignition.GetIgnite() methods return IIgnite interface, which has those methods.

Ignition.Start() method would start another instance of Ignite instead of connecting to the existing one and Ignite.GetIgnite() throws an error, because it does not recognize the docker instance as a running cluster.

Is there a way to connect thick client to an existing Ignite cluster without having to start another instance at the same time?

Isard
  • 312
  • 1
  • 14

1 Answers1

0

First of all, there is no need to use a thick client to perform cluster-related maintanance activities.

Resetting lost partitions could be done using the control script.

control.sh --cache reset_lost_partitions myCache

To do that, you should attach your shell to any of the running containers. Check this or that questions on the topic. Should be something like:

kubectl exec --stdin --tty <ignite-pod-name> -- /bin/bash
cd /opt/ignite/apache-ignite/bin
./control.sh --cache reset_lost_partitions myCache

If you really need to start a thick client nearby your cluster, you should build a customer Docker image. Then start it in another POD providing a proper Ignite configuration, in particular the discovery settings.

Another approach is to start a thick client on another host, for example your local machine, without deploying it to the Kubernetes. This might be OK for utility needs but it's not recommended in production. Remember to set forceClientToServerConnections flag in this case.

Alexandr Shapkin
  • 2,350
  • 1
  • 6
  • 10
  • Sorry, the question was not about Kubernetes, but rahter about plain Docker deployment. The idea is still the same, but the attach command is going to be a bit different. – Alexandr Shapkin Mar 03 '23 at 14:01
  • The Kubernetes part is very helpful too, because we are actually using it and we are experiencing partition losses and we are aware of the control.sh script and even used it, but instead of having to do this manually, we wanted to create a .net application to monitor the cluster and reset partitions when it's needed. That's why we tried to reach the thick client. But maybe you suggest a different approach to make it automatically? – Isard Mar 03 '23 at 14:21
  • There is no automation of resetting lost partitions with a reason. Doing it improperly you can end up losing your data. For example, when not all the baseline nodes are available and you are resetting them In general, having the lost partition should not be OK it's more about indication of some issues in the cluster, and I do not recommend having it automated. – Alexandr Shapkin Mar 03 '23 at 16:28
  • Alright, then if the partition loss happens, it means that the cluster is not working properly? Because in our case, it may happen even when we open 3-4 sqlline terminals. And about this customer docker image, because thick client might be useful even if not for resetting lost partitions, but for something else. Do you have any example of that docker image? We tried to run it inside the cluster, in another pod than the Ignite and we didn't manage to make it. – Isard Mar 06 '23 at 06:50