I'm trying to upgrade an existing server and all seems well at this point except Elasticsearch.
An observation:
A few documents (e.g.) assume Elasticsearch is listening on localhost - that doesn't seem to be the case with a default Monolith install. Mine is listening on the external ethernet adapter address, e.g. I can list indexes with curl -X GET "http://10.3.0.4:9200/_cat/indices" but not curl -X GET "http://localhost:9200/_cat/indices"
That aside, I'm having trouble in general with elasticsearch scripts. I'm trying to rebuild the scripts - I tried following this: Elasticsearch — CommCareHQ 1.0 documentation
I'm able to delete all indexes with curl -X DELETE http://10.3.0.4:9200/*
Any attempts to recreate indexes results in an error on the elasticsearch section:
I get similar errors from running ./manage.py elastic_sync_multiplexed start ${INDEX_CNAME} as per changelog 75:
The errors that you linked in the Pastebin are because of the incompatible mappings. As you have seen in the changelog we are upgrading to ES5 so the mapping present in the latest code reflects the ES 5 mappings which are not compatible with ES2.
In the recent past we have updated how we would be managing the mappings on our environment. We are using django migrations to manage them. When you deleted all the indexes it messed up the situation a bit. Now you can create indexes with the current mappings on ES5. Although the migrations contain the information of the state, they can’t be applied again because as per django the mappings are already applied.
If you have backup of the ES2 data including all indexes that were deleted we would recommend to use that backup and get back to the last known good ES2 state.
If not, our recommendation is to upgrade to ES 5 and then populate the indexes.
You can follow the process outlined below, the following steps assume that then environment name is monolith and elasticsearch host is http://10.3.0.4:9200 based on the details shared on the question -
Login to control machine, replace with your environment name
commcare-cloud monolith ssh control
Pull the latest changes
git pull origin master
Start downtime
commcare-cloud monolith downtime start
Update environments/monolith/public.yml with following values
Amit, thank you for the response, I have the original server with the ES 2 data structure intact so I have options. Thanks for the explanation, that makes sense. I'll try these suggestions and provide feedback,
Cheers