Vitalii Paprotskyi
Vitalii Paprotskyi

Reputation: 389

How to connect to remote cluster?

In plugin head I'm connected to localhost

enter image description here

When I try to connect to another (http:://host_name:9200) cluster it gives me this "cluster health: not connected" How do I connect to remote cluster?

Upvotes: 1

Views: 3934

Answers (3)

jmoz
jmoz

Reputation: 8006

If you're using elasticsearch-head you can add auth user and pass to the url, then use the hostname and port in the connection box.

So access the plugin with a url like:

file:///Users/foo/elasticsearch-head/index.html?auth_user=foo&auth_password=bar

The index.html has some javascript that uses these variables for auth.

Also your browser should allow CORS so use an extension.

Upvotes: 0

Eyal.Dahari
Eyal.Dahari

Reputation: 770

You need to allow CORS in elasticsearch.yml. Try adding:

http.cors.enabled: true
http.cors.allow-origin: "/.*/" 
network.host: 0.0.0.0

It should show you head UI. Please note that you'll need to fine tune this configuration for production usage.

Hope I have managed to help!

Upvotes: 1

philipskokoh
philipskokoh

Reputation: 93

It seems that you are using default Elasticsearch configuration.

By default, Elasticsearch binds to localhost only. You can check your config in config/elasticsearch.yml. Set network.host in elasticsearch.yml to bind your node to a hostname or ip address. Check this documentation for more details:

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html

Upvotes: 1

Related Questions