How many Wazuh indexer shards and replicas do you need?
Shard and replica counts decide how alert data spreads across indexer nodes, how the cluster tolerates a node failure, and how much storage it consumes. You are making this decision because alert volume, node count or resilience requirements are changing, and you need to set shard and replica counts for wazuh-alerts-* indices. The Wazuh indexer is the full-text search and analytics engine that stores those alerts, and its shard layout is hard to change once data is written. Before you touch any setting, check the Wazuh documentation for the 4.14 release line for the default shard and replica values and the index templates it installs, because your cluster may already run with values you did not choose.
The right numbers depend on three inputs: how many data nodes you run, how much alert data you expect per day, and how long you keep it. A common starting point is to keep the primary shard count a sensible multiple of the data node count so shards distribute evenly, but the exact target depends on your own indexing rate and shard sizes. Replicas add a second copy of each shard. One replica lets the cluster survive the loss of a node holding primaries, but it roughly doubles the storage each index occupies. Ask your team to write down the failure you are designing for, such as a single node outage during business hours, and calculate the storage that choice implies for your retention period before you settle on a number.
Plan the change as a one-way decision. Primary shard count cannot be altered on an existing index, so a different count means creating a new index and re-indexing the data, which is covered in the reindexing section. Replica count can be changed on a live index, which makes it the lower-risk lever. Confirm with your own test cluster, using indices of realistic size, how long shard allocation takes and whether the nodes have enough disk headroom to hold the extra copies during rebalancing. Record the decision and the reasoning so the next person who adds a node knows why the layout looks the way it does.
Where the indexer sits among the four Wazuh components
Wazuh splits its work across four components, and only one of them stores the data that shard planning must size. The other three decide how much data arrives, how fast it is written and how often it is queried, so each card below explains what that component means for the indexer.
Wazuh indexer
The indexer is where alerts are stored and searched, so every shard and replica decision lands here. Its indices hold the alert documents the server writes and the dashboard reads. Before sizing, confirm how many nodes you will run, how many primary shards each index gets and how many replicas you need, because these choices are hard to change later without re-indexing.
- In the Wazuh stack
- 4 components
Wazuh server
The server decodes and analyzes agent data with decoders and rules, and the alerts it produces are what the indexer stores. Its rule set and log sources therefore set the daily document count that drives shard size. Check which log sources you forward and how many rules fire on them, since noisy rules inflate index volume without adding security value.
Components docsWazuh dashboard
The dashboard is the web interface that queries the indexer, so it adds read load rather than new data. Wide time ranges, broad searches and many concurrent analysts can slow shard searches on busy indices. Ask how many people will query historical data at once and whether dashboards default to short time windows, because that affects how many replicas help with search throughput.
Wazuh agents on endpoints
Agents collect events and software inventory from endpoints, and the volume they generate is the main input to indexer sizing. Vulnerability detection correlates each agent's software inventory with vulnerability data, so more monitored hosts and more installed packages mean more documents. Inventory the number of endpoints and their operating systems before choosing shard counts, and confirm how many events per agent you expect.
Vulnerability detection docsClustered Wazuh server
The server can run as a cluster for horizontal scaling, which spreads agent connections and analysis across more servers. This raises ingest throughput, but the indexer still receives the same alert documents and keeps the same shard layout. Do not assume that adding server nodes fixes indexing pressure. Plan indexer nodes and shards separately from server capacity, and confirm with the vendor how cluster nodes write to the indexer.
How alerts flow from agents into indexer shards and replicas
The diagram starts at Wazuh agents on endpoints, which send events to the Wazuh server for decoding and rule analysis. The server writes resulting alerts to the Wazuh indexer, which spreads each index across primary shards and replica shards on different nodes. The dashboard queries the indexer for search. If one indexer node is lost, replica copies on surviving nodes keep alert data available, so check the allocation behavior for your deployed version in the Wazuh documentation.
Agent events flow through the server into indexer shards, with replicas providing availability.
Shard and replica choices and when each fits
This table compares the main indexing decisions for Wazuh indices: primary shards, replicas, index granularity and single-node layouts. Read the columns to see what each choice does, what it costs in storage and cluster overhead, and whether it can be changed later or needs re-indexing. The main takeaway is that primary shard count is fixed when an index is created, so it deserves the most planning time.
| Decision | What it does and what it costs | When it fits and whether it can change later |
|---|---|---|
| Primary shard count per index | Splits one index across several shards so work spreads over data nodes. Each shard adds overhead in cluster state, memory and search fan-out, so too many small shards waste resources. | Fits when index size and node count are known in advance. Fixed at index creation, so changing it requires re-indexing into a new index. |
| Replica count per index | Stores extra copies of each primary shard. Each replica adds storage and indexing work, and it lets the cluster serve reads and survive node loss. | Fits multi-node clusters where losing a node must not lose alerts. Adjustable on existing indices, but it consumes storage immediately. |
| Index rollover or per-period indices | Splits alert data into smaller indices by time or size so old data can be moved, closed or deleted in bulk. Adds index management work and more index objects to track. | Fits long retention and tiered storage. Rollover behavior is set by policy and can be adjusted, but existing indices keep their original shard counts. |
| Single node with zero replicas | Keeps one copy of every shard on one node. Lowest storage and overhead, but no copy survives a disk or node failure, and the cluster reports yellow or red health when replicas are expected. | Fits lab, proof-of-concept or small deployments where alerts can be rebuilt from agents or backups. Replicas can be added later once a second node exists. |
| Multi-node cluster with one or more replicas | Distributes primaries and replicas across nodes so shard copies sit on different machines. Storage and network traffic grow with each added copy. | Fits production environments with alert-retention or availability requirements. Confirm the replica count and node count together, since replicas need room to be placed on other nodes. |
Why changing the shard count means re-indexing
The number of primary shards in an index cannot be changed in place once the index exists. OpenSearch-based indexers route each document to a primary shard by hashing its routing value and taking the remainder against the primary shard count, so the count is baked into where every existing document lives. Changing it means the data has to be written again into a new index that has the layout you want, and the old index is then retired or aliased to the new one. For the Wazuh indexer, this affects the wazuh-alerts-* and wazuh-archives-* indices your team plans, so the shard decision belongs in the design phase rather than after a year of alerts have accumulated.
Operationally, a re-index is a copy job that runs alongside live ingestion. Alerts keep arriving, so the plan has to decide how new data is written during the copy, which alias the dashboard and API queries use, and how the cutover avoids a gap or duplicate results in alert search. Copy time grows with index size, so ask whether your largest indices are small enough to finish within a maintenance window or whether you need to change the write target first. Confirm these details with your own sizing and the current Wazuh documentation before you commit to a shard count, because the procedure depends on your indexer version and on how your dashboards and integrations address indices.
Adding nodes is a separate operation. New indexer nodes join the cluster and receive shards through allocation and rebalancing, but that does not change the primary count of an existing index, so a larger cluster can still be under-used if the indices were created with too few shards. The sibling topic on adding indexer nodes and rebalancing shards covers certificates, cluster settings and reallocation. For the re-indexing procedure itself, including how to keep alert search available during the work, see the topic on reindexing Wazuh indices.
Matching shards to nodes by deployment size
A single-node Wazuh indexer is common in test and lab environments. With one node, every primary shard lives on that node, and there is nowhere for a replica to go. Index replicas therefore stay unassigned and the cluster reports a yellow status, even though all data is searchable. Shard count still matters for learning how the cluster behaves, but the goal is simplicity rather than spreading load.
- Allocation: All primaries sit on the one node, so the shard count does not change where data lives. Choose counts that match the data volume you expect in production, not the default you happened to get.
- Replicas: Replicas cannot protect data on a single node. Setting replicas above zero only produces unassigned shards and a warning. Set replicas to zero if you want a clean status for the lab.
- Growth: Adding a node later makes replicas assignable, but changing the primary shard count of an existing index requires re-indexing, so plan counts before loading data.
- Limits: A lab that mirrors production data volume will show disk and heap pressure long before shard placement matters. Test with realistic retention settings.
Before relying on the lab for test results, confirm the cluster health, the unassigned shard count and the shard size for each index against the sizing guidance in the Wazuh documentation.
A small cluster with two or three indexer nodes lets replicas sit on a second node, so a single node loss does not remove data. The planning question shifts to whether primaries and replicas spread evenly, and whether one node ends up holding a disproportionate share of data. Uneven shard counts across nodes are the most common cause of a hot node in this layout.
- Allocation: Choose primary shard counts that divide evenly or nearly evenly across the number of data nodes, so each node carries a similar number of shards.
- Replicas: One replica per primary is the usual resilience setting at this size. Each replica must land on a different node from its primary, which means at least two data nodes are required for replicas to be assigned.
- Failure tolerance: With one replica, the cluster can survive a single node loss without losing indexed alerts. Confirm that the cluster can still hold its data on the remaining nodes before you rely on this.
- Storage: Replicas roughly double the stored data for each index. Count that cost against disk capacity on every node, not only the total.
After deployment, check that replicas are assigned, that shards are evenly distributed across nodes and that disk watermarks are not close to their thresholds.
A larger cluster may use dedicated data nodes, separate hot and warm tiers, or nodes with different disk and memory profiles. Shard planning then has to respect node attributes and tier boundaries, so that new indices land on the intended hardware and older indices move without becoming unassigned. The same principle applies, but the number of constraints grows.
- Allocation: Derive shard counts from the number of nodes in each tier that will hold the index. A count that spreads evenly across hot nodes may not spread evenly across a smaller warm tier.
- Replicas: Replica counts can differ between hot and warm data. Reducing replicas on older data saves storage, but it also reduces the failure tolerance for that data, so decide per tier and document the trade-off.
- Tier moves: When indices move between tiers, shard allocation rules and replica changes can leave shards waiting to relocate. Plan for that movement time and watch relocation progress.
- Growth: Adding nodes helps only if shard counts allow the new nodes to receive shards. Adding capacity to an index with too few primaries may not reduce load, and fixing that means re-indexing.
After deployment, verify allocation rules per tier, relocation status, and whether each tier holds the data you intended.
Replicas buy resilience at the cost of storage
Each replica is a full copy of its primary shard, so every replica you add raises the storage an index consumes by roughly the same proportion and adds write work, because each indexed alert must be written to the primary and then to every replica. A setting of one replica doubles the stored data for an index, and a setting of two triples it. Before you choose a replica count, confirm the storage headroom on each indexer node with your own index sizes, and check how the replica count interacts with the number of nodes you run. A replica cannot live on the same node as its primary, so a replica count higher than the number of other nodes leaves some replicas unassigned and the cluster health shows yellow.
Replicas protect against the loss of an indexer node. If one node fails, the copies held on the surviving nodes can be promoted to primaries, so search and ingestion continue while you repair or replace the node. Replicas do not protect against accidental deletion, a bad index mapping change, a faulty decoder that writes malformed data, or corruption that is written to the primary before replication. Those problems copy to every replica within seconds. For those failures you need point-in-time copies, which is the job of indexer snapshots. Treat replicas as availability and snapshots as recovery, and plan both separately with their own retention and restore tests.
The right replica count differs between recent and older data. Alerts from the last few days are searched often by analysts and by dashboards, so the availability and read performance that replicas provide usually matter most there. Older alerts are rarely queried and often exist mainly for retention obligations, so a lower replica count may be a reasonable trade for storage cost, provided the data is still covered by snapshots. Changing replicas on warm data is a separate operation tied to node attributes and index policies, so follow the hot-warm topic in this group for those steps rather than changing counts ad hoc. Ask your team to document the replica count per index age band and the reason for each, so the decision survives staff changes.
Planning steps to follow before changing index settings
This sequence turns a vague wish to change shards or replicas into a measured decision, checked against real index sizes, node roles and retention needs, and tested before any production change. Each step ends with a check that tells you whether to move on.
Inventory index sizes and daily alert volume
The Wazuh administrator records the current size, document count, primary shard count and replica count for each index family, mainly wazuh-alerts-* and wazuh-archives-* if archives are enabled. Use the indexer's cat indices output and the dashboard index pattern views, then calculate average daily growth from the last several weeks of data. Confirm the exact API calls for your release in the Wazuh documentation before running them. The step is done when you have a table of sizes and daily growth per index family that another engineer can reproduce.
Confirm node count and node roles
The platform engineer lists every indexer node, its role (data, master-eligible or both), its heap size, disk capacity and free space, and whether it sits on the same hardware or storage class as the others. This shows how many shards a node can hold and whether any node is already close to its disk watermarks. Compare the result with the Wazuh indexer deployment layout you intended, since nodes added later may not hold the same load. The step is done when the node inventory matches what the cluster reports and every data node has documented capacity.
Decide the retention window
The compliance owner and the SOC lead agree how many days of alerts must remain searchable and how long archived data must be kept, based on internal policy and the frameworks your organization is assessed against. The retention window determines how many indices exist at any moment and therefore how many primary and replica shards the cluster must hold. Ask your assessor and legal team to confirm the period in writing rather than assuming a default. The step is done when the retention period is signed off and the projected index count is calculated from it.
Set target shard and replica counts per index family
Using the sizes, growth rate, node count and retention window, the Wazuh administrator proposes a primary shard count and replica count for each index family. Check that each shard stays within a size range your team can recover and move, and that the total shard count per node leaves headroom for failover. Record why each number was chosen, because shard counts for new indices are usually easier to change at creation time than later. The step is done when the proposed settings are in a reviewed document with the reasoning attached.
Test the chosen layout in a non-production cluster
The platform team builds a non-production indexer cluster with the same node count and roles where possible, loads representative alert data (a copy of production data is best, subject to your data handling rules), and applies the proposed templates. Run the expected searches, measure query response, and simulate a node stop to confirm that replicas take over and cluster health returns to green. The step is done when the test cluster reaches green after the failover test and the dashboard searches return the results the SOC expects.
Check cluster health before the change
Immediately before the production change, confirm that cluster health is green, no shards are unassigned, disk usage is below the watermark thresholds, and no other maintenance is underway. Take and verify a snapshot of the affected indices so the rollback path has data to restore from. The step is done when the health check, shard status and snapshot verification are recorded with timestamps and a named person has approved the start.
Apply the change and confirm balanced allocation
The administrator applies the new index template or settings in a planned window, following the Wazuh documentation for the release in use. Afterwards, confirm that shards are distributed evenly across data nodes, that replicas are allocated, and that health is green again. Then run the dashboard searches from the test plan and compare results with the pre-change baseline. The step is done when allocation is balanced, searches match expected results, and the rollback path has been documented as no longer needed or has been executed cleanly.
Limits to confirm in your own environment
The values that decide shard and replica counts depend on your Wazuh release, your existing index configuration and your hardware. Treat each item below as a check to complete before you change anything in a production indexer cluster.
Default shard and replica settings
Confirm the default number of primary shards and replicas that your installed Wazuh release creates for alert indices. Defaults have changed between versions, so read them from the release you run rather than from older guides or forum posts. Record the values for wazuh-alerts-* and wazuh-archives-* separately, because they may not match. Ask your vendor or check the documentation for the exact release before planning any change.
Existing index templates
Check whether index templates in your deployment already set shard and replica counts for Wazuh indices. A template applies to new indices only, so a change you make to an existing template will not reshape indices that were created earlier. Compare the template in the cluster with what you expect from your installation method, and note any custom templates added by your team or a previous integrator.
Behavior with existing indices
Confirm how your installed version handles shard counts on indices that already exist. Shard count on a primary index is fixed once the index is created, so reaching a new layout usually means creating new indices and reindexing or rolling over. Ask the vendor whether a given change applies to future indices, existing indices or both, and test the sequence on a copy of the data before running it on production.
Hardware and storage per node
Document the CPU, memory, disk type and free capacity on every indexer node, including nodes that will be added later. Uneven nodes make it harder to spread shards evenly and can leave one node filling its disk first. Check how much disk headroom your cluster needs before it stops allocating shards, and confirm the watermark settings your version uses rather than assuming the defaults.
Network throughput for replica traffic
Measure whether the links between indexer nodes can carry replica traffic at your peak indexing rate. Each replica receives its own copy of every write, and recovery or reallocation after a node failure copies whole shards across the network. Test sustained throughput between nodes, not only peak bandwidth, and confirm that replication and recovery traffic will not compete with dashboard or agent traffic on the same links.
Sizing values from a review
This page does not give sizing figures. The right shard and replica counts depend on your daily data volume, retention period, alert rate and hardware, and none of these are the same across organizations. Confirm the final values with the vendor documentation for your release, and have a sizing review check them against your measured data before you commit.
Wazuh deployment optionsSecurity and operations around shard and replica changes
Changes to index settings for Wazuh indices should be made only by named administrators using audited access, and every change should be recorded and reviewed by someone other than the person who made it. Shard counts, replica counts and allocation filters all alter how the indexer stores alert data, so treat them like configuration changes to a production system: write down the current values, the reason for the change, the expected effect and the rollback step before anything is applied. Confirm with your own environment which roles can call the indexer API and whether those calls appear in your audit trail, because a settings change that nobody can attribute is hard to explain to an auditor or to your incident responders later.
Take a current snapshot before any re-indexing or large allocation change, and confirm that it restores before you start. A re-index copies documents into a new index, so a failed run can leave you with partial data, duplicated documents or a source index that has been removed too early. A recent snapshot gives you a known good state to return to. The snapshot repository, retention and restore testing are covered in the snapshots topic, so use that design as the baseline for this work rather than assuming a file-level backup of the central components protects the indices.
Replica placement decides which indexer nodes hold full copies of sensitive alert data, so decide where replicas may live before you add nodes or change replica counts. A new node joins the cluster with its own certificate, and that certificate should be issued, stored and revoked under the same controls as the existing nodes. Plan node placement, host hardening and certificate issuance together, and confirm that the hosts receiving replicas meet the same access and encryption requirements as the primary data hosts. After any change, monitor cluster health and shard allocation as routine work: check that the cluster returns to a green status, that replicas assign to the intended nodes and that no shards remain unassigned for longer than your alerting threshold.
Questions teams ask before planning shards and replicas
What drives the effort of a Wazuh indexer shard plan?
The effort follows the size of the cluster, the volume of data it holds, and how long that data is kept. Each index family, such as alerts, archives or monitoring indices, needs its own shard decision, so the number of families matters as much as the node count. The largest factor is usually existing data: if the current shard count is wrong, changing it means re-indexing historical indices, and that work scales with how much data already sits in the cluster. Ask for current index sizes, shard counts per index, node inventory and the retention period before anyone estimates the work.
Can our internal team plan shards and replicas without outside help?
Yes, if the team already operates an OpenSearch-based indexer, has a test cluster that mirrors production closely enough to rehearse changes, and can run the work as a controlled change with a rollback path. Planning the shard layout is mostly arithmetic on sizes, node counts and retention, and the Wazuh documentation describes the settings involved. Outside help tends to add value where the existing data must be re-indexed under load, where nodes are added to a cluster that is already close to capacity, or where the team has no one who has run this change before. Confirm the test environment and the operations experience first, since those decide the answer.
How long does a shard or replica change take?
The duration depends on index size, the number of indices affected, and the load the cluster carries while the change runs. A replica count change on a small cluster can finish quickly, while re-indexing a large alert history to a new shard count can take far longer and can slow search and ingestion while it runs. No single figure applies across environments, so ask for the scope in writing and for results from a rehearsal on a copy of your data. A useful scope names the indices affected, the expected load window, the rollback steps and the checks that confirm the cluster is healthy at the end.
What does the work need from our side?
The planning work depends on accurate inputs from your environment. Expect to provide current cluster health and shard metrics, the node inventory with CPU, memory and storage for each node, the retention requirements that set how long each index family must stay searchable, and any compliance constraints on deletion. A test environment with representative data is needed before any production change. You also need a change window agreed with the teams that depend on alert search, and an owner who can approve the rollback plan. Missing inputs usually show up later as rework, so confirm them before the scope is signed.
Do replicas replace backups for Wazuh indices?
No. Replicas keep copies of shards on other nodes so the cluster can keep serving data when a node fails, but they do not protect against deletion, corruption that spreads to every copy, a bad retention policy, or an operator error that removes an index. Replicas also add storage cost, since each replica is a full copy of the shard data. Protection against those events needs snapshots stored in a separate repository, tested by restoring them. The Wazuh indexer snapshot topic covers that setup, and it is a separate planning decision from the replica count.
What does a fixed-scope shard planning engagement include in writing?
DeployOpen agrees a fixed scope in writing before work starts. For shard and replica planning, the written scope typically names the cluster and indices in scope, the current state that was reviewed, the target shard and replica layout with the reasoning for each index family, the change sequence, the rehearsal steps, the rollback plan, the verification checks and the handover material. It should also state what is excluded, such as hardware purchases, node builds or retention changes handled elsewhere. Ask for the deliverables and acceptance criteria to be listed so both sides agree on what done means. A quote follows from that written scope.
How DeployOpen plans and delivers indexer shard and replica work
DeployOpen treats shard and replica planning for the Wazuh indexer as a written, fixed-scope engagement inside your own infrastructure. The work starts from your alert volumes, node layout and resilience requirements, and ends with a documented layout your team can operate.
How we scope
- Review your indexer node count, storage, and current index sizes before recommending any shard or replica settings.
- Agree in writing which indices, retention periods and resilience targets the planning covers.
- Confirm whether a shard count change requires re-indexing, and include that work in the quoted scope if so.
How we build
- Apply the agreed index template and replica settings to the wazuh-alerts indices in a non-production copy first.
- Check shard distribution across nodes and watch for hotspots after each change.
- Test that the cluster stays green when a node is taken offline during a controlled test window.
How we hand over
- Deliver a written shard and replica standard with the reasoning behind each setting and its storage impact.
- Document the steps to add nodes, adjust replicas and plan re-indexing, so your team can repeat them.
- Walk your operators through the cluster health checks they will run and the thresholds that should prompt review.
How we support
- Engagements are fixed-scope, and the written scope defines what happens after handover.
- Ongoing support, upgrades and continuous testing are available as a retainer.
- Re-review shard and replica settings when alert volume, node count or retention requirements change.

