I have setup an Ignite Cluster with the ignite-geospatial module, however it is running into ClassNotFound Exception for H2SpatialIndex, something I know is caused by the lack of the ignite-geospatial module. I am new to Kubernetes and may have configured something wrong, but I am not sure how to check whether my Ignite Nodes have access to this module or not.
Is there any quick commands I can run to validate the classpath for ignite-geospatial?
Here is my Ignite 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
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.27
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
My previous deployment YAML did not include the ignite-geospatial value under the OPTION_LIBS, so I have since corrected that and restarted the Ignite Cluster. I can connect to the Ignite Cluster within Kubernetes using a Thick Client with PeerClassEnabled, but I run into the following issue after attempting to load any JTS Geometries. The same error can be found when running everything locally and explicitly omitting the ignite-geospatial module. The error is remedied locally when ignite-geospatial is added to the dependencies.
[o.a.i.i.processors.cache.ExchangeActions$CacheGroupActionData@413cde3b]]
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:359)
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:343)
... 21 more
node-configuration.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="peerClassLoadingEnabled" value="true"/>
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder">
<property name="namespace" value="ignite"/>
<property name="serviceName" value="ignite-service"/>
</bean>
</property>
</bean>
</property>
</bean>
</beans>
ignite service.yaml
apiVersion: v1
kind: Service
metadata:
# The name must be equal to KubernetesConnectionConfiguration.serviceName
name: ignite-service
# The name must be equal to KubernetesConnectionConfiguration.namespace
namespace: ignite
labels:
app: ignite
spec:
type: LoadBalancer
ports:
- name: rest
port: 8080
targetPort: 8080
- name: thinclients
port: 10800
targetPort: 10800
# Optional - remove 'sessionAffinity' property if the cluster
# and applications are deployed within Kubernetes
# sessionAffinity: ClientIP
selector:
# Must be equal to the label set for pods.
app: ignite
status:
loadBalancer: {}
cluster-role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ignite
namespace: ignite
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ignite
roleRef:
kind: ClusterRole
name: ignite
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: ignite
namespace: ignite
The latest jars are on https://gridgainsystems.com/nexus/content/repositories/external/org/gridgain/ignite-geospatial/8.8.30/ , and this series started about 2020. Before then , there was a series of libraries under org.apache.ignite.ignite-geospatial, maybe that's the problem.