Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable elasticsearch 5.0 authentication?

I'm just start to use elasticsearch. Created an index with default settings (5 shards, 1 replica). I then indexed ~13G text files with the attachment plugin. As a result, it went very slow searching in Kibana Discover. However, searching in the console is fast:

GET /mytext/_search {   "fields": [ "file.name" ],   "query": {     "match": {       "file.content": "foobar"     }   },   "highlight": {     "fields": {       "file.content": {       }     }   } } 

To investigate why it's so slow, I installed X-Pack. The guide documentation seems not comprehensive, I didn't get to the security config.

The default install of elasticsearch don't have to be logged in, but it have to be logged in after installed X-Pack plugin. I'm confused with the security settings of elasticsearch, kibana, x-pack, do they share the user accounts whatever? After all, I get the authentication works by:

curl -XPUT -uelastic:changeme 'localhost:9200/_shield/user/elastic/_password' -d '{ "password" : "newpass1" }' curl -XPUT -uelastic:newpass1 'localhost:9200/_shield/user/kibana/_password' -d '{ "password" : "newpass2" }' 

Here comes the problem. I can't login using Java client with org.elasticsearch.plugin:shield. It's likely the latest version of the shield dependency (2.3.3) mismatched with the elasticsearch dependency (5.0.0-alpha).

Well, can I just disable the authentication?

From the node config:

GET http://localhost:9200/_nodes  "nodes" : {     "v_XmZh7jQCiIMYCG2AFhJg" : {         "transport_address" : "127.0.0.1:9300",         "version" : "5.0.0-alpha2",         "roles" : [ "master", "data", "ingest" ],         ...         "settings" : {             "node" : {                 "name" : "Apache Kid"             },             "http" : {                 "type" : "security"             },             "transport" : {                 "type" : "security",                 "service" : {                     "type" : "security"                 }             }, ... 

So, can I modify these settings, and the possible values are?

like image 632
Xiè Jìléi Avatar asked May 29 '16 10:05

Xiè Jìléi


People also ask

What is Xpack security in Elasticsearch?

X-Pack is an Elastic Stack extension that provides security, alerting, monitoring, reporting, machine learning, and many other capabilities. By default, when you install Elasticsearch, X-Pack is installed.


2 Answers

In a test environment I added the following option to elasticsearch.yml, and/or kibana.yml

xpack.security.enabled: false 
like image 192
Rob Avatar answered Sep 20 '22 00:09

Rob


assuming that your image name is elasticsearch. you can use id if you don't like name

if you run docker you can use this. go to bash in docker with command

docker exec -i -t elasticsearch /bin/bash 

then remove x-pack

elasticsearch-plugin remove x-pack 

exit docker

exit 

and restart docker image

docker restart elasticsearch 

Disclamer: Solution inspired by Michał Dymel

like image 27
Daniel Staleiny Avatar answered Sep 23 '22 00:09

Daniel Staleiny