Background
I am running an Ignite Cluster within Kubernetes and wish to use Java Thick Client to load geospatial objects into an Ignite Cache. I succeed on local deployments where ignite-geospatial module is loaded from GridGain external repository, but I encounter errors on spatial indexing when attempting the same workflow in Kubernetes. I suspect it is due to the ignite-geospatial module not accessible to Ignite Nodes, but I am unsure how to confirm or troubleshoot.
I am using GridGain Community 8.8.29.
I have tried including the following OPTION_LIBS in the deployment YAML:
- ignite-geospatial
- ignite-geospatial-ext
Deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"name":"ignite-cluster","namespace":"ignite"},"spec":{"replicas":2,"selector":{"matchLabels":{"app":"ignite"}},"template":{"metadata":{"labels":{"app":"ignite"}},"spec":{"containers":[{"env":[{"name":"OPTION_LIBS","value":"ignite-kubernetes,ignite-rest-http"},{"name":"CONFIG_URI","value":"file:///ignite/config/node-configuration.xml"}],"image":"gridgain/community:latest","name":"ignite-node","ports":[{"containerPort":47100},{"containerPort":47500},{"containerPort":49112},{"containerPort":10800},{"containerPort":8080}],"volumeMounts":[{"mountPath":"/ignite/config","name":"config-vol"}]}],"serviceAccountName":"ignite","terminationGracePeriodSeconds":100000,"volumes":[{"configMap":{"name":"ignite-config"},"name":"config-vol"}]}}}}
creationTimestamp: "2023-03-15T11:42:44Z"
generation: 1
name: ignite-cluster
namespace: ignite
resourceVersion: "404448299"
uid: 6b30b411-b6bb-49e1-b58a-b656e3c53587
spec:
progressDeadlineSeconds: 600
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
app: ignite
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: ignite
spec:
containers:
- env:
- name: OPTION_LIBS
value: ignite-kubernetes,ignite-rest-http,ignite-geospatial
- name: CONFIG_URI
value: file:///ignite/config/node-configuration.xml
image: gridgain/community:8.8.29
imagePullPolicy: Always
name: ignite-node
ports:
- containerPort: 47100
protocol: TCP
- containerPort: 47500
protocol: TCP
- containerPort: 49112
protocol: TCP
- containerPort: 10800
protocol: TCP
- containerPort: 8080
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /ignite/config
name: config-vol
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: ignite
serviceAccountName: ignite
terminationGracePeriodSeconds: 100000
volumes:
- configMap:
defaultMode: 420
name: ignite-config
name: config-vol
Still, I encounter the ClassNotFound Exception for GridH2SpatialIndex:
class org.apache.ignite.IgniteException: Failed to instantiate: org.apache.ignite.internal.processors.query.h2.opt.GridH2SpatialIndex
at org.apache.ignite.internal.processors.query.h2.H2Utils.createSpatialIndex(H2Utils.java:364)
at org.apache.ignite.internal.processors.query.h2.H2TableDescriptor.createUserIndex(H2TableDescriptor.java:442)
at org.apache.ignite.internal.processors.query.h2.H2TableDescriptor.createUserIndexes(H2TableDescriptor.java:392)
at org.apache.ignite.internal.processors.query.h2.SchemaManager.createTable(SchemaManager.java:554)
at org.apache.ignite.internal.processors.query.h2.SchemaManager.onCacheTypeCreated(SchemaManager.java:338)
at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.registerType(IgniteH2Indexing.java:1979)
at org.apache.ignite.internal.processors.query.GridQueryProcessor.registerCache0(GridQueryProcessor.java:2205)
at org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart0(GridQueryProcessor.java:1048)
at org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart(GridQueryProcessor.java:1115)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1968)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$prepareStartCaches$55a0e703$1(GridCacheProcessor.java:1838)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$prepareStartCachesIfPossible$14(GridCacheProcessor.java:1808)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareStartCaches(GridCacheProcessor.java:1835)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareStartCachesIfPossible(GridCacheProcessor.java:1806)
at org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.processCacheStartRequests(CacheAffinitySharedManager.java:1039)
at org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.onCacheChangeRequest(CacheAffinitySharedManager.java:925)
at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.onCacheChangeRequest(GridDhtPartitionsExchangeFuture.java:1479)
at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:986)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body0(GridCachePartitionExchangeManager.java:3416)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:3245)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:119)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassNotFoundException: org.apache.ignite.internal.processors.query.h2.opt.GridH2SpatialIndex
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at org.apache.ignite.internal.processors.query.h2.H2Utils.createSpatialIndex(H2Utils.java:348)
... 21 more
The above error occurs as soon as I attempt to set QueryIndexType.GEOSPATIAL indexes on the geometry column of a query entity holding valid JTS geometries. I am able to index these entities when running the Ignite Cluster locally where I am including the ignite-geospatial dependency from the GridGain external repository, but am unable to reproduce success within Kubernetes Ignite Cluster.
Java Thick Client pom.xml excerpt
<repositories>
<repository>
<id>GridGain External Repository</id>
<url>https://www.gridgainsystems.com/nexus/content/repositories/external</url>
</repository>
</repositories>
<dependency>
<groupId>org.gridgain</groupId>
<artifactId>ignite-geospatial</artifactId>
<version>${gridgain.version}</version>
</dependency>
Questions
- Are there alternative methods to loading the
ignite-geospatialmodule? Like EXTERNAL_LIBS? - Are there inherent conflicts with attempting to use this module in a stateless Ignite Cluster deployment?
- I saw
ignite-geospatialwas moved to an Ignite Extension in May 2022, does this impact the way in which Ignite Cluster must enable the module? - Are there any other troubleshooting measures we can try?
Thank you for your time.