In today’s world, it’s essential to have an efficient and scalable computing infrastructure. One such technology that has gained popularity for managing distributed systems is Apache Mesos. In this comprehensive guide, we will walk you through the process of how to set up Apache Mesos on Rocky Linux.
Table of Contents
- Introduction to Apache Mesos
- Prerequisites
- Installing and Configuring Mesos
- Installing Mesos
- Configuring Mesos Master and Agent Nodes
- Launching Mesos
- Verifying Mesos Installation
- Conclusion
Introduction to Apache Mesos
Apache Mesos is an open-source cluster management system designed to handle the complexities of managing distributed systems. It offers a highly scalable, fault-tolerant, and flexible platform for efficiently managing resources in a data center. Mesos is used by several high-profile organizations, including Twitter, Airbnb, and Apple.
How to Set up Apache Mesos on Rocky Linux
Prerequisites
Before proceeding with the installation, make sure you have the following:
- A Rocky Linux server with root access or a user with sudo privileges.
- A stable internet connection to download necessary packages.
- A minimum of two nodes: one for the Mesos master and one for the Mesos agent.
Note: For better performance and fault tolerance, consider using three Mesos master nodes.
Installing and Configuring Apache Mesos on Rocky Linux
In this section, we will walk through the process of installing and configuring Mesos on your Rocky Linux server.
Installing Mesos
First, update your system packages and install the necessary dependencies:
sudo dnf update -y
sudo dnf install -y epel-release
sudo dnf install -y java-1.8.0-openjdk-devel
Next, add the Mesosphere repository for installing Mesos:
sudo tee /etc/yum.repos.d/mesosphere.repo << EOL
[mesosphere]
name=Mesosphere Packages for EL7 - \$basearch
baseurl=http://repos.mesosphere.io/el/7/\$basearch/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://repos.mesosphere.io/el/RPM-GPG-KEY-mesosphere
EOL
Install Mesos on both master and agent nodes:
sudo dnf install -y mesos
Configuring Apache Mesos Master and Agent Nodes on Rocky Linux
After installing Mesos, we need to configure the Mesos master and agent nodes.
On the master node, create a zk
file to configure Zookeeper:
echo "zk://<your-master-ip>:2181/mesos" | sudo tee /etc/mesos/zk
Replace
<your-master-ip>
with the actual IP address of your Mesos master node.
Set the quorum value to 1.
Configure Apache Mesos Master on Rocky Linux
Before starting the Mesos master service, we need to configure it. Open the /etc/mesos-master/work_dir
file and set the work directory:
echo '/var/lib/mesos' > /etc/mesos-master/work_dir
Next, set the hostname and IP address for the Mesos master. Replace {master-ip}
with the actual IP address of your master node:
echo '{master-ip}' > /etc/mesos-master/ip
cp /etc/mesos-master/ip /etc/mesos-master/hostname
Now, enable and start the Mesos master service:
systemctl enable mesos-master
systemctl start mesos-master
Check the status of the Mesos master service:
systemctl status mesos-master
Configure Mesos Agent on Rocky Linux
Before starting the Mesos agent service, we need to configure it. First, set the work directory in the /etc/mesos-agent/work_dir
file:
echo '/var/lib/mesos' > /etc/mesos-agent/work_dir
Set the hostname and IP address for the Mesos agent. Replace {agent-ip}
with the actual IP address of your agent node:
echo '{agent-ip}' > /etc/mesos-agent/ip
cp /etc/mesos-agent/ip /etc/mesos-agent/hostname
Specify the Mesos master IP address. Replace {master-ip}
with the actual IP address of your master node:
echo 'zk://{master-ip}:2181/mesos' > /etc/mesos/zk
Now, enable and start the Mesos agent service:
systemctl enable mesos-agent
systemctl start mesos-agent
Check the status of the Mesos agent service:
systemctl status mesos-agent
Access Mesos Web Interface
Once both the Mesos master and agent services are up and running, you can access the Mesos web interface by visiting the following URL in your web browser:
http://{master-ip}:5050
Replace {master-ip}
with the actual IP address of your master node. The Mesos web interface will show you the cluster’s status, resources, and tasks.
Conclusion
Congratulations! You have successfully set up Apache Mesos on Rocky Linux. Mesos is a powerful and flexible cluster manager that can be used to manage resources and tasks for large-scale distributed applications. By following this guide, you have learned how to install and configure Mesos master and agent nodes, as well as access the Mesos web interface.
For more information on how to configure and use Mesos, you can refer to the official Mesos documentation.
Additionally, you might want to check out other LinuxBoost articles on setting up popular tools and applications on Rocky Linux, such as how to set up Apache Hadoop on Rocky Linux and how to install and configure Elasticsearch on Rocky Linux.