Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Hadoop installation and environment building tutorial

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the "Hadoop installation and environment building tutorial". In the daily operation, I believe many people have doubts about the installation and environment building tutorial of Hadoop. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "Hadoop installation and environment building tutorial". Next, please follow the editor to study!

1. Installation of Hadoop

1. Download address: https://archive.apache.org/dist/hadoop/common/. I downloaded the hadoop-2.7.3.tar.gz version.

two。 Create a folder zookeeper in / usr/local/

Mkdir hadoop

3. Upload files to / usr/local/source directory on Linux

3. Decompress

Run the following command:

Tar-zxvf hadoop-2.7.3.tar.gz-C / usr/local/hadoop

4. Modify the configuration file

Go to cd / usr/local/hadoop/hadoop-2.7.3/etc/hadoop/ and modify hadoop-env.sh

Run vimhadoop-env.sh to modify JAVA_HOME

5. Add the Hadoop execution command to our environment variable

Add to the / etc/profile file:

Export PATH=$PATH:/usr/local/hadoop/hadoop-2.7.3/bin:/usr/local/hadoop/hadoop-2.7.3/sbin

Execute the / etc/profile file:

Source / etc/profile

6. Copy hadoop from the npfdev1 machine to the npfdev2 and npfdev3 and npfdev4 machines. Use the following command:

First, create the / usr/local/hadoop directory on npfdev2 and npfdev3 and npfdev4 machines, respectively, and then execute the following command on npfdev1:

Scp-r / usr/local/hadoop/hadoop-2.7.3/ npfdev2:/usr/local/hadoop/

Scp-r / usr/local/hadoop/hadoop-2.7.3/ npfdev3:/usr/local/hadoop/

Scp-r / usr/local/hadoop/hadoop-2.7.3/ npfdev4:/usr/local/hadoop/

Remember: you need to modify the / etc/profile files for npfdev2 and npfdev3 and npfdev4 respectively:

Add to the / etc/profile file:

Export PATH=$PATH:/usr/local/hadoop/hadoop-2.7.3/bin:/usr/local/hadoop/hadoop-2.7.3/sbin

Execute the / etc/profile file:

Source / etc/profile

Then execute the hadoop command on npfdev1 and npfdev2 and npfdev3 and npfdev4 machines respectively to see if the installation is successful. And turn off the firewall.

7. To make sure that all machines can ping each other, use the following command:

(1)。 Ping npfdev1

(2)。 Ping npfdev2

(3)。 Ping npfdev3

(4)。 Ping npfdev4

8. Start hadoop:

Here we use npfdev1 as master,npfdev2 and npfdev3 and npfdev4 as three slave.

(1)。 Modify the configuration file core-site.xml

Enter cd / usr/local/hadoop/hadoop-2.7.3/etc/hadoop

The specific configuration is as follows:

(2)。 Start namenode on master machine npfdev1

You need to format namenode first, you need to format it the first time you use it, and then you don't need it.

Hdfs namenode-format

Then start namenode:

Hadoop-daemon.sh start namenode

Check through the jps command, if there is a java process for namenode, it means that we have successfully started namenode.

(3)。 Start datanode on slave machine npfdev2,npfdev3,npfdev4

At this point, the study on the "Hadoop installation and environment building tutorial" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report