Transferring Elasticsearch and Hadoop Data to Another Disk

Introduction

In this article, we will explain how to transfer Elasticsearch and Hadoop data to a different disk and create a symbolic link in Cluster systems.

Elasticsearch

First, stop the Elasticsearch service with the following command:

#systemctl stop elasticsearch

Next, navigate to the /var/lib directory using the command below:

#mc /var/lib

Then, depending on where the new LVM or new disk is mounted, navigate to that location in the right pane, and on the left pane, select the "elasticsearch" directory. Use the "F6" key to move the"elasticsearch"  folder to the new location.Ekran Resmi 2024-10-07 06.25.39.png

After the transfer process is completed, while you are on the newly moved elasticsearch folder, press the CTRL+X and then S key combination on your keyboard to create a symbolic link.

Next, navigate to the /var/lib directory and create the symbolic link to the new location by pointing to the moved elasticsearch folder. The system will treat the newly moved data as if it is still in the original location.

By using this method, the link will ensure that all the references to the original /var/lib/elasticsearch folder now point to the new disk where the data was moved.

Ekran Resmi 2024-10-07 06.28.10.pngAfter the process is completed, the symbolic link on the left side should appear as shown in the screenshot below.

Ekran Resmi 2024-10-07 06.29.13.png

Finally, the following command is executed to start the Elasticsearch service:

#systemctl start elasticsearch

 

Hadoop Data Transfer to Another Disk

To move the Hadoop data to a different disk, follow the steps below:

1. Stop All Hadoop Services: First, stop all Hadoop services to ensure data consistency during the move. Run the following command to stop Hadoop HDFS services:

# systemctl stop hadoop-hdfs*

2. Navigate to the /var/lib Directory: Next, use the following command to navigate to the /var/lib directory where the Hadoop HDFS data is stored:

#mc /var/lib

 

3. Move the Data: Once you're inside the /var/lib directory, identify the new LVM or disk that you’ve mounted. On the right side of the Midnight Commander interface, navigate to the mounted directory (where the new disk is located).

4. Move the hadoop-hdfs Directory: Select the hadoop-hdfs folder in the /var/lib directory on the left side, and press F6 to initiate the move operation. Move the hadoop-hdfs folder to the mounted directory on the right side of Midnight Commander.

Once the move is complete, proceed with creating a symbolic link, as described in the next steps.

Ekran Resmi 2024-10-07 06.32.25.png

After the transfer process is complete, while on the moved hadoop-hdfs file, press the CTRL+X, S key combination and create a symbolic link in the /var/lib directory.

Ekran Resmi 2024-10-07 06.33.32.png

After the process is complete, the symbolic link on the left side should appear as shown in the screenshot below.

Ekran Resmi 2024-10-07 06.34.13.png

Finally, the following command is applied to start the Hadoop services:

# systemctl start hadoop-hdfs*

Was this article helpful?
0 out of 0 found this helpful

Articles in this section

See more
Become a Certified Logsign User/Administrator
Sign-up for Logsign Academy and take the courses to learn about Logsign USO Platform in detail. Enjoy the courses, and get your badges and certificates. In these courses, you'll learn how to use Logsign in your work and add value to your career.
Visit Our Blog
Our Logsign USO Platform illustrate our expertise. So do the blog. Through our blog posts, deepen your knowledge on various SecOps topics or get updated about important news & modern approaches for cybersecurity. Get into the habit of reading valuable information provided by Logsign. Be a step ahead.