Project: YugabyteDB (App Definition and Development / Database)
File: macos-yba.md

title: High availability during failures in YugabyteDB Anywhere headerTitle: High availability during node and zone failures linkTitle: HA during failures description: Simulate fault tolerance and resilience in a YugabyteDB Anywhere universe. headcontent: Keep serving requests through node, zone, and region failures menu: v2.18: identifier: node-failure-2-macos parent: fault-tolerance weight: 10 type: docs The following example demonstrates how YugabyteDB can continue to perform reads and writes even in case of node failures. In this scenario, you create a universe with a replication factor (RF) of 3, which allows a of 1. This means the universe remains available for both reads and writes even if a fault domain fails. However, if another were to fail (bringing the number of failures to two), writes would become unavailable on the universe to preserve data consistency. The examples are based on the YB Workload Simulator application, which uses the YugabyteDB JDBC configured with connection load balancing. The driver automatically balances application connections across the nodes in a universe and rebalances connections when a node fails. <ul class="nav nav-tabs-alt nav-tabs-yb"> <li> <a href="../macos/" class="nav-link"> <img src="/icons/database.svg" alt="Server Icon"> Local </a> </li> <li> <a href="../macos-yba/" class="nav-link active"> <img src="/icons/server.svg" alt="Server Icon"> YugabyteDB Anywhere </a> </li> </ul> Follow the to start a single region three-node universe in YugabyteDB Anywhere, connect the application, and run a read-write workload. To verify that the application is running correctly, navigate to the application UI at <http://localhost:8080/> to view the universe network diagram, as well as latency and throughput charts for the running workload. You can use YugabyteDB Anywhere to view per-node statistics for the universe, as follows: Navigate to Universes and select your universe. Select Nodes to view the total read and write IOPS per node and other statistics, as shown in the following illustration: Notice that both the reads and the writes are approximately the same across all nodes, indicating uniform load. Select Metrics to view charts such as YSQL operations per second and latency, as shown in the following illustration: Navigate to the to view the latency and throughput on the universe while the workload is running, as per the following illustration: You can stop one of the nodes to simulate the loss of a zone, as follows: Navigate to Universes and select your universe. Select Nodes, find the node to be removed, and then click its corresponding Actions > Stop Processes. Verify the details by selecting Nodes. Expect to see that the load has been moved off the stopped node and redistributed to the remaining nodes, as shown in the following illustration: Navigate to Metrics to observe a slight spike and drop in the latency and YSQL Ops / Sec charts when the node is stopped, as shown in the following illustration: Alternatively, you can navigate to the to see the node being removed from the network diagram when it is stopped (it may take a few minutes to display the updated network diagram). Also notice a slight spike and drop in the latency and throughput, both of which resume immediately, as shown in the following illustration: With the loss of the node, which also represents the loss of an entire fault domain, the universe is now in an under-replicated state. Despite the loss of an entire fault domain, there is no impact on the application because no data is lost; previously replicated data on the remaining nodes is used to serve application requests. {{% explore-cleanup-local %}}