You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The first draft of rep autoexpel
* Error in TOC fixed
* Error in TOC fixed_1
* Indent fixed
* Some errors fixed
* Some errors fixed
* Env var added
* Code lines convertes to code blocks and fixed to lua lang
* divided into three sifferent subsections
* check links
* errors fixed
* errors fixed
* indentation fixed
* version highlighting added
* reviewer's comments applied
* reviewer's comments applied_1
* full example and logic deleted
* unuseful info deleted
The ``replication.autoexpel_enabled`` field is a boolean configuration option that determines whether the autoexpel logic is active for the cluster.
3682
+
This feature is designed to automatically manage dynamic cluster configurations by removing instances that are no longer present in the YAML configuration.
3683
+
3684
+
.. NOTE::
3685
+
3686
+
By default, the ``enabled`` field is set to ``false``, meaning the ``autoexpel`` logic is turned off. This ensures that no instances are automatically removed unless explicitly configured.
3687
+
3688
+
**Enabling ``autoexpel`` logic**
3689
+
3690
+
To enable ``autoexpel``, you should set enabled to true in the ``replication.autoexpel`` section of your YAML configuration:
3691
+
3692
+
.. code-block:: yaml
3693
+
3694
+
replication:
3695
+
autoexpel:
3696
+
enabled: true
3697
+
by: prefix
3698
+
prefix: '{{ replicaset_name }}'
3699
+
3700
+
3701
+
To disable ``autoexpel``, set enabled to ``false``.
3702
+
3703
+
3704
+
**Dependencies**
3705
+
3706
+
3707
+
If ``enabled`` is set to ``true``, the following fields are required:
3708
+
3709
+
1. ``by``: specifies the criterion for ``autoexpel`` (e.g., ``prefix``).
3710
+
2. ``prefix``: defines the pattern used to match instance names for expulsion.
3711
+
3712
+
Failure to configure these fields when enabled is true will result in a configuration error.
The ``prefix`` field filters instances for expulsion by differentiating cluster instances (from the YAML configuration) from external services (e.g., CDC tools). Only instances matching the prefix are considered.
3724
+
3725
+
A consistent naming pattern ensures the ``_cluster`` system space automatically aligns with the YAML configuration.
3726
+
3727
+
3728
+
If the ``prefix`` field is not set (``nil``), the ``autoexpel`` logic cannot identify instances for expulsion, and the feature will not function.
3729
+
This field is **mandatory** when ``replication.autoexpel_enabled`` is set to ``true``.
3730
+
3731
+
3732
+
How it works:
3733
+
3734
+
1. The prefix filters instance names (e.g., ``{{ replicaset_name }}`` for replicaset-specific names or ``i-`` for names starting with ``i-``).
3735
+
2. Instances matching the prefix and removed from the YAML configuration are expelled.
3736
+
3. Unnamed instances or those not matching the prefix are ignored.
3737
+
3738
+
Dynamic prefix based on replicaset name:
3739
+
3740
+
.. code-block:: yaml
3741
+
3742
+
replication:
3743
+
autoexpel:
3744
+
enabled: true
3745
+
by: prefix
3746
+
prefix: '{{ replicaset_name }}'
3747
+
3748
+
3749
+
In this setup:
3750
+
3751
+
- Instances are prefixed with a replicaset name (e.g., ``r-001-i-001`` for replicaset ``r-001``).
3752
+
- The prefix ensures that only instances with names matching the replicaset name are auto expelled when removed from the configuration.
3753
+
3754
+
3755
+
Static prefix for matching patterns:
3756
+
3757
+
.. code-block:: yaml
3758
+
3759
+
replication:
3760
+
autoexpel:
3761
+
enabled: true
3762
+
by: prefix
3763
+
prefix: 'i-'
3764
+
3765
+
In this setup:
3766
+
3767
+
- All instances with names starting with ``i-`` (e.g., ``i-001``, ``i-002``) are considered for expulsion.
3768
+
- This is useful when instances follow a uniform naming convention.
0 commit comments