Opensearch: connection error 401

ihb
ihb Partner, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 7 Partner
edited July 16 in Setup & Configuration

Hi all,

We have Opensearch setup in a cluster and when I try to setup a connection to it from Dataiku, I get the error

Connection Error: Server didn't answer 200 but 401: Unauthorized

I have tried all the possible dialects but I still get the same error.

Is it not possible to use the Dataiku Elastic search driver to connect to opensearch or is there an issue with our setup?

I can connect to Opensearch from the Dataiku host using curl

curl https://myopensearch.com -u user:password 
{
  "name" : "opensearch-cluster-master-0",
  "cluster_name" : "opensearch-cluster",
  "cluster_uuid" : "****",
  "version" : {
    "distribution" : "opensearch",
    "number" : "2.4.0",
    "build_type" : "tar",
    "build_hash" : "744ca260b892d119be8164f48d92b8810bd7801c",
    "build_date" : "2022-11-15T04:42:29.671309257Z",
    "build_snapshot" : false,
    "lucene_version" : "9.4.1",
    "minimum_wire_compatibility_version" : "7.10.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "The OpenSearch Project: https://opensearch.org/"
}

Opensearch version: 2.4.0

Dataiku version: 11.1.1


Operating system used: Linux

Tagged:

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,090 Neuron

    Hi, I will suggest you use the OpenSearch low level Python client to connect from Dataiku. You will need to install the opensearch-py package in the Python code environment. Then either use Jupyter Notebook or a Python Recipe. There are some good examples in the OpenSearch low level Python client documentation:

    https://opensearch.org/docs/2.4/clients/python-low-level/

    The OpenSearch low-level Python client (opensearch-py) provides wrapper methods for the OpenSearch REST API so that you can interact with your cluster more naturally in Python. If you need to expose this system wide you could develop a Dataiku Python plugin.

  • ihb
    ihb Partner, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 7 Partner

    Hi Turribeach,

    Thank you very much for the workaround. Does this mean that the Dataiku Elastic search connector is not compatible with Opensearch? It would be nicer to be able to create datasets from Opensearch and to have the additional features and recipes, I would also prefer to not create Opensearch users for my Dataiku users.

Setup Info
    Tags
      Help me…