Problem when running elastic search on windows 10 - elasticsearch

when i am running elastic search on windows 10 , i can not open elastic portal in the local host and i got this message :
{
"name" : "ISBUS-PC02",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "FE38HTACR2evmiVFD7ciag",
"version" : {
"number" : "8.6.0",
"build_flavor" : "default",
"build_type" : "zip",
"build_hash" : "f67ef2df40237445caa70e2fef79471cc608d70d",
"build_date" : "2023-01-04T09:35:21.782467981Z",
"build_snapshot" : false,
"lucene_version" : "9.4.2",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
nothing, because this is the last issue i stucked on.

This JSON you provided means Elasticsearch is up and running perfectly fine. You can note in the JSON response, Elasticsearch cluster name, version, build type and other information is also provided.
{
"name": "ISBUS-PC02",
"cluster_name": "elasticsearch",
"cluster_uuid": "FE38HTACR2evmiVFD7ciag",
"version":
{
"number": "8.6.0",
"build_flavor": "default",
"build_type": "zip",
"build_hash": "f67ef2df40237445caa70e2fef79471cc608d70d",
"build_date": "2023-01-04T09:35:21.782467981Z",
"build_snapshot": false,
"lucene_version": "9.4.2",
"minimum_wire_compatibility_version": "7.17.0",
"minimum_index_compatibility_version": "7.0.0"
},
"tagline": "You Know, for Search"
}
You don't have to worry, your Elasticsearch cluster is up and running and you can execute other requests.

Related

Could not validate a connection to Elasticsearch. Unknown 401 error from Elasticsearch null

{
"name" : "DESKTOP-BNTBBBG",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "DlRfjfPlRg69wUBRfy3kKQ",
"version" : {
"number" : "8.1.3",
"build_flavor" : "default",
"build_type" : "zip",
"build_hash" : "39afaa3c0fe7db4869a161985e240bd7182d7a07",
"build_date" : "2022-04-19T08:13:25.444693396Z",
"build_snapshot" : false,
"lucene_version" : "9.0.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
But When running this command
php bin/magento setup:install --base-url="http://versionup.magento.com" --db-host="localhost" --db-name="magento2" --db-user="magento2" --db-password="magento2" --admin-firstname="admin" --admin-lastname="admin" --admin-email="user#example.com" --admin-user="admin" --admin-password="Admin#123456" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch7 --elasticsearch-host="localhost" --elasticsearch-port=9200
Could not validate a connection to Elasticsearch. Unknown 401 error from Elasticsearch null
i have the same problem, but now it's fixed.
make sure you enable xpack.security.http.ssl on elasticsearch.yml. because I disable it before.
then change the host to:
--elasticsearch-host="https://localhost"
then add more options to your command for authentication:
--elasticsearch-enable-auth=true --elasticsearch-username="elastic" --elasticsearch-password="your password"

Basic authentication with hey tool fails

I have an elasticsearch cluster which I can hit as follows:
▶ curl -k https://localhost:9200 -u username:password
{
"name" : "elasticsearch-sample-es-master-1",
"cluster_name" : "elasticsearch-sample",
"cluster_uuid" : "XXXXXXXXXXXXXXXXXXX",
"version" : {
"number" : "7.11.0",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "8ced7813d6f16d2ef30792e2fcde3e755795ee04",
"build_date" : "2021-02-08T22:44:01.320463Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
(I have port-forwarded the service locally)
However when hitting it with hey
hey https://localhost:9200 -a username:password
Status code distribution:
[401] 200 responses
Any ideas?
You can try the following
hey https://username:password#localhost:9200
That works!
Note: There are open issues in the official hey repository, https://github.com/rakyll/hey/issues/150

How change global elasticsearch index creation setting?

OS: #1 SMP Debian 4.19.152-1 (2020-10-18)
Install elastic by this tutorial https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html:
{
"name" : "web",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "HSeOQvkHRey2P_JN2Nv-GA",
"version" : {
"number" : "7.10.0",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "51e9d6f22758d0374a0f3f5c6e8f3a7997850f96",
"build_date" : "2020-11-09T21:30:33.964949Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
How globally change some index creation options https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html?
Such as index.max_ngram_diff as example?
You need to use the index update settings API:
PUT your-index/_settings
{
"index.max_ngram_diff": 2
}
If you want this setting to be applied on index that are going to be created in the future, you can create an index template that will be applied to the matching future indexes:
PUT /_index_template/template_1
{
"index_patterns" : ["my-index-*"],
"priority" : 1,
"template": {
"settings" : {
"index.max_ngram_diff" : 2
}
}
}
After that, every time that you create a new index whose name matches my-index-*, that new index will get the settings set in the template.
I will recommend to use Index templates for this. You can preconfigure template with settings you need, and use on index creation.

X-Pack 401 Logstash cant connect to Elasticsearch

I changed JVM heap sized and Logstash cant connect to Elasticsearch, after restarting Elasticsearch
logstash.yml
xpack.monitoring.enabled: true
xpack.monitoring.elasticsearch.hosts: ["es:9200"]
xpack.monitoring.elasticsearch.username: logstash_system
xpack.monitoring.elasticsearch.password: pass
logs by Logstash
[WARN ][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://es:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=>"Got response code '401' contacting Elasticsearch at URL 'http://es:9200/'"}
curl from logstash to es with same credentials
logstash: curl -ulogstash_system es:9200
Enter host password for user 'logstash_system':
{
"name" : "elasticsearch",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "",
"version" : {
"number" : "7.5.0",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "",
"build_date" : "2019-11-26T01:06:52.518245Z",
"build_snapshot" : false,
"lucene_version" : "8.3.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

Elasticsearch showing error 406 when inserting

Just installed ElasticSearch on my mac (brew install elasticsearch).
Then started it with: brew services start elasticsearch.
I can see it is running:
curl localhost:9200
{
"name" : "84ucGje",
"cluster_name" : "elasticsearch_dnk306",
"cluster_uuid" : "yU6wdZpJT_-1OvaFf7l7Ug",
"version" : {
"number" : "6.5.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "816e6f6",
"build_date" : "2018-11-09T18:58:36.352602Z",
"build_snapshot" : false,
"lucene_version" : "7.5.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
When I try to add some index to it - it fails with 406 error:
curl -XPOST localhost:9200/test/1 -d '{"title":"Hello world"}'
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
What do I need to do to make this work?
Thanks.

Resources