Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_default_ mapping not applied when using separate master/data nodes #4124

Closed
olimcc opened this issue Nov 7, 2013 · 0 comments
Closed

_default_ mapping not applied when using separate master/data nodes #4124

olimcc opened this issue Nov 7, 2013 · 0 comments

Comments

@olimcc
Copy link

olimcc commented Nov 7, 2013

In 0.90.6 and 0.90.5, default mappings will not be applied to newly created types if your cluster topology has separate master and data nodes.

Working case (all nodes are master/data eligible) with a two node cluster:

# create index 
curl -XPUT http://localhost:9200/test-index
# create _default_ mapping
curl -XPUT http://localhost:9200/test-index/_default_/_mapping -d'{"_default_": {"_timestamp": {"enabled": true}}}'
# verify contents
curl http://localhost:9200/test-index/_default_/_mapping
# >> {"_default_":{"_timestamp":{"enabled":true},"properties":{}}}

# add a new type
curl -XPUT http://localhost:9200/test-index/new-mapping/_mapping -d'{"properties": {"foo": "string"}}'
#verify contents have _default_ applied
curl http://localhost:9200/test-index/new-mapping/_mapping
# >> {"new-mapping":{"_timestamp":{"enabled":true},"properties":{}}}

Broken case (master/data nodes separate) with a two node cluster:

Set each node with appropriate settings:

# node1
node.master: true
node.data: false

# node2
node.master: false
node.data: true

The same set of commands yield a mapping with defaults applied:

curl -XPUT http://localhost:9200/test-index
curl -XPUT http://localhost:9200/test-index/_default_/_mapping -d'{"_default_": {"_timestamp": {"enabled": true}}}'
curl http://localhost:9200/test-index/_default_/_mapping
# >> {"_default_":{"_timestamp":{"enabled":true},"properties":{}}}

curl -XPUT http://localhost:9200/test-index/new-mapping/_mapping -d'{"properties": {"foo": "string"}}'
curl http://localhost:9200/test-index/new-mapping/_mapping
# >> {"new-mapping":{"properties":{}}}
@ghost ghost assigned kimchy Nov 8, 2013
@kimchy kimchy closed this as completed in 7fc4947 Nov 8, 2013
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants