How to connect an Elasticsearch server with username and password?

Hi,

How to connect a remote elasticsearch server with username and password?

I set ‘elasticsearch.username’ and ‘elasticsearch.password’ in investigate.yml, and set ‘elasticsearch.ssl.virificationMode’'s value to none.

When I start Investigate Server and login the Siren, an error occurrs, showing “could not retrieve virtual indices(401): Authentication finally failed”, the line no is 35 in siren_core_plugins.jdbc_api.index.js.

My siren version is 10.2.4, and i wanna know how to slove it?

Is there any step that missing? or the way i connect the ES server is not proper?

Looking forward to your reply.

Hagen Han

Hello hagen666,
Do you have correct username and password? And have you configured Searchguard (Assuming you’re using Searchguard)? You may check it by running (In terminal):
curl -XGET -k -u ${elasticsearch.username}:${elasticsearch.password} https://localhost:9220
Make sure to replace the use the username and password you’re using in Investigate.yml

  • If you get a response like: Search Guard not initialized (SG11). See http://docs.search-guard.com/v6/sgadmin
    Then refer to Search Guard integration docs.
  • Or, if you get a response like:
{
  "name" : "ntu7c_T",
  "cluster_name" : "siren-distribution",
  "cluster_uuid" : "qwtsEymJSyWy-yK4Dq_v3A",
  "version" : {
    "number" : "6.8.0",
    "build_flavor" : "oss",
    "build_type" : "tar",
    "build_hash" : "65b6179",
    "build_date" : "2019-05-15T20:06:13.172855Z",
    "build_snapshot" : false,
    "lucene_version" : "7.7.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
  • Then run: curl -XGET -k -u ${elasticsearch.username}:${elasticsearch.password} http://localhost:9220/_siren/connector/index/_search?pretty. And tell us what error you get.

Regards,
Varun

Thank you for your reply. I solved it successfully now.
After reading the docs in https://siren.io/browsing-neo4j-data-with-siren-10-2/, I try to use the neoNode
plugin to import data. The problem is my elasticsearch server has username and password, and i don’t know how to put the credential information.
Is there any method to put my username or password? and can i set the verificationMode(like siren federate) to none?

Hagen Han

The error message is that: “unable to get local issure certificate”,and i also don’t know how to put my ES username and password into the neoNode plugin.

Now, it seems that i solved the problem. By editing app.js and node-fetch.lib.index.js.

Thank you all the same.


It seems that the the problem hasn’t been solved yet. After creating entity in Siren, the NeoNode try to connect the Siren and editing the data, which need siren’s authentication. How to solve it?