Elastic search Service unavailable 503 #27072
Unanswered
northwestmike
asked this question in
Q&A
Replies: 1 comment 2 replies
-
UPDATE: Setup a user and role as per documentation and it worked. It appears that setting up security is mandatory, which is a good thing I just wasn't clear on it. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi ,
I'm running Mastodon 4.16 and am trying to get ready to for an upgrade to 4.2 . I was not previously running elastic search and decided that I should before the upgrade. I'm deploying elastic search on a separate VM as I'm not sure what kind of resources it will need.
I deployed elasticsearch 7 on its own Debian 11 machine, as per the Mastodon documentation. I also changed the following in the elasticsearch.yml:
network.host: 0.0.0.0
discovery.seed_hosts: ["0.0.0.0"]
I started the elasticsearch service and see it listening on TCP 9200. No firewall has been started.
I then changed the mastodon .env.production file with the following added:
ES_ENABLED=true
ES_HOST=[IP OF ELASTICSEARCH BOX]
ES_PORT=9200
ES_PRESET= single_node_cluster
ES_USER=
ES_PASS=
I restarted the all the Mastodon services. I then ran RAILS_ENV=production bin/tootctl search deploy
The command ends with this error:
ruby/2.7.0/gems/elasticsearch-transport-7.13.3/lib/elasticsearch/transport/transport/base.rb:218:in `__raise_transport_error': [503] {"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];"}],"type":"cluster_block_exception","reason":"blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];"},"status":503} (Elasticsearch::Transport::Transport::Errors::ServiceUnavailable)
To test connectivity I issued this command:
curl -XGET 'http://[IP OF ELASTIC SEARCH BOX]:9200'
I get this back:
{
"name" : "elastic",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "na",
"version" : {
"number" : "7.17.13",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "2b211dbb8bfdecaf7f5b44d356bdfe54b1050c13",
"build_date" : "2023-08-31T17:33:19.958690787Z",
"build_snapshot" : false,
"lucene_version" : "8.11.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
I have not implemented any security yet as I want to get it up and running and then harden it. Not sure what to try next, any help would be most appreciated.
Beta Was this translation helpful? Give feedback.
All reactions