Hi,
I'm using elastic 6.1 on CentOS 7. The server is a bit slow. When I try to create an index using this command:
curl -XPUT 'localhost:9200/user_activity?pretty' -H 'Content-Type: application/json' -d'
{
"settings" : {
"index" : {
"codec": "best_compression",
"number_of_shards" : 1,
"number_of_replicas" : 0,
"mapper.dynamic": false
}
},
"mappings" : {
"user_activity" : {
"_all": { "enabled": false },
"properties" : {
"timestamp": { "type": "date"},
"user_id": { "type": "integer"},
...
}
}
}
}
'
it apparently works, but the output is like this:
{
"acknowledged" : true,
"shards_acknowledged" : false,
"index" : "user_activity"
}
Then when I check index health, it's red:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
red open user_activity DVG88zczRB21G155LB0DTw 1 0
And I cannot insert any document. I couldn't find anyway to retry shard allocation. So I kept deleting the index and recreating it. The logs look like this:
[2018-01-30T09:39:45,434][INFO ][o.e.c.m.MetaDataDeleteIndexService] [U62E07S] [user_activity/PYM7qf52RVONyRYYNP_iug] deleting index
[2018-01-30T09:39:48,696][INFO ][o.e.c.m.MetaDataCreateIndexService] [U62E07S] [user_activity] creating index, cause [api], templates [], shards [1]/[0], mappings [user_activity]
[2018-01-30T09:39:48,697][INFO ][o.e.c.r.a.AllocationService] [U62E07S] Cluster health status changed from [YELLOW] to [RED] (reason: [index [user_activity] created]).
and then the same message:
{
"acknowledged" : true,
"shards_acknowledged" : false,
"index" : "user_activity"
}
Any idea how I can create the index?
Thanks