Faraday::ConnectionFailed: Connection refused - GitLab EE with elasticsearch
Elasticsearch is enabled in Admin settings with localhost:9200
I am trying to enable and use elasticsearch with GitLab. Elasticsearch is started, get this from localhost:9200,
{
"name" : "TTTTTT",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "tj4sads12P-_32432csad23",
"version" : {
"number" : "5.6.5",
"build_hash" : "6a37571",
"build_date" : "2017-12-04T07:50:10.466Z",
"build_snapshot" : false,
"lucene_version" : "6.6.1"
},
"tagline" : "You Know, for Search"
}
But when run the 1st command to start with gitlab-rake gitlab:elastic:create_empty_index following this guide https://docs.gitlab.com/ee/integration/elasticsearch.html:
rake aborted!
Faraday::ConnectionFailed: Connection refused - connect(2) for "::1" port 9200 (localhost:9200)
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/elastic/helper.rb:25:in `create_empty_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/elastic.rake:95:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Errno::ECONNREFUSED: Connection refused - connect(2) for "::1" port 9200 (localhost:9200)
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/elastic/helper.rb:25:in `create_empty_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/elastic.rake:95:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:elastic:create_empty_index
(See full trace by running task with --trace)
With trace:
** Invoke gitlab:elastic:create_empty_index (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute gitlab:elastic:create_empty_index
rake aborted!
Faraday::ConnectionFailed: Connection refused - connect(2) for "::1" port 9200 (localhost:9200)
/opt/gitlab/embedded/lib/ruby/2.3.0/resolv-replace.rb:25:in `initialize'
/opt/gitlab/embedded/lib/ruby/2.3.0/resolv-replace.rb:25:in `initialize'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:604:in `new'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:604:in `create_socket'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:749:in `block in connect'
/opt/gitlab/embedded/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
/opt/gitlab/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:742:in `connect'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:504:in `query'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:174:in `query'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:1240:in `do_get_block'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:1017:in `block in do_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:1131:in `protect_keep_alive_disconnected'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:1012:in `do_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:854:in `request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.12.2/lib/faraday/adapter/httpclient.rb:38:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.12.2/lib/faraday/rack_builder.rb:141:in `build_response'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.12.2/lib/faraday/connection.rb:386:in `run_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/transport/http/faraday.rb:23:in `block in perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/transport/base.rb:261:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/client.rb:131:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/actions/indices/exists.rb:46:in `block in exists'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/utils.rb:197:in `__rescue_from_not_found'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/actions/indices/exists.rb:45:in `exists'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/elastic/helper.rb:25:in `create_empty_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/elastic.rake:95:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `block in execute'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `execute'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/opt/gitlab/embedded/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:181:in `invoke'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:153:in `invoke_task'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `block (2 levels) in top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `block in top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:118:in `run_with_threads'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:103:in `top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:81:in `block in run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:179:in `standard_exception_handling'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:78:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/opt/gitlab/embedded/bin/rake:23:in `load'
/opt/gitlab/embedded/bin/rake:23:in `<top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Errno::ECONNREFUSED: Connection refused - connect(2) for "::1" port 9200 (localhost:9200)
/opt/gitlab/embedded/lib/ruby/2.3.0/resolv-replace.rb:25:in `initialize'
/opt/gitlab/embedded/lib/ruby/2.3.0/resolv-replace.rb:25:in `initialize'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:604:in `new'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:604:in `create_socket'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:749:in `block in connect'
/opt/gitlab/embedded/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
/opt/gitlab/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:742:in `connect'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:504:in `query'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient/session.rb:174:in `query'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:1240:in `do_get_block'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:1017:in `block in do_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:1131:in `protect_keep_alive_disconnected'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:1012:in `do_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2/lib/httpclient.rb:854:in `request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.12.2/lib/faraday/adapter/httpclient.rb:38:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.12.2/lib/faraday/rack_builder.rb:141:in `build_response'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.12.2/lib/faraday/connection.rb:386:in `run_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/transport/http/faraday.rb:23:in `block in perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/transport/base.rb:261:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/client.rb:131:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/actions/indices/exists.rb:46:in `block in exists'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/utils.rb:197:in `__rescue_from_not_found'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/actions/indices/exists.rb:45:in `exists'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/elastic/helper.rb:25:in `create_empty_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/elastic.rake:95:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `block in execute'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `execute'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/opt/gitlab/embedded/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:181:in `invoke'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:153:in `invoke_task'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `block (2 levels) in top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `block in top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:118:in `run_with_threads'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:103:in `top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:81:in `block in run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:179:in `standard_exception_handling'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:78:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/opt/gitlab/embedded/bin/rake:23:in `load'
/opt/gitlab/embedded/bin/rake:23:in `<top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:elastic:create_empty_index
which seems odd, unless there is something missing.
gitlab-rake gitlab:check returns this for elasticsearch:
Elasticsearch version 5.1 - 5.5? ... Exception: Connection refused - connect(2) for "::1" port 9200 (localhost:9200)
In elasticsearch.yaml, these are the enabled parameters:
script.inline: true
script.stored: true
network.host: 127.0.0.1
http.port: 9200