You are right, it works for me to.
So I've found my mistake. When I've tried to use option -Des.config
or -Des.path.config or -Des.config.path it stops searching templates
in -Des.path.home and not able to find it in -Des.config
or -Des.path.config or -Des.config.path. I've tried to specify different
paths here but not success.
The right combination in this case is:
-Des.path.home #application location
-Des.path.config=/another/etc/elasticsearch/config
-Des.config=/another/etc/elasticsearch/config/elasticsearch.json
dir -R etc/elasticsearch
etc/elasticsearch:
config logging.json
etc/elasticsearch/config:
elasticsearch.json templates
etc/elasticsearch/config/templates:
template_1.json
This is really trivial but without clear doc I've stuck with guessing of
this variables and paths.
среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:
It seems to be working fine for me.
~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--
2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--
6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index &&
echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}
Did you copy this file to all master-eligible nodes?
On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
Hi! Have anybody tried to load index settings template from file in
config/templates like described here
Elasticsearch Platform — Find real-time answers at scale | Elastic? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.
--