I am using two Elastiflow instances with Docker, sharing the same configuration, and a Virtual IP (VIP) that migrates between the two instances.
When the VIP migrates, I encounter an error: “An index exists with the same name as the alias.”
I understand that I can use OUTPUT_OPENSEARCH_INDEX_SUFFIX to differentiate the index names, but I would prefer to keep all Netflow data in the same index.
Is there a way to achieve this, or is using a suffix the only solution to this problem?
Hi, thanks for your attention. Here is the full error:
{“level”:“error”,“ts”:“2025-01-21T15:03:39.611Z”,“logger”:“bootstrapper[opensearch]”,“caller”:“opensearch/bootstrap.go:125”,“msg”:“failed to bootstrap opensearch. retrying…”,“code”:“opensearch/bootstrap-failure”,
“reason”:"error while creating write indices: error creating write index: error inserting index ‘elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover-000001’:
error creating index: {"index":"elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover","index_uuid":"W595hKMzSLWd6X-M89AyPA","reason":
"Invalid alias name [elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover], an index exists with the same name as the alias","root_cause":[{"index":
"elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover","index_uuid":"W595hKMzSLWd6X-M89AyPA","reason":
“Invalid alias name [elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover], an index exists with the same name as the alias",
"type":"invalid_alias_name_exception"}],"type":"invalid_alias_name_exception"}”,“stacktrace”:“github.com/elastiflow/flowcoll/pkg/outputs/opensearch.
(*Bootstrap).Run\n\t/app/pkg/outputs/opensearch/bootstrap.go:125\ngithub.com/elastiflow/flowcoll/pkg/outputs/opensearch.NewInstantiatorRegistration.newCreateInstanceFunc.
func1\n\t/app/pkg/outputs/opensearch/instance_registration.go:159\ngithub.com/elastiflow/go-env-conf/instantiator.(*Instantiator).Run\n\t/go/pkg/mod/github.com/elastiflow/go-env-conf@v0.8.6/
instantiator/instantiator.go:78\ngithub.com/elastiflow/flowcoll/pkg/apps/unified_flowcoll.(*App).Run\n\t/app/pkg/apps/unified_flowcoll/app.go:156\nmain.main\n\t/app/cmd/flowcoll/main.go:108
\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:271”}
{"level":"error","ts":"2025-01-21T15:03:39.611Z","logger":"bootstrapper[opensearch]","caller":"opensearch/bootstrap.go:125","msg":"failed to bootstrap opensearch. retrying...","code":"opensearch/bootstrap-failure",
"reason":"error while creating write indices: error creating write index: error inserting index 'elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover-000001':
error creating index: {\"index\":\"elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover\",\"index_uuid\":\"W595hKMzSLWd6X-M89AyPA\",\"reason\":
\"Invalid alias name [elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover], an index exists with the same name as the alias\",\"root_cause\":[{\"index\":
\"elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover\",\"index_uuid\":\"W595hKMzSLWd6X-M89AyPA\",\"reason\":\
"Invalid alias name [elastiflow-flow-ecs-8.0-2.4-netflow-logs-rollover], an index exists with the same name as the alias\",
\"type\":\"invalid_alias_name_exception\"}],\"type\":\"invalid_alias_name_exception\"}","stacktrace":"github.com/elastiflow/flowcoll/pkg/outputs/opensearch.
(*Bootstrap).Run\n\t/app/pkg/outputs/opensearch/bootstrap.go:125\ngithub.com/elastiflow/flowcoll/pkg/outputs/opensearch.NewInstantiatorRegistration.newCreateInstanceFunc.
func1\n\t/app/pkg/outputs/opensearch/instance_registration.go:159\ngithub.com/elastiflow/go-env-conf/instantiator.(*Instantiator).Run\n\t/go/pkg/mod/github.com/elastiflow/go-env-conf@v0.8.6/
instantiator/instantiator.go:78\ngithub.com/elastiflow/flowcoll/pkg/apps/unified_flowcoll.(*App).Run\n\t/app/pkg/apps/unified_flowcoll/app.go:156\nmain.main\n\t/app/cmd/flowcoll/main.go:108
\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:271"}
The EF_OUTPUT_OPENSEARCH_INDEX_TEMPLATE_ENABLE option enables the writing of templates for Opensearch templates. You may want to enable that option in only one of your collectors, or set the EF_OUTPUT_OPENSEARCH_INDEX_TEMPLATE_OVERWRITE to true on one collector and false on the other.
The other option, as you mentioned, is to use the suffix option, which is what many people running more than one collector do. This helps to keep the data separate and allows each collector to manage its own index templates.
Thanks very much, it works perfectly now with adding EF_OUTPUT_OPENSEARCH_INDEX_TEMPLATE_ENABLE and EF_OUTPUT_OPENSEARCH_INDEX_TEMPLATE_OVERWRIT set to true in one collector and set to false on the other one.