Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

head plugin vs shield #191

Closed
cello86 opened this issue Mar 20, 2015 · 19 comments
Closed

head plugin vs shield #191

cello86 opened this issue Mar 20, 2015 · 19 comments

Comments

@cello86
Copy link

cello86 commented Mar 20, 2015

Hi all,
I'm testing the shield plugin on my Elasticsearch cluster but after the installation the head plugin can't connect to the nodes, because it requires authentication.

Is it possible to configure the authentication on head?

Marello

@bbonnin
Copy link

bbonnin commented Apr 10, 2015

Hello,

I also use head with shield and in order to connect to the cluster, in the text box where you're setting the http address, I use the following syntax: http://username:password@localhost:9200.

Bruno

@nielsen-brian-p
Copy link

I'm having a similar issue - it was working fine, and all of the sudden i'm continually prompted by shield for the admin username and password I've set up (and is working!)

@nielsen-brian-p
Copy link

FYI - I did try bbonnin's idea, with no luck

@karlito40
Copy link

Same problem here

@derfloscher
Copy link

+1 same problem

@mobz
Copy link
Owner

mobz commented Sep 11, 2015

Have you guys tried setting authentication parameters as described here? https://github.com/mobz/elasticsearch-head#url-parameters

@karlito40
Copy link

Well, i tried again without any url parameters... and it is working now. 👍

I don't know why though

@rohitCloud
Copy link

still not working for me :(

@karlito40
Copy link

There is another solution if you are on aws.

Remove the shield plugin and create a security group for your elastic instances that only allows your ip and your other instances.

@kevin-lee
Copy link

Isn't there any proper solution yet?

I did what https://github.com/mobz/elasticsearch-head#url-parameters says but not sure if it's a correct way.

Mine is

http://localhost:9200/_plugin/head/index.html?base_uri=http://localhost:9200&auth_user=some_username&auth_password=some_password

and it doesn't work.

I have shield installed. Without shield there's no issue, but with it, I get cluster health: not connected.

@philipskokoh
Copy link
Collaborator

Check your elasticsearch.yml. * for http.cors.allow-origin is not allowed for credentialed requests.

@tgensol
Copy link

tgensol commented Oct 6, 2016

Same for me, It was working before I install shields, but now I only have : cluster health: not connected. I am using ES 2.3

@fgdgtz183
Copy link

fgdgtz183 commented Feb 13, 2017

@kevin-lee hi,I have shield installed and es-head not connected, you solution it yet?my es version is 2.4.3

@philipskokoh
Copy link
Collaborator

When you are using authentication, Ensure that you add http.cors.allow-headers: Authorization. (https://github.com/mobz/elasticsearch-head#basic-authentication)
Then specify auth_user and auth_password as url parameter
Check this guideline: https://github.com/mobz/elasticsearch-head#x-pack

@fgdgtz183
Copy link

@philipskokoh I did it,but still failed . my elasticsearch.yml config http.cors.enabled: true .http.cors.allow-origin: "*". http.cors.allow-headers: Authorization network.host:0.0.0.0 and url is http://xxx.xx.xx.x:9200/_plugin/head/index.html?base_url=http://xxx.xx.xx.x:9200/?auth_user=elastic&auth_password=changeme

@philipskokoh
Copy link
Collaborator

philipskokoh commented Feb 14, 2017

Hi @fgdgtz183,
I think there's no default elastic user in shield for elasticsearch 2.4.x. You need to add your first shield user through command line. Follow this guideline:
https://www.elastic.co/guide/en/shield/current/enable-basic-auth.html

Assume your new shield user is es_admin, and the password is es_admin_password,
if you can get response for curl -XGET 'http://es_admin:es_admin_password@localhost:9200', then you should be able to access your cluster for elasticsearch-head. I just tested this case on elasticsearch-2.4.0.

I also notice that _stats on this elasticsearch version may return unexpected error message (HTTP response 404), if you have no indices in your cluster. So if you cluster is new and you haven't created a new index, create one new index using
curl -XPUT 'http://es_admin:es_admin_password@localhost:9200/test'

@fgdgtz183
Copy link

hi @philipskokoh
I created an admin user in shield,curl -XGET 'http://es_admin:es_admin_password@localhost:9200,it is working,but es-head not.

At first ,i was using es-head as a plugin of Elasticsearch and open http://localhost:9200/_plugin/head/,It needs to enter a user name and password,but the head plugin can't connect to the nodes,then i remove the head plugin,i tried it running with built in server and specify auth_user and auth_password as url parameters :
http://localhost:9100/?auth_user=es_admin&auth_password=es_admin_password /,still not working for me .

@philipskokoh
Copy link
Collaborator

This is my setting to replicate your issue:

  1. config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: '*'
http.cors.allow-headers: Authorization
  1. Shield installed, and then I add a user called es_admin with password es_admin.

  2. Elasticsearch is running as standalone server. I connect to the cluster using via this url:
    localhost:9100/?base_uri=http://localhost:9200&auth_user=es_admin&auth_password=es_admin

@fgdgtz183
Copy link

@philipskokoh
it is working now,beacause my cluster is new and no any indices. thanks for your notice. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests