The web content provides a comprehensive guide to setting up a highly available and fault-tolerant YugabyteDB cluster using Docker containers.
Abstract
The article offers a step-by-step tutorial on deploying a YugabyteDB cluster with a replication factor of 3 within Docker containers. It details the necessary commands for installing YugabyteDB, creating a Docker network, and configuring both single-node and multi-node clusters. The guide emphasizes the importance of fault tolerance and data durability, demonstrating how to emulate workloads and handle node disconnections and rejoins. It concludes with instructions for cleaning up resources and reiterates the benefits of using YugabyteDB for scalable and resilient database solutions.
Opinions
The author suggests that YugabyteDB is a popular choice for a distributed SQL database due to its scalability, fault tolerance, and data durability.
The guide advocates for the use of Docker to manage YugabyteDB infrastructure, citing ease of deployment and scalability.
The article implies that the provided setup process adheres to best practices for ensuring high availability and performance of a YugabyteDB cluster.
By showcasing the system's ability to maintain write/read availability despite node disconnections, the author positively endorses YugabyteDB's fault tolerance capabilities.
The inclusion of a workload generator for emulating SQL workloads suggests the author's belief in the importance of performance testing in a real-world scenario.
The conclusion expresses the author's confidence in YugabyteDB's ability to support demanding workloads and the advantage of Docker for infrastructure management.
The author encourages reader engagement by inviting them to clap for the story, follow their social media profiles, and consider a cost-effective AI service recommendation.
Setting up a YugabyteDB cluster using Docker
Your guide to setup a local YugabyteDB cluster on Docker containers for seamless scalability and performance
YugabyteDB is a popular distributed SQL database that offers high scalability, fault tolerance, and data durability. It allows users to deploy their databases across multiple data centers and cloud providers, ensuring high availability and performance. In this article, we’ll provide a step-by-step guide to setting up a YugabyteDB cluster with a replication factor of 3 using Docker containers. We’ll cover the necessary steps for configuring and deploying the cluster, and we’ll highlight best practices for ensuring fault tolerance and data durability. By the end of this article, you’ll have a fault-tolerant YugabyteDB cluster up and running on Docker, ready to handle your most demanding workloads.
1. Installing YugabyteDB
Pull the YugabyteDB Docker image.
$ docker pull yugabytedb/yugabyte
Pull Download the YugabyteDB workload generator.
$ docker pull yugabytedb/yb-sample-apps
2. Docker network
Let’s create a Docker network named “universe”:
$ docker network create universe
3. Creating a single-node cluster
We are going to use “yugabyted” which is a new database server that acts as a parent server across the yb-tserver and yb-master servers [ref.]:
dockerlogsyugabyte-client1 [main] INFOcom.yugabyte.sample.Main-Startingsampleapp...81 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Using a randomly generated UUID :b3ebd393-e49c-4dc6-9cb4-11223f6c5b5996 [main] INFO com.yugabyte.sample.common.CmdLineOpts - App:SqlInserts96 [main] INFOcom.yugabyte.sample.common.CmdLineOpts-Runtime(seconds):-196 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Adding node:yugabyte:543397 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Num reader threads:4,num writer threads:197 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Num unique keys to insert:200000097 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Num keys to update:097 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Num keys to read:150000097 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Value size:097 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Restrict values to ASCII strings:false97 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Perform sanity check at end of app run:false97 [main] INFOcom.yugabyte.sample.common.CmdLineOpts-TableTTL(secs):-197 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Local reads:false97 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Read only load:false5210 [main] INFO com.yugabyte.sample.apps.SqlInserts - Created table:postgresqlkeyvalue10273 [Thread-1] INFO com.yugabyte.sample.common.metrics.MetricsTracker - Read:886.36ops/sec(4.28ms/op),4474 totalops|Write:189.83ops/sec(5.24ms/op),951totalops|Uptime:5062 ms|15277 [Thread-1] INFO com.yugabyte.sample.common.metrics.MetricsTracker - Read:1167.40 ops/sec(3.41ms/op),10327totalops|Write:204.97ops/sec(4.86ms/op),1977 totalops|Uptime:10066ms|20242 [Thread-1] INFO com.yugabyte.sample.common.metrics.MetricsTracker - Read:1212.68 ops/sec(3.29ms/op),16392totalops|Write:210.54ops/sec(4.74ms/op),3030 totalops|Uptime:15031ms|
YB-TServer status
7. Fault tolerance with node disconnection
Let’s disconnect one container from network and observe continuous write/ready availability:
In this article, we’ve explored the process of setting up a YugabyteDB cluster with a replication factor of 3 using Docker containers. We’ve covered the essential steps for configuring and deploying the cluster, including best practices for ensuring fault tolerance and data durability. With YugabyteDB, you can build a highly scalable and resilient distributed database that can handle the most demanding workloads. By deploying your database on Docker, you can easily manage your infrastructure and seamlessly scale up or down as needed. We hope this article has been helpful in getting you started with YugabyteDB and Docker, and we wish you the best of luck in building your next-generation applications.