Background
We embed elasticsearch into our web application, and then let Amazon EC2
control the startup or teardown of our server instances based on load
metrics. The exact same web app is used across all instances, therefore each
new instance brings a new elasticsearch node into existence.
I am trying to bulletproof some scenarios, and just want to ask what the
best practice might be for some of these situations.
Programmatic Index/Mapping Creation
We are currently defining our index settings in an elasticsearch.properties
file that we feed to our embedded ES node when we start it up. We store our
mapping files in a location that ES can find and the first time a document
is indexed by ES, the mapping files are read in and properly applied.
One problem, is the mapping files are not automatically loaded if the first
request to ES is a query. Is there a setting that can tell ES to load the
mapping files when the node is created?
At the moment we use the same index configuration across all of our
indicies. If we wanted to specify different index configurations per index,
would we have to resort to a programmatic creation of the indicies via an
API call?
If we switch to programmatic creation of index and mappings, am I right to
assume that this only has to happen on the first node to join the cluster
because subsequent nodes will inherit the cluster's configuration?
In the case of a node joining an existing cluster, do the default mappings
on disk or index configuration info in elasticsearch.properties have any
bearing on how that node functions with regards to mappings and indexes?