1

I am trying to set up an Elastic search connector in graphDB with the following query:

PREFIX :<http://www.ontotext.com/connectors/elasticsearch#>
PREFIX inst:<http://www.ontotext.com/connectors/elasticsearch/instance#>
INSERT DATA {
    inst:field :createConnector '''
{
  "fields": [
    {
      "fieldName": "crop",
      "propertyChain": [
        "https://data.agrimetrics.co.uk/ontologies/general/isLocationFor"
      ],
      "indexed": true,
      "stored": true,
      "analyzed": true,
      "multivalued": true,
      "fielddata": false,
      "objectFields": []
    }
  ],
  "languages": [],
  "types": [
    "https://data.agrimetrics.co.uk/ontologies/general/Y1x5BN2XVZIvn1"
  ],
  "readonly": false,
  "detectFields": false,
  "importGraph": false,
  "elasticsearchNode": "http://20.67.27.121:9200",
  "elasticsearchClusterSniff": true,
  "manageIndex": true,
  "manageMapping": true,
  "bulkUpdateBatchSize": 5000,
  "bulkUpdateRequestSize": 5242880
}
''' .
}

I can see that the index is created in elastic:

[2021-07-29T08:45:10,252][INFO ][o.e.c.m.MetadataCreateIndexService] [richardElastic] [field] creating index, cause [api], templates [], shards [1]/[1]

but on the graphDB side I am getting a 500 error "Unable to check if index exists". This is the config of elastic:

{
  "name" : "richardElastic",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "skU191RwSnOu7FQiFB7dBg",
  "version" : {
    "number" : "7.13.4",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "c5f60e894ca0c61cdbae4f5a686d9f08bcefc942",
    "build_date" : "2021-07-14T18:33:36.673943207Z",
    "build_snapshot" : false,
    "lucene_version" : "8.8.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

and this is the YAML:

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
# network.host: _eth0_
# network.host: [_local_, _site_, _global_]
# network.host: 0.0.0.0
network.host: _eth0:ipv4_
cluster.initial_master_nodes: node-1
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

Any help gratefully appreciated. This appears to be the relevant section of the logs:

[ERROR] 2021-09-02 13:06:15,723 [worker http://10.7.3.7:7080/repositories/farmData@http://10.7.3.5:8080/repositories/farmData | c.o.t.r.a.ClusterOperation] Error while executing transaction
file:/opt/graphdb-data/graphdb-master-home/data/repositories/farmData/txlog/transactions/d84/d84b8d2c-d410-49f5-a06a-a7cb18e390d8.tar
org.eclipse.rdf4j.http.server.HTTPException: null
    at com.ontotext.trree.util.Http.call(Http.java:50)
    at com.ontotext.trree.replicationcluster.RemoteWorkerRequest.postNext(RemoteWorkerRequest.java:342)
    at com.ontotext.trree.replicationcluster.WorkerThread$3.call(WorkerThread.java:541)
    at com.ontotext.trree.replicationcluster.WorkerThread$3.call(WorkerThread.java:524)
    at com.ontotext.trree.replicationcluster.WorkerThread.execute(WorkerThread.java:966)
    at com.ontotext.trree.replicationcluster.WorkerThread.run(WorkerThread.java:322)
4
  • Could you please post what's the GraphDB and Elasticsearch versions? Commented Aug 3, 2021 at 15:48
  • GraphDB 9.2 and elasticsearch 7.14.0 but I have also tried with 7.3.1. Commented Aug 5, 2021 at 11:29
  • Is there any chance to report the inner exception of the exception containing the message "Unable to check if index exists", because it hides the root cause. Commented Aug 17, 2021 at 12:14
  • @vassil_momtchev please see above for the log. Commented Sep 2, 2021 at 13:49

1 Answer 1

1

If Elasticsearch is in a different network, try disabling cluster sniff:

{
  "elasticsearchClusterSniff": false,
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.