I just ran into this problem, and none of the received answers resolved it, the answer accepted received the wrong property, which
spring.data.elasticsearch.properties.path.data=/path/to/data
not
spring.data.elasticsearch.properties.data.path=/path/to/data
Although you will have a problem with this value because you are writing to the root directory of your computer (in my Mac), which needs permissions that I cannot grant so that the elasticsearch template does not start, instead you need to set the value
spring.data.elasticsearch.properties.path.data=path/to/data
This will create a path from the context of your application, which is the root directory of your project, which the application already has write permissions to.
source share