Skip to content
logo
Percona Operator for MongoDB
Arbiter and non-voting nodes
Initializing search
    percona/k8spsmdb-docs
    percona/k8spsmdb-docs
    • Welcome
      • System requirements
      • Design and architecture
      • Comparison with other solutions
      • Install with Helm
      • Install with kubectl
      • Install on Minikube
      • Install on Google Kubernetes Engine (GKE)
      • Install on Amazon Elastic Kubernetes Service (AWS EKS)
      • Install on Microsoft Azure Kubernetes Service (AKS)
      • Generic Kubernetes installation
      • Install on OpenShift
      • Application and system users
      • Changing MongoDB options
      • Anti-affinity and tolerations
      • Labels and annotations
      • Exposing the cluster
      • Local storage support
      • Arbiter and non-voting nodes
        • Adding Arbiter nodes
        • Adding non-voting nodes
      • MongoDB sharding
      • Transport encryption (TLS/SSL)
      • Data at rest encryption
      • Telemetry
        • About backups
        • Configure storage for backups
        • Making scheduled backups
        • Making on-demand backup
        • Storing operations logs for point-in-time recovery
        • Restore from a previously saved backup
        • Delete the unneeded backup
      • Upgrade MongoDB and the Operator
      • Horizontal and vertical scaling
      • Multi-cluster and multi-region deployment
      • Monitor with Percona Monitoring and Management (PMM)
      • Add sidecar containers
      • Restart or pause the cluster
      • Debug and troubleshoot
      • OpenLDAP integration
      • How to use private registry
      • Creating a private S3-compatible cloud for backups
      • Restore backup to a new Kubernetes-based environment
      • How to use backups to move the external database to Kubernetes
      • Install Percona Server for MongoDB in multi-namespace (cluster-wide) mode
      • Upgrading Percona Server for MongoDB manually
      • Custom Resource options
      • Percona certified images
      • Operator API
      • Frequently asked questions
      • Old releases (documentation archive)
      • Release notes index
      • Percona Operator for MongoDB 1.14.0 (2023-03-13)
      • Percona Operator for MongoDB 1.13.0 (2022-09-15)
      • Percona Operator for MongoDB 1.12.0 (2022-05-05)
      • Percona Distribution for MongoDB Operator 1.11.0 (2021-12-21)
      • Percona Distribution for MongoDB Operator 1.10.0 (2021-09-30)
      • Percona Distribution for MongoDB Operator 1.9.0 (2021-07-29)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.8.0 (2021-05-06)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.7.0 (2021-03-08)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.6.0 (2020-12-22)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.5.0 (2020-09-07)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.4.0 (2020-03-31)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.3.0 (2019-12-11)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.2.0 (2019-09-20)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.1.0 (2019-07-15)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.0.0 (2019-05-29)

    • Adding Arbiter nodes
    • Adding non-voting nodes

    Using Replica Set Arbiter nodes and non-voting nodes¶

    Percona Server for MongoDB replication model is based on elections, when nodes of the Replica Set choose which node becomes the primary node.

    The need for elections influences the choice of the number of nodes in the cluster. Elections are the reason to avoid even number of nodes, and to have at least three and not more than seven participating nodes.

    Still, sometimes there is a contradiction between the number of nodes suitable for elections and the number of nodes needed to store data. You can solve this contradiction in two ways:

    • Add Arbiter nodes, which participate in elections, but do not store data,
    • Add non-voting nodes, which store data but do not participate in elections.

    Adding Arbiter nodes¶

    Normally, each node stores a complete copy of the data, but there is also a possibility, to reduce disk IO and space used by the database, to add an arbiter node. An arbiter cannot become a primary and does not have a complete copy of the data. The arbiter does have one election vote and can be the odd number for elections. The arbiter does not demand a persistent volume.

    Percona Operator for MongoDB has the ability to create Replica Set Arbiter nodes if needed. This feature can be configured in the Replica Set section of the deploy/cr.yaml file:

    • set arbiter.enabled option to true to allow Arbiter instances,
    • use arbiter.size option to set the desired amount of Arbiter instances.

    For example, the following keys in deploy/cr.yaml will create a cluster with 4 data instances and 1 Arbiter:

    ....
    replsets:
      ....
      size: 4
      ....
      arbiter:
        enabled: true
        size: 1
        ....
    

    Note

    You can find description of other possible options in the replsets.arbiter section of the Custom Resource options reference.

    Adding non-voting nodes¶

    Non-voting member is a Replica Set node which does not participate in the primary election process. This feature is required to have more than 7 nodes, or if there is a node in the edge location, which obviously should not participate in the voting process.

    Note

    Non-voting nodes support has technical preview status and is not recommended for production environments.

    Note

    It is possible to add a non-voting node in the edge location through the externalNodes option. Please see cross-site replication documentation for details.

    Percona Operator for MongoDB has the ability to configure non-voting nodes in the Replica Set section of the deploy/cr.yaml file:

    • set nonvoting.enabled option to true to allow non-voting instances,
    • use nonvoting.size option to set the desired amount of non-voting instances.

    For example, the following keys in deploy/cr.yaml will create a cluster with 3 data instances and 1 non-voting instance:

    ....
    replsets:
      ....
      size: 3
      ....
      nonvoting:
        enabled: true
        size: 1
        ....
    

    Note

    You can find description of other possible options in the replsets.nonvoting section of the Custom Resource options reference.

    Contact Us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: 2023-03-30
    Percona LLC and/or its affiliates, © 2009 - 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.