High Availability Server Using Raspberry Pi 4 Cluster and Docker Swarm

Received Nov 11, 2020 Revised Dec 1, 2020 Accepted July 6, 202110 In the Industrial 4.0 era, almost all activities and transactions are carried out via the internet, which basically uses web technology. For this reason, it is absolutely necessary to have a high-performance web server infrastructure capable of serving all the activities and transactions required by users without any constraints. This research aims to design a high-performance (high availability) web server infrastructure with low cost (low cost) and energy efficiency. low power) using Cluster Computing technology on the Raspberry Pi Single Board Computing and Docker Container technology. The cluster system is built using five raspberry Pi type 4B modules as cluster nodes, and the Web server system is built using docker container virtualization technology. Meanwhile, cluster management uses Docker Swarm technology. Performance testing (Quality of Service) of the cluster system is done by simulating a number of loads (requests) and measuring the response of the system based on the parameters of Throughput and Delay (latency). The test results show that the Raspberry Pi Cluster system using Docker Swarm can be used to build a High Availability Server system that is able to handle very high requests that reach Throughput = 161,812,298 requests / sec with an Error rate = 0%. Keyword:


INTRODUCTION
In the Industrial 4.0 era, almost all activities and transactions are carried out via the internet, which basically uses web technology. The high activity and transaction of requests for services from users can cause the web server to fail to serve the user needs. Therefore, it is absolutely necessary to have a high-performance web server infrastructure that capable to serving all the activities and transactions required by the user without any constraints. In the era of cloud computing, a distributed computing system is needed that can abstract the capabilities of the hardware in carrying out a computation process called Virtualization [1]. With virtualization, hardware resources that exist in a cloud computing service can share and run a variety of different application environments. There are two types of technology commonly used in hardware virtualization, namely Hypervisor and Container [2]. Efficient use of hardware resources, replication of processes for high availability, and the demand for systems that are more tolerant of system errors drive the development of this virtualization system. In a study it was reported that the use of virtualization technology in a data center can reduce carbon emissions by about 30% compared to using physical infrastructure [3].
Virtualization technology is also growing following the abstraction needs of the computational process. Traditional virtualization techniques are considered to consume too much hardware resources to run computational processes, so the lighter container-based virtualization techniques can be an attractive option. The giant technology companies such as Microsoft, Google and Facebook also use container technology in their datacentre services [4]. Compared to the traditional approach that uses virtual machines as the basis for the development and deployment of applications running on a cloud-based infrastructure, container technology provides a higher level of portability and availability that enables developers to build and deploy their applications more widely in efficient and flexibility manner. [5].
Container technology is a modern virtualization technology that is gaining popularity. One of the most adopted container-based virtualization technologies is Docker [6]. Docker is an open source project which is an implementation of a very light weight operating system level virtualization technology. Docker was introduced in 2013, and is the industry standard for container technology. Containers are standard units of software that allowed developers to isolate their applications from their environment. Today, Docker is the de facto standard for building and sharing applications in containers ranging from the desktop to the cloud [7].
This study aims to design and build a web server infrastructure with high performance (high availability) at low cost (low cost) and energy efficient (low power) using the Raspberry Pi Single Board Computing and Docker Container technology. In this study, several tests were also conducted on the Quality of Service (QoS) of the system built to determine the system's ability to handle service requests from users.

RESEARCH METHOD
In this study, the cluster system was built using five nodes where each node will be implemented using the Raspberry Pi type 4B Single Board Computer (SBC) module. The Web server system in this study was built using virtualization technology which will be implemented using Docker containerization technology. This container system virtualization technology is different from the virtualization technology that uses a virtual machine. A virtual machine technology performs virtualization by emulating at the machine level while container technology emulates at the operating system level. Each node in the cluster will be integrated into a single system using Docker Swarm technology [8]. Docker Swarm acts as a manager in this cluster system and also has an internal load balance system which is used to manage the distribution of workloads to each worker node. With this load balance, the utilization of computational resources can be done efficiently and maximally. Load balance can also minimize system failure in serving user requests.
In this study also tested the performance of the cluster system based on the parameters of throughput and delay/latency. Throughput is a measure of the average number of successful deliveries in a measure of time. In general, the maximum throughput can indicate the network capacity (bandwidth) of the system. Delay or latency is the time it takes a data packet to travel from origin to destination. In implementation, the delay value is the length of time the packet takes from the original application to the destination application. The amount of delay can be caused by many things. One of the factors that influence is the determination of packet priority from the scheduling algorithm used.

Cluster Architecture Design
The architectural design of the cluster that is built can be seen as in Figure 1. The architecture of this cluster system uses five Raspberry Pi type 4B modules with CPU specifications using Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz, 4GB RAM and a Gigabit ethernet port. For the switch we using the TP-Link TL-SG1008MP Gigabit 8-port. This design uses the standard architecture recommendation of Docker Swarm [8] with 3 nodes as Managers and 2 nodes as Workers as shown in Table 1.
Each node is made into a Docker Machine by installing the Docker Engine application version 19.03.12 which runs on the 32-bit version of the Raspberry Pi OS Lite version of the operating system. To merge all nodes into one cluster, run the Docker Swarm application on all nodes and are given the appropriate roles, namely 3 nodes as Master and 2 nodes as Workers.

System Performance
Performance of the system is measured based on throughput and delay/latency parameters of the response given by the system after being given load testing. The request load is simulated using Apache Jmeter application [9] version 5.3 which is run from the client system in the form of a desktop PC with intel pentium G640 processor with 2.8GHz, 6GB RAM and Ms.Windows 8.1 operating system version 64bit. For easy observation of cluster behavior is visually used Visualizer image container [10] which is run on the manager node of the cluster system as a web service that can be accessed through the browser in the client machine. Some of the test scenarios performed are as follows: a) Scenario 1: testing the reliability of system in handling system failures due to resource unavailability (failover). This test aims to observe and measure the availability level of the system by providing a condition where one or more machines are no longer available to be able to provide the services (single point of failure). And then try to access the Visualiver application service at the same address to see if the cluster system is still capable of running the Visualizer application service [10]. b) Scenario 2: testing the reliability of the system in handling the process of adding and reducing the number of server nodes in anticipation of adjusting machine capacity needs (scalability). This test aims to observe and measure the availability level of the system by looking at the scalability capabilities of the system by trying to duplicate system services. In this scenario, it will be observed how the system behaves when scaling both scale-up and scale-down. In this test we created a static website using Hypriot image container [11] as a web service that will be in scalling and viewed cluster behavior using Visualizer. c) Scenario 3: testing the reliability of system in handling overload with load balancing capabilities.
This test aims to observe and measure the availability level of the system by providing a condition where the system will be burdened with a number of service requests as shown in Table  2. In this test is used Apache Jmeter application that will simulate a number of service request loads (requests) to the system and simultaneously measure the performance of throughput and delay/latency of the system.

Docker
Docker is a software platform that packages the applications into a standard unit called a container that has everything the applications needs to work including libraries, system tools, code, and processing time. Container is one of the virtualization techniques at the operating system level where each process or application running each container will have the same kernel while virtualization at the machine level such as virtual machine requires a different operating system kernel per application running [12]. Doker has two licensing models: open source Docker Community Edition (CE) and subscription-based Docker Enterprise Edition (EE). Docker is an application based on open source technology that allows developers or anyone else to create, run, test and launch applications in a container. Docker quickly packages the applications with their components in an isolated container, allowing them to run on-premises infrastructure without configuring containers [14]. Docker uses a client-server architecture. The Docker client contacts the Docker daemon, which performs the running job, and distributes the Docker container. Both docker client and daemon can run on the same system. Docker client and daemon communicate via sockets or via API provided by Docker [13] Fig. 3 Docker System Architecture Scheme [13]

Docker Swarm
Docker Swarm is a tool for managing clusters and containers that are already integrated in the Docker Engine, also known as Swarm-kits. Swarm-kit is a separate set of projects from the opensource community of developers. Cluster swarms are a collection of multiple Docker hosts that run swarm mode and there are acting as managers (who manage cluster members and manage delegate tasks) and some act as workers (who implement or process services (swarm services). Any Docker host can act as a manager, worker, or both [15].

RESULTS AND ANALYSIS
In a test experiment with Scenario 1, the initial condition of the Visualizer service was run by the rpi2 server machine. Then we reboot the rpi2 server and try to access the Visualiver application service at the same address. As seen in Figure 5. Visualizer application service can still run and this service has been moved automatically to rpi1 server. Thus the ability of fail over on this cluster system is able to run very quickly and without downtime. This capability is absolutely necessary in a high availability system (a) (b)

Fig. 5 Visualization cluster (a) initial condition (b) reboot condition rpi2
In test scenario 2, we observed and measured system availability level based on scalability capability of the system by trying to scale-up and scale-down the Hypriot web sever as a service running . From the test results, it can be seen that the system capability in the scale-up and scale-down process can run well and without downtime. This capability is absolutely necessary in a high availability system when it comes to serving an instant increase in the number of high requests so that the system is not overloaded.
In scenario 3 testing, we observed and measured system Availability level by providing a number of users (samples) who perform service requests using the Apache Jmeter application that will simulate a certain amount of service request load to the system and simultaneously measure system performance

CONCLUSION
From the results of this experiment it can be concluded that raspberry devices are able to run virtualization technology well using docker. Docker virtualization technology can also be used to create a computer cluster that supports high availability servers. Based on the test result data it appears that raspberry cluster devices using docker are able to handle requests without any constraints with error rate = 0%. The designed device is also capable of handling a very high number of requests until it reaches throughput = 161,812,298 requests/sec.
From the test data obtained, it is recommended to choose the maximum number of containers possible. Too many containers do not guarantee system reliability will improve. The more containers will consume more CPU and Memory resources