Hi,
I have a 5 node cluster. 3 ingestion nodes, 1 coordinator node and a cold node. All ingestion goes via my Logstash server and the output of each index is dated as so:
elasticsearch {
index => "firewall-traffic-%{+YYYY.MM.dd}"
hosts => [10.10.100.1, 10.10.100.2,10.10.100.3]
}
Everything works and has been for some time. I'm now looking at moving indices to the cold storage node. As I'm running 7.4.0 accross the board, I'm using Kibana's index management features to set up ILM. So using the above example, I have an index named:
firewall-traffic-2019.11.20
I've set up a few index templates trying to keep the tasks seperate for ease of altering anything in the future. So I have the default wildcard (*) index template that applies to all incoming indexes and sets up the number of replicas as so:
{
"index": {
"number_of_replicas": "2"
}
}
This works fine and allocates the index to 3 ingest nodes.
The next in the processing line is the index template that ensures the indexes are placed on the host nodes and not the cold node. This template is applied to each index (I add new ones as I find something new to ingest):
{
"index": {
"routing": {
"allocation": {
"include": {
"data": "hot"
}
}
}
}
}
Again, this works as expected.
Next is my index template that I have set up specifically for this firewall index so that I can apply specific settings to this index. Currently it has no settings/mappings applied to it.
Now I set up my ILM with a rollover at 50GB or 7 days. I skip the warm phase and set up the Cold phase, assign the cold node and ensure it is pointing at the cold node. Number of replicas are reduced to zero and timing for cold phase is set to 1 hour from rollover. Finally, deletion is set for 365 days after rollover. I name it Hot2Cold
Now this is where I'm struggling. I open up the ILM list and assign the ILM policy Hot2Cold to the firewall-traffic index template. I'm asked for the alias for rollover index - I've tried all sorts here to get this to work but for the sake of explaining the problem, I enter "firewall_rollover".
This changes the settings of the firewall-traffic index template to:
{
"index": {
"lifecycle": {
"name": "50GB_move_to_cold",
"rollover_alias": "firewall_rollover"
}
}
}
Now I'm expecting to see the index moved to the cold node after it hits 50GB or is 7 days old with the name "firewall_rollover" appended to it somewhere. Instead, within the 10 minute default timeframe for Elastic checking the index to see if it needs moving, I get the error message:
illegal_argument_exception: index.lifecycle.rollover_alias [firewall-traffic] does not point to index [firewall-traffic-2019.11.20]
So, from this error message, I'm assuming it, as it says, is missing an alias so I check:
GET _alias
This shows the following:
{
".kibana_1" : {
"aliases" : {
".kibana" : { }
}
},
"userinfo" : {
"aliases" : { }
},
".kibana_task_manager_1" : {
"aliases" : {
".kibana_task_manager" : { }
}
},
".apm-agent-configuration" : {
"aliases" : { }
},
".monitoring-kibana-7-2019.11.20" : {
"aliases" : { }
},
"firewall-traffic-2019.11.20" : {
"aliases" : { }
},
".monitoring-es-7-2019.11.20" : {
"aliases" : { }
},
".monitoring-logstash-7-2019.11.20" : {
"aliases" : { }
},
"nps-2019.11.20" : {
"aliases" : { }
}
}
So clearly the alias I have given has not been added to this system index in Elastic & tied to the "firewall-traffic-2019.11.20" index.
The thing I'm missing is that I can't see how or where I configure Elasticsearch to update it's aliases. I do know that on another test stack we have, using winlogbeat pushing directly into elasticsearch, we don't see this issue. The alias for the winlogbeat indices is updated and the moving off to the cold node seems to work well. The aliases seem to be added here on the fly as the new daily indices are created.
Can someone point out what I'm missing? There is obvioulsy a simple way to do this that I'm missing. I'm guessing that I need to add additional info to the output of Logstash so that an alias is created at the time of ingestion but I've not found anything that points to that.