reading

1182Currently online
141Today's Reading
17Share Today
Multilingual display

Prepare the HDFS client environment

2018-04-13 19:12:13

This section describes how to prepare the HDFS client environment

Methods/Steps
1

1. Copy the corresponding compiled hadoop jar package to a non-Chinese path according to your computer's operating system

2

2. Configure the HADOOP_HOME environment variable

3

3. Configure the Path environment variable

4

4. Create a Maven project HdfsClientDemo

5

5. Import the corresponding dependency coordinates + log addition

6

Note: If Eclipse/Idea does not print logs, they are only displayed on the console

7

In the src/main/resources directory of the project, a file named "log4j.properties" will be filled in

8

6. Create a package named com.atguigu.hdfs

9

7. Create the HdfsClient class

10

8. The user name needs to be configured when the execution program is running

11

When a client operates HDFS, it has a user identity. By default, the HDFS client API obtains a parameter from the JVM for its user identity: -DHADOOP_USER_NAME=atguigu, where atguigu is the user name.

Recommendation