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 ``replication.autoexpel`` option designed for managing dynamic clusters using YAML-based configurations.
3609
+
It enables the automatic expulsion of instances that are removed from the YAML configuration.
3610
+
3611
+
Only instances with names that match the specified prefix are considered for expulsion; all others are excluded.
3612
+
Additionally, instances without a persistent name are ignored.
3613
+
3614
+
If an instance is in read-write mode and has the latest database schema, it initiates the expulsion of instances that:
3615
+
- Match the specified prefix
3616
+
- Absent from the updated YAML configuration
3617
+
3618
+
The expulsion process follows the standard procedure, involving the removal of the instance from the ``_cluster`` system space.
3619
+
3620
+
The ``autoexpel`` logic is activated during specific events:
3621
+
- **Startup**. When the cluster starts, ``autoexpel`` checks and removes instances not matching the updated configuration.
3622
+
- **Reconfiguration**. When the YAML configuration is reloaded, ``autoexpel`` compares the current state to the updated configuration and performs necessary expulsions.
3623
+
- ``box.status`` **Watcher Event**. Changes detected by the ``box.status watcher`` also trigger the ``autoexpel`` mechanism.
3624
+
3625
+
New instances
3626
+
``Autoexpel`` does not take any actions on newly joined instances unless one of the triggering events occurs.
3627
+
This means that an instance meeting the ``autoexpel`` criterion can still join the cluster, but it may be removed
3628
+
later during reconfiguration or on subsequent triggering events.
3629
+
3630
+
.. NOTE::
3631
+
The ``replication.autoexpel`` option governs the expelling process and is configurable at the replicaset, group, and
3632
+
global levels. It is not applicable at the instance level.
3633
+
3634
+
Configuration fields
3635
+
- **`enabled`** *(boolean, default: `false`)*: enables or disables the ``autoexpel`` logic.
3636
+
3637
+
- **`by`** *(string, default: `nil`)*: specifies the ``autoexpel`` criterion. Currently, only `prefix` is supported and must be explicitly set.
3638
+
3639
+
- **`prefix`** *(string, default: `nil`)*: defines the pattern for instance names that are considered part of the cluster.
3640
+
3641
+
**Example Patterns**:
3642
+
- If instances are prefixed with the replicaset name, set:
3643
+
``prefix: '{{ replicaset_name }}'``
3644
+
- For instances matching a specific pattern (e.g., `i-\d\d\d`), set:
3645
+
``prefix: 'i-'``
3646
+
3647
+
**Example**
3648
+
3649
+
1. Create a ``config.yaml`` file with the following content:
0 commit comments